Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Royalvice/DocDiff
/ functions
Functions
101 in github.com/Royalvice/DocDiff
⨍
Functions
101
◇
Types & classes
20
↓ 19 callers
Method
marginal_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 callers
Method
marginal_std
Compute sigma_t of a given continuous-time label t in [0, T].
schedule/dpm_solver_pytorch.py:145
↓ 16 callers
Method
marginal_log_mean_coeff
Compute log(alpha_t) of a given continuous-time label t in [0, T].
schedule/dpm_solver_pytorch.py:126
↓ 15 callers
Method
model_fn
Convert the model to the noise prediction model or the data prediction model.
schedule/dpm_solver_pytorch.py:452
↓ 9 callers
Method
__init__
(self, beta)
model/DocDiff.py:341
↓ 6 callers
Function
extract_
(a, t, x_shape)
schedule/diffusionSample.py:8
↓ 5 callers
Method
get_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 callers
Method
inverse_lambda
Compute the continuous-time label t in [0, T] of a given half-logSNR lambda_t.
schedule/dpm_solver_pytorch.py:159
↓ 4 callers
Method
get_betas
(self)
schedule/schedule.py:41
↓ 4 callers
Function
get_pad
(in_, ksize, stride, atrous=1)
model/DocDiff.py:356
↓ 4 callers
Method
marginal_alpha
Compute alpha_t of a given continuous-time label t in [0, T].
schedule/dpm_solver_pytorch.py:139
↓ 4 callers
Function
noise_pred_fn
(x, t_continuous, cond=None)
schedule/dpm_solver_pytorch.py:290
↓ 3 callers
Function
ImageTransform
(loadSize)
data/docdata.py:8
↓ 3 callers
Method
dpm_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 callers
Function
expand_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 callers
Function
extract
Extract some coefficients at specified timesteps, then reshape to [batch_size, 1, 1, 1, 1, ...] for broadcasting purposes.
schedule/diffusionSample.py:14
↓ 3 callers
Method
singlestep_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 callers
Function
add_mark
添加水印,然后保存图片
utils/marker.py:48
↓ 2 callers
Method
data_prediction_fn
Return the data prediction model (with corrector).
schedule/dpm_solver_pytorch.py:441
↓ 2 callers
Function
gen_mark
生成mark图片,返回添加水印的函数
utils/marker.py:95
↓ 2 callers
Function
get_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 callers
Function
interpolate_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 callers
Function
load_config
(path)
src/config.py:26
↓ 2 callers
Method
multistep_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 callers
Method
noise_prediction_fn
Return the noise prediction model.
schedule/dpm_solver_pytorch.py:435
↓ 2 callers
Method
sample
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 callers
Method
singlestep_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 callers
Function
GBK2312
()
utils/marker.py:19
↓ 1 callers
Method
__init__
(self)
src/sobel.py:6
↓ 1 callers
Function
cond_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 callers
Method
cosine_beta_schedule
(self, s=0.001)
schedule/schedule.py:10
↓ 1 callers
Function
crop_image
裁剪图片边缘空白
utils/marker.py:84
↓ 1 callers
Method
denoise_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 callers
Function
dpm_solver
(betas, model, x_T, steps, model_kwargs)
src/trainer.py:244
↓ 1 callers
Method
dpm_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 callers
Method
get_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 callers
Function
init__result_Dir
()
src/trainer.py:16
↓ 1 callers
Method
linear_beta_schedule
(self)
schedule/schedule.py:19
↓ 1 callers
Function
main
()
main.py:6
↓ 1 callers
Function
main
()
utils/marker.py:168
↓ 1 callers
Function
model_fn
The noise predicition model function that is used for DPM-Solver.
schedule/dpm_solver_pytorch.py:317
↓ 1 callers
Function
model_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 callers
Method
multistep_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 callers
Method
multistep_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 callers
Method
noisy_image
Compute y_noisy according to (6) p15 of [2]
schedule/diffusionSample.py:64
↓ 1 callers
Method
p_mean_variance
(self, x_t, cond_, t)
schedule/diffusionSample.py:53
↓ 1 callers
Method
predict_xt_prev_mean_from_eps
(self, x_t, t, eps)
schedule/diffusionSample.py:49
↓ 1 callers
Function
randomABC
()
utils/marker.py:26
↓ 1 callers
Function
randomcolor
()
utils/marker.py:40
↓ 1 callers
Function
randomtext
()
utils/marker.py:18
↓ 1 callers
Function
set_opacity
设置水印透明度
utils/marker.py:72
↓ 1 callers
Method
singlestep_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 callers
Function
test
(config)
src/train.py:10
↓ 1 callers
Method
test
(self)
src/trainer.py:108
↓ 1 callers
Function
train
(config)
src/train.py:4
↓ 1 callers
Method
train
(self)
src/trainer.py:171
↓ 1 callers
Method
update_average
(self, old, new)
model/DocDiff.py:350
↓ 1 callers
Method
update_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
Method
add_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
Method
crop_concat
(img, size=128)
src/trainer.py:109
Method
crop_concat_back
(img, prediction, size=128)
src/trainer.py:122
Method
dynamic_thresholding_fn
The dynamic thresholding method.
schedule/dpm_solver_pytorch.py:424
Method
forward
(self, x)
model/DocDiff.py:15
Method
forward
(self, t: torch.Tensor)
model/DocDiff.py:37
Method
forward
* `x` has shape `[batch_size, in_channels, height, width]` * `t` has shape `[batch_size, time_channels]`
model/DocDiff.py:102
Method
forward
(self, x: torch.Tensor, t: torch.Tensor)
model/DocDiff.py:129
Method
forward
(self, x: torch.Tensor, t: torch.Tensor)
model/DocDiff.py:146
Method
forward
(self, x: torch.Tensor, t: torch.Tensor)
model/DocDiff.py:167
Method
forward
(self, x: torch.Tensor, t: torch.Tensor)
model/DocDiff.py:186
Method
forward
(self, x: torch.Tensor, t: torch.Tensor)
model/DocDiff.py:202
Method
forward
* `x` has shape `[batch_size, in_channels, height, width]` * `t` has shape `[batch_size]`
model/DocDiff.py:283
Method
forward
(self, x, condition, t, diffusion)
model/DocDiff.py:332
Method
forward
(self, img)
src/sobel.py:16
Method
forward
(self, img)
src/sobel.py:35
Method
forward
Algorithm 2.
schedule/diffusionSample.py:70
Method
inverse
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
Function
mark_im
在im图片上添加水印 im为打开的原图
utils/marker.py:125
Method
min_max
(array)
src/trainer.py:136
Method
print
(self)
src/config.py:17
Method
quadratic_beta_schedule
(self)
schedule/schedule.py:26
next →
1–100 of 101, ranked by callers