MCPcopy Create free account

hub / github.com/Royalvice/DocDiff / functions

Functions101 in github.com/Royalvice/DocDiff

↓ 19 callersMethodmarginal_lambda
Compute lambda_t = log(alpha_t) - log(sigma_t) of a given continuous-time label t in [0, T].
schedule/dpm_solver_pytorch.py:151
↓ 19 callersMethodmarginal_std
Compute sigma_t of a given continuous-time label t in [0, T].
schedule/dpm_solver_pytorch.py:145
↓ 16 callersMethodmarginal_log_mean_coeff
Compute log(alpha_t) of a given continuous-time label t in [0, T].
schedule/dpm_solver_pytorch.py:126
↓ 15 callersMethodmodel_fn
Convert the model to the noise prediction model or the data prediction model.
schedule/dpm_solver_pytorch.py:452
↓ 9 callersMethod__init__
(self, beta)
model/DocDiff.py:341
↓ 6 callersFunctionextract_
(a, t, x_shape)
schedule/diffusionSample.py:8
↓ 5 callersMethodget_time_steps
Compute the intermediate time steps for sampling. Args: skip_type: A `str`. The type for the spacing of the time steps. We suppor
schedule/dpm_solver_pytorch.py:461
↓ 5 callersMethodinverse_lambda
Compute the continuous-time label t in [0, T] of a given half-logSNR lambda_t.
schedule/dpm_solver_pytorch.py:159
↓ 4 callersMethodget_betas
(self)
schedule/schedule.py:41
↓ 4 callersFunctionget_pad
(in_, ksize, stride, atrous=1)
model/DocDiff.py:356
↓ 4 callersMethodmarginal_alpha
Compute alpha_t of a given continuous-time label t in [0, T].
schedule/dpm_solver_pytorch.py:139
↓ 4 callersFunctionnoise_pred_fn
(x, t_continuous, cond=None)
schedule/dpm_solver_pytorch.py:290
↓ 3 callersFunctionImageTransform
(loadSize)
data/docdata.py:8
↓ 3 callersMethoddpm_solver_first_update
DPM-Solver-1 (equivalent to DDIM) from time `s` to time `t`. Args: x: A pytorch tensor. The initial value at time `s`.
schedule/dpm_solver_pytorch.py:555
↓ 3 callersFunctionexpand_dims
Expand the tensor `v` to the dim `dims`. Args: `v`: a PyTorch tensor with shape [N]. `dim`: a `int`. Returns: a
schedule/dpm_solver_pytorch.py:1303
↓ 3 callersFunctionextract
Extract some coefficients at specified timesteps, then reshape to [batch_size, 1, 1, 1, 1, ...] for broadcasting purposes.
schedule/diffusionSample.py:14
↓ 3 callersMethodsinglestep_dpm_solver_second_update
Singlestep solver DPM-Solver-2 from time `s` to time `t`. Args: x: A pytorch tensor. The initial value at time `s`.
schedule/dpm_solver_pytorch.py:602
↓ 2 callersFunctionadd_mark
添加水印,然后保存图片
utils/marker.py:48
↓ 2 callersMethoddata_prediction_fn
Return the data prediction model (with corrector).
schedule/dpm_solver_pytorch.py:441
↓ 2 callersFunctiongen_mark
生成mark图片,返回添加水印的函数
utils/marker.py:95
↓ 2 callersFunctionget_model_input_time
Convert the continuous-time `t_continuous` (in [epsilon, T]) to the model input time. For discrete-time DPMs, we convert `t_continuou
schedule/dpm_solver_pytorch.py:279
↓ 2 callersFunctioninterpolate_fn
A piecewise linear function y = f(x), using xp and yp as keypoints. We implement f(x) in a differentiable way (i.e. applicable for autograd).
schedule/dpm_solver_pytorch.py:1261
↓ 2 callersFunctionload_config
(path)
src/config.py:26
↓ 2 callersMethodmultistep_dpm_solver_update
Multistep DPM-Solver with the order `order` from time `t_prev_list[-1]` to time `t`. Args: x: A pytorch tensor. The init
schedule/dpm_solver_pytorch.py:940
↓ 2 callersMethodnoise_prediction_fn
Return the noise prediction model.
schedule/dpm_solver_pytorch.py:435
↓ 2 callersMethodsample
Compute the sample at time `t_end` by DPM-Solver, given the initial `x` at time `t_start`. =========================================
schedule/dpm_solver_pytorch.py:1055
↓ 2 callersMethodsinglestep_dpm_solver_third_update
Singlestep solver DPM-Solver-3 from time `s` to time `t`. Args: x: A pytorch tensor. The initial value at time `s`.
schedule/dpm_solver_pytorch.py:683
↓ 1 callersFunctionGBK2312
()
utils/marker.py:19
↓ 1 callersMethod__init__
(self)
src/sobel.py:6
↓ 1 callersFunctioncond_grad_fn
Compute the gradient of the classifier, i.e. nabla_{x} log p_t(cond | x_t).
schedule/dpm_solver_pytorch.py:308
↓ 1 callersMethodcosine_beta_schedule
(self, s=0.001)
schedule/schedule.py:10
↓ 1 callersFunctioncrop_image
裁剪图片边缘空白
utils/marker.py:84
↓ 1 callersMethoddenoise_to_zero_fn
Denoise at the final step, which is equivalent to solve the ODE from lambda_s to infty by first-order discretization.
schedule/dpm_solver_pytorch.py:549
↓ 1 callersFunctiondpm_solver
(betas, model, x_T, steps, model_kwargs)
src/trainer.py:244
↓ 1 callersMethoddpm_solver_adaptive
The adaptive step size solver based on singlestep DPM-Solver. Args: x: A pytorch tensor. The initial value at time `t_T`
schedule/dpm_solver_pytorch.py:964
↓ 1 callersMethodget_orders_and_timesteps_for_singlestep_solver
Get the order of each step for sampling by the singlestep DPM-Solver. We combine both DPM-Solver-1,2,3 to use all the function evalu
schedule/dpm_solver_pytorch.py:490
↓ 1 callersFunctioninit__result_Dir
()
src/trainer.py:16
↓ 1 callersMethodlinear_beta_schedule
(self)
schedule/schedule.py:19
↓ 1 callersFunctionmain
()
main.py:6
↓ 1 callersFunctionmain
()
utils/marker.py:168
↓ 1 callersFunctionmodel_fn
The noise predicition model function that is used for DPM-Solver.
schedule/dpm_solver_pytorch.py:317
↓ 1 callersFunctionmodel_wrapper
Create a wrapper function for the noise prediction model. DPM-Solver needs to solve the continuous-time diffusion ODEs. For DPMs trained on discr
schedule/dpm_solver_pytorch.py:178
↓ 1 callersMethodmultistep_dpm_solver_second_update
Multistep solver DPM-Solver-2 from time `t_prev_list[-1]` to time `t`. Args: x: A pytorch tensor. The initial value at t
schedule/dpm_solver_pytorch.py:804
↓ 1 callersMethodmultistep_dpm_solver_third_update
Multistep solver DPM-Solver-3 from time `t_prev_list[-1]` to time `t`. Args: x: A pytorch tensor. The initial value at t
schedule/dpm_solver_pytorch.py:862
↓ 1 callersMethodnoisy_image
Compute y_noisy according to (6) p15 of [2]
schedule/diffusionSample.py:64
↓ 1 callersMethodp_mean_variance
(self, x_t, cond_, t)
schedule/diffusionSample.py:53
↓ 1 callersMethodpredict_xt_prev_mean_from_eps
(self, x_t, t, eps)
schedule/diffusionSample.py:49
↓ 1 callersFunctionrandomABC
()
utils/marker.py:26
↓ 1 callersFunctionrandomcolor
()
utils/marker.py:40
↓ 1 callersFunctionrandomtext
()
utils/marker.py:18
↓ 1 callersFunctionset_opacity
设置水印透明度
utils/marker.py:72
↓ 1 callersMethodsinglestep_dpm_solver_update
Singlestep DPM-Solver with the order `order` from time `s` to time `t`. Args: x: A pytorch tensor. The initial value at
schedule/dpm_solver_pytorch.py:914
↓ 1 callersFunctiontest
(config)
src/train.py:10
↓ 1 callersMethodtest
(self)
src/trainer.py:108
↓ 1 callersFunctiontrain
(config)
src/train.py:4
↓ 1 callersMethodtrain
(self)
src/trainer.py:171
↓ 1 callersMethodupdate_average
(self, old, new)
model/DocDiff.py:350
↓ 1 callersMethodupdate_model_average
(self, ma_model, current_model)
model/DocDiff.py:345
Method__getattr__
(self, name)
src/config.py:12
Method__getitem__
(self, idx)
data/docdata.py:40
Method__init__
* `n_channels` is the number of dimensions in the embedding
model/DocDiff.py:24
Method__init__
* `in_channels` is the number of input channels * `out_channels` is the number of input channels * `time_channels` is the
model/DocDiff.py:68
Method__init__
(self, in_channels: int, out_channels: int, time_channels: int, is_noise: bool = True)
model/DocDiff.py:125
Method__init__
(self, in_channels: int, out_channels: int, time_channels: int, is_noise: bool = True)
model/DocDiff.py:140
Method__init__
(self, n_channels: int, time_channels: int, is_noise: bool = True)
model/DocDiff.py:158
Method__init__
(self, n_channels)
model/DocDiff.py:182
Method__init__
(self, n_channels)
model/DocDiff.py:198
Method__init__
* `image_channels` is the number of channels in the image. $3$ for RGB. * `n_channels` is number of channels in the initial feature
model/DocDiff.py:214
Method__init__
(self, input_channels: int = 2, output_channels: int = 1, n_channels: int = 32, ch_mults: Un
model/DocDiff.py:324
Method__init__
(self, path_img, path_gt, loadSize, mode=1)
data/docdata.py:25
Method__init__
(self, config_path)
src/config.py:6
Method__init__
(self)
src/sobel.py:27
Method__init__
(self, config)
src/trainer.py:35
Method__init__
(self, schedule, timesteps)
schedule/schedule.py:6
Method__init__
Create a wrapper class for the forward SDE (VP type). *** Update: We support discrete-time diffusion models by implementing a picewis
schedule/dpm_solver_pytorch.py:7
Method__init__
Construct a DPM-Solver. We support both DPM-Solver (`algorithm_type="dpmsolver"`) and DPM-Solver++ (`algorithm_type="dpmsolver++"`).
schedule/dpm_solver_pytorch.py:346
Method__init__
(self, model, T, schedule)
schedule/diffusionSample.py:25
Method__len__
(self)
data/docdata.py:37
Methodadd_noise
Compute the noised input xt = alpha_t * x + sigma_t * noise. Args: x: A `torch.Tensor` with shape `(batch_size, *shape)
schedule/dpm_solver_pytorch.py:1020
Methodcrop_concat
(img, size=128)
src/trainer.py:109
Methodcrop_concat_back
(img, prediction, size=128)
src/trainer.py:122
Methoddynamic_thresholding_fn
The dynamic thresholding method.
schedule/dpm_solver_pytorch.py:424
Methodforward
(self, x)
model/DocDiff.py:15
Methodforward
(self, t: torch.Tensor)
model/DocDiff.py:37
Methodforward
* `x` has shape `[batch_size, in_channels, height, width]` * `t` has shape `[batch_size, time_channels]`
model/DocDiff.py:102
Methodforward
(self, x: torch.Tensor, t: torch.Tensor)
model/DocDiff.py:129
Methodforward
(self, x: torch.Tensor, t: torch.Tensor)
model/DocDiff.py:146
Methodforward
(self, x: torch.Tensor, t: torch.Tensor)
model/DocDiff.py:167
Methodforward
(self, x: torch.Tensor, t: torch.Tensor)
model/DocDiff.py:186
Methodforward
(self, x: torch.Tensor, t: torch.Tensor)
model/DocDiff.py:202
Methodforward
* `x` has shape `[batch_size, in_channels, height, width]` * `t` has shape `[batch_size]`
model/DocDiff.py:283
Methodforward
(self, x, condition, t, diffusion)
model/DocDiff.py:332
Methodforward
(self, img)
src/sobel.py:16
Methodforward
(self, img)
src/sobel.py:35
Methodforward
Algorithm 2.
schedule/diffusionSample.py:70
Methodinverse
Inverse the sample `x` from time `t_start` to `t_end` by DPM-Solver. For discrete-time DPMs, we use `t_start=1/N`, where `N` is the t
schedule/dpm_solver_pytorch.py:1040
Functionmark_im
在im图片上添加水印 im为打开的原图
utils/marker.py:125
Methodmin_max
(array)
src/trainer.py:136
Methodprint
(self)
src/config.py:17
Methodquadratic_beta_schedule
(self)
schedule/schedule.py:26
next →1–100 of 101, ranked by callers