Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/CompVis/diff2flow
/ functions
Functions
426 in github.com/CompVis/diff2flow
⨍
Functions
426
◇
Types & classes
79
↓ 1 callers
Method
_vb_terms_bpd
Get a term for the variational lower-bound. The resulting units are bits (rather than nats, as one might expect). This allow
diff2flow/ddpm.py:412
↓ 1 callers
Method
_warmed_up
(self)
diff2flow/openai_diffusion/timestep_sampler.py:149
↓ 1 callers
Function
abs_rel_error
(pred, target, valid_mask=None)
diff2flow/dataset/depth_utils.py:84
↓ 1 callers
Method
add_lora_to_unet
(self)
diff2flow/trainer_module.py:197
↓ 1 callers
Method
aggregate
(self)
diff2flow/metrics.py:54
↓ 1 callers
Method
alpha_dt_t
(self, t)
diff2flow/flow.py:64
↓ 1 callers
Method
alpha_dt_t
(self, t)
diff2flow/flow.py:168
↓ 1 callers
Method
alpha_t
(self, t)
diff2flow/flow.py:61
↓ 1 callers
Method
alpha_t
(self, t)
diff2flow/flow.py:165
↓ 1 callers
Method
apply_cond_dropout
(self, x)
diff2flow/trainer_module.py:440
↓ 1 callers
Function
apply_scale_and_shift
Returns a scale-and-shift version of pred according to gt Args: pred: predicted image (b, c, h, w) gt : ground truth image
diff2flow/dataset/depth_utils.py:66
↓ 1 callers
Function
avg_pool_nd
Create a 1D, 2D, or 3D average pooling module.
diff2flow/models/unet/util.py:135
↓ 1 callers
Method
backward
(ctx, *output_grads)
diff2flow/models/unet/util.py:48
↓ 1 callers
Function
betas_for_alpha_bar
Create a beta schedule that discretizes the given alpha_t_bar function, which defines the cumulative product of (1-beta) over time from t = [
diff2flow/ddpm.py:42
↓ 1 callers
Function
betas_for_alpha_bar
Create a beta schedule that discretizes the given alpha_t_bar function, which defines the cumulative product of (1-beta) over time from t = [
diff2flow/openai_diffusion/gaussian_diffusion.py:125
↓ 1 callers
Function
calculate_PSNR
(img1, img2)
diff2flow/metrics.py:12
↓ 1 callers
Function
calculate_valid_mask
(depth, dataset_name)
diff2flow/dataset/depth_preprocessing.py:42
↓ 1 callers
Function
check_config
(cfg)
train.py:30
↓ 1 callers
Method
check_interval
(self, diffusion_form="sigma", reverse=False, last_step_size=0.04)
diff2flow/flow.py:241
↓ 1 callers
Function
checkpoint
Evaluate a function without caching intermediate activations, allowing for reduced memory at the expense of extra compute in the backward pas
diff2flow/models/unet/attention.py:341
↓ 1 callers
Method
compute_d_alpha_alpha_ratio_t
Compute the ratio between d_alpha and alpha
diff2flow/flow.py:82
↓ 1 callers
Method
compute_diffusion
Compute the diffusion term of the SDE Args: x: [batch_dim, ...], data point t: [batch_dim,], time vector form: s
diff2flow/flow.py:96
↓ 1 callers
Method
condition_mean
Compute the mean for the previous step, given a function cond_fn that computes the gradient of a conditional log probability with res
diff2flow/openai_diffusion/gaussian_diffusion.py:346
↓ 1 callers
Method
convert_fm_xt_to_dm_xt
Convert fm trajectory to dm trajectory using the fm t We use linear scaling here
diff2flow/flow_obj.py:120
↓ 1 callers
Function
cosine_log_snr
Returns log Signal-to-Noise ratio for time step t and image size 64 eps: avoid division by zero
diff2flow/diffusion.py:16
↓ 1 callers
Function
count_params
(model)
diff2flow/helpers.py:114
↓ 1 callers
Method
ddim_sample
Sample x_{t-1} from the model using DDIM. Same usage as p_sample().
diff2flow/openai_diffusion/gaussian_diffusion.py:513
↓ 1 callers
Method
ddim_sample_loop_progressive
Use DDIM to sample from the model and yield intermediate samples from each timestep of DDIM. Same usage as p_sample_loop_prog
diff2flow/openai_diffusion/gaussian_diffusion.py:633
↓ 1 callers
Method
decode
Args: z: torch.Tensor, shape (b, latent_channels, h, w)
diff2flow/tiny_autoencoder.py:76
↓ 1 callers
Method
decode
Args: z: latent code tensor (B, C, H, W)
diff2flow/kl_autoencoder.py:511
↓ 1 callers
Function
delta1_accuracy
(pred, target)
diff2flow/dataset/depth_utils.py:95
↓ 1 callers
Function
discretized_gaussian_log_likelihood
Compute the log-likelihood of a Gaussian distribution discretizing to a given image. :param x: the target images. It is assumed that thi
diff2flow/ddpm.py:533
↓ 1 callers
Function
discretized_gaussian_log_likelihood
Compute the log-likelihood of a Gaussian distribution discretizing to a given image. :param x: the target images. It is assumed that this
diff2flow/openai_diffusion/diffusion_utils.py:62
↓ 1 callers
Function
distance_to_planar_depth
Convert distance to focal point to planar depth. Adapted from https://github.com/apple/ml-hypersim/issues/9#issuecomment-754935697 Args:
diff2flow/dataset/depth_preprocessing.py:9
↓ 1 callers
Method
encode
(self, *args, **kwargs)
diff2flow/ema.py:235
↓ 1 callers
Method
encode
Args: x: torch.Tensor, shape (b, 3, h, w) in [-1, 1]
diff2flow/tiny_autoencoder.py:66
↓ 1 callers
Method
encode
Args: x: input tensor (B, C, H, W) in range [-1, 1] scaled with self.scale and shifted with self.shift
diff2flow/kl_autoencoder.py:495
↓ 1 callers
Method
encode
(self, text)
diff2flow/conditioning/encoders.py:210
↓ 1 callers
Method
encode
(self, text)
diff2flow/conditioning/encoders.py:251
↓ 1 callers
Method
encode_with_transformer
(self, text)
diff2flow/conditioning/encoders.py:191
↓ 1 callers
Method
encode_with_vision_transformer
(self, img)
diff2flow/conditioning/encoders.py:139
↓ 1 callers
Function
enforce_zero_terminal_snr
Fix for linear beta schedules to ensure that the SNR at the end of the diffusion chain is 0 (zero terminal SNR), according to the paper
diff2flow/ddpm.py:61
↓ 1 callers
Function
enforce_zero_terminal_snr
(betas)
diff2flow/utils/diffusion_utils.py:29
↓ 1 callers
Method
evaluate_and_visualize_batch
(self, batch, prefix="train")
diff2flow/trainer_module.py:681
↓ 1 callers
Function
exists
(val)
diff2flow/ema.py:14
↓ 1 callers
Method
forward
(self, x1: Tensor, x0: Tensor, **kwargs)
diff2flow/trainer_module.py:194
↓ 1 callers
Method
freeze
(self)
diff2flow/conditioning/encoders.py:128
↓ 1 callers
Method
freeze
(self)
diff2flow/conditioning/encoders.py:180
↓ 1 callers
Method
freeze
(self)
diff2flow/conditioning/encoders.py:236
↓ 1 callers
Method
get_batch
(self, x=None)
diff2flow/lora.py:36
↓ 1 callers
Function
get_batch_scale_and_shift
Returns the scale and shift between two images More precisely, we find (b1, b2) such that img1 = b1 + b2*img2 We mod
diff2flow/dataset/depth_utils.py:46
↓ 1 callers
Function
get_beta_schedule
This is the deprecated API for creating beta schedules. See get_named_beta_schedule() for the new library of schedules.
diff2flow/openai_diffusion/gaussian_diffusion.py:65
↓ 1 callers
Method
get_current_decay
(self)
diff2flow/ema.py:171
↓ 1 callers
Function
get_grad_norm
(model)
diff2flow/trainer_module.py:726
↓ 1 callers
Function
get_iter_exponential_schedule
(optimizer: Optimizer, num_warmup_steps: int, num_training_steps: int, final_ratio: float)
diff2flow/lr_schedulers.py:111
↓ 1 callers
Function
get_lr
(optimizer)
diff2flow/lr_schedulers.py:121
↓ 1 callers
Function
get_scale_and_shift
Returns the scale and shift between two images More precisely, we find (b1, b2) such that img1 = b1 + b2*img2 We mod
diff2flow/dataset/depth_utils.py:12
↓ 1 callers
Method
get_score_from_velocity
Wrapper function: transfrom velocity prediction model to score Args: velocity: [batch_dim, ...] shaped tensor; velocity model outp
diff2flow/flow.py:119
↓ 1 callers
Method
get_v
v-parameterization: sqrt(alpha_bar_t) * eps - sqrt(1 - alpha_bar_t) * x_0
diff2flow/ddpm.py:211
↓ 1 callers
Method
get_vector_field_from_eps
eps is the SD eps-parameterized vector field with the FM vector field is defined as z - eps First of all convert the x_t fro
diff2flow/flow_obj.py:169
↓ 1 callers
Method
get_vector_field_from_v
v is the SD v-parameterized vector field with v = sqrt(alpha_cumprod) * eps - sqrt(1 - alpha_cumprod) * z the FM vector field is defi
diff2flow/flow_obj.py:156
↓ 1 callers
Method
guess_latent_channels
guess latent channel count based on encoder filename
diff2flow/tiny_autoencoder.py:84
↓ 1 callers
Function
ims_to_grid
Args: ims: Tensor of shape (b, c, h, w) stack: "row" or "col" split: If 'row' stack by rows, if 'col' stack by columns.
diff2flow/visualizer.py:7
↓ 1 callers
Method
init_uncond
(self, path="nulltext.npy")
diff2flow/conditioning/encoders.py:33
↓ 1 callers
Function
interpolate_nans
Interpolate nans in a depth image by using the closest non-nan value.
diff2flow/dataset/depth_preprocessing.py:29
↓ 1 callers
Method
last_step
Get the last step function of the SDE solver
diff2flow/flow.py:273
↓ 1 callers
Method
load_from_ckpt
(self, ckpt_path)
diff2flow/models/unet/openaimodel.py:772
↓ 1 callers
Function
load_lora_weights
(model, ckpt_path, strict=False, verbose=False)
diff2flow/helpers.py:87
↓ 1 callers
Function
load_model_weights
(model, ckpt_path, strict=True, verbose=True)
diff2flow/helpers.py:65
↓ 1 callers
Function
main
(cfg: DictConfig)
train.py:42
↓ 1 callers
Function
make_beta_schedule
(schedule, n_timestep, linear_start=1e-4, linear_end=2e-2, cosine_s=8e-3)
diff2flow/ddpm.py:13
↓ 1 callers
Function
make_beta_schedule
(schedule, n_timestep, linear_start=1e-4, linear_end=2e-2, cosine_s=8e-3)
diff2flow/utils/diffusion_utils.py:5
↓ 1 callers
Function
make_ddim_sampling_parameters
(alphacums, ddim_timesteps, eta, verbose=True)
diff2flow/ddim.py:37
↓ 1 callers
Function
make_ddim_timesteps
(ddim_discr_method, num_ddim_timesteps, num_ddpm_timesteps, verbose=True)
diff2flow/ddim.py:18
↓ 1 callers
Method
model
(self)
diff2flow/ema.py:131
↓ 1 callers
Method
p_sample
Sample x_{t-1} from the model at the given timestep.
diff2flow/ddpm.py:336
↓ 1 callers
Method
p_sample
Sample x_{t-1} from the model at the given timestep. :param model: the model to sample from. :param x: the current tensor at
diff2flow/openai_diffusion/gaussian_diffusion.py:376
↓ 1 callers
Method
p_sample_loop
Generate samples from the model.
diff2flow/ddpm.py:350
↓ 1 callers
Method
p_sample_loop_progressive
Generate samples from the model and yield intermediate samples from each timestep of diffusion. Arguments are the same as p_s
diff2flow/openai_diffusion/gaussian_diffusion.py:464
↓ 1 callers
Function
per_sample_min_max_normalization
Normalize each sample in a batch independently with min-max normalization to [0, 1]
diff2flow/dataset/depth_utils.py:122
↓ 1 callers
Method
predict_eps_from_xstart
(self, x_t, t, pred_xstart)
diff2flow/ddpm.py:287
↓ 1 callers
Method
predict_start_from_eps
(self, x_t, t, noise)
diff2flow/flow_obj.py:150
↓ 1 callers
Method
predict_start_from_noise
(self, x_t, t, noise)
diff2flow/ddpm.py:269
↓ 1 callers
Method
predict_start_from_z_and_v
(self, x_t, t, v)
diff2flow/ddpm.py:275
↓ 1 callers
Method
preprocess
(self, x)
diff2flow/conditioning/encoders.py:42
↓ 1 callers
Method
preprocess
(self, x)
diff2flow/conditioning/encoders.py:120
↓ 1 callers
Function
preprocess_depth
Args: depth: depth map in numpy format and range [0, inf] w. shape (H, W) dataset_name: name of the dataset (e.g. vkitti2, hypers
diff2flow/dataset/depth_preprocessing.py:76
↓ 1 callers
Method
preprocess_sample
get dataset name
diff2flow/dataset/depth_preprocessing.py:133
↓ 1 callers
Method
prior_bpd
Get the prior KL term for the variational lower-bound, measured in bits-per-dim. This term can't be optimized, as it only depends on
diff2flow/ddpm.py:397
↓ 1 callers
Method
q_mean_variance
Get the distribution q(x_t | x_0).
diff2flow/ddpm.py:190
↓ 1 callers
Method
q_mean_variance
Get the distribution q(x_t | x_0). :param x_start: the [N x C x ...] tensor of noiseless inputs. :param t: the number of diff
diff2flow/openai_diffusion/gaussian_diffusion.py:203
↓ 1 callers
Method
q_sample
Diffuse the data for a given number of diffusion steps. In other words sample from q(x_t | x_0). Args: x_start:
diff2flow/diffusion.py:48
↓ 1 callers
Method
register_schedule
(self, beta_schedule="linear", timesteps=1000, linear_start=1e-4, linear_end=2e-2, c
diff2flow/ddpm.py:129
↓ 1 callers
Method
register_sdv2_schedule
(self, diffusion_schedule, enforce_zero_snr=True)
diff2flow/flow_obj.py:40
↓ 1 callers
Method
reset
(self)
diff2flow/lora.py:50
↓ 1 callers
Function
resize
(sample, size)
diff2flow/dataset/depth_preprocessing.py:62
↓ 1 callers
Function
resize_ims
(x: Tensor, size: int, mode: str = "bilinear", **kwargs)
diff2flow/helpers.py:158
↓ 1 callers
Method
score
(self, x, t, model, **model_kwargs)
diff2flow/flow.py:236
↓ 1 callers
Function
seed_everything
(seed)
diff2flow/helpers.py:135
↓ 1 callers
Function
shifted_cosine_alpha_bar
(t, im_size: int, ref_size: int = 64)
diff2flow/diffusion.py:32
← previous
next →
101–200 of 426, ranked by callers