MCPcopy Create free account

hub / github.com/Vchitect/SEINE / functions

Functions203 in github.com/Vchitect/SEINE

↓ 23 callersFunction_extract_into_tensor
Extract values from a 1-D numpy array for a batch of indices. :param arr: the 1-D numpy array. :param timesteps: a tensor of indices i
diffusion/gaussian_diffusion.py:919
↓ 21 callersMethodreshape_heads_to_batch_dim
(self, tensor)
models/attention.py:121
↓ 7 callersFunction_is_tensor_video_clip
(clip)
datasets/video_transforms.py:7
↓ 7 callersFunctionmean_flat
Take the mean over all non-batch dimensions.
diffusion/gaussian_diffusion.py:16
↓ 5 callersFunctioncrop
Args: clip (torch.tensor): Video clip to be cropped. Size is (T, C, H, W)
datasets/video_transforms.py:38
↓ 4 callersMethod__init__
( self, in_channels: int, prev_output_channel: int, out_channels: int,
models/unet_blocks.py:578
↓ 4 callersMethod__init__
( self, query_dim: int, cross_attention_dim: Optional[int] = None, heads: int
models/attention.py:58
↓ 4 callersMethod_memory_efficient_attention_xformers
(self, query, key, value, attention_mask)
models/attention.py:304
↓ 4 callersMethod_sliced_attention
(self, query, key, value, sequence_length, dim, attention_mask)
models/attention.py:261
↓ 4 callersMethod_wrap_model
(self, model)
diffusion/respace.py:106
↓ 4 callersMethodp_mean_variance
Apply the model to get p(x_{t-1} | x_t), as well as a prediction of the initial x, x_0. :param model: the model, which tak
diffusion/gaussian_diffusion.py:257
↓ 4 callersMethodq_posterior_mean_variance
Compute the mean and variance of the diffusion posterior: q(x_{t-1} | x_t, x_0)
diffusion/gaussian_diffusion.py:235
↓ 3 callersMethod_attention
(self, query, key, value, attention_mask=None)
models/attention.py:218
↓ 3 callersMethod_predict_eps_from_xstart
(self, x_t, t, pred_xstart)
diffusion/gaussian_diffusion.py:353
↓ 3 callersMethod_vb_terms_bpd
Get a term for the variational lower-bound. The resulting units are bits (rather than nats, as one might expect). This all
diffusion/gaussian_diffusion.py:730
↓ 3 callersMethodreshape_batch_dim_to_heads
(self, tensor)
models/attention.py:128
↓ 3 callersFunctionresize
(clip, target_size, interpolation_mode)
datasets/video_transforms.py:48
↓ 2 callersMethod__init__
(self, path, dropout_prob=0.1)
models/clip.py:65
↓ 2 callersMethod__init__
(self, channels, use_conv=False, use_conv_transpose=False, out_channels=None, name="conv")
models/resnet.py:25
↓ 2 callersMethod_predict_xstart_from_eps
(self, x_t, t, eps)
diffusion/gaussian_diffusion.py:346
↓ 2 callersFunction_warmup_beta
(beta_start, beta_end, num_diffusion_timesteps, warmup_frac)
diffusion/gaussian_diffusion.py:58
↓ 2 callersFunctionapprox_standard_normal_cdf
A fast approximation of the cumulative distribution function of the standard normal.
diffusion/diffusion_utils.py:39
↓ 2 callersMethodcondition_score
Compute what the p_mean_variance output would have been, should the model's score function be conditioned by cond_fn. See
diffusion/gaussian_diffusion.py:370
↓ 2 callersMethodforward_video
(self, hidden_states, encoder_hidden_states=None, attention_mask=None, video_length=None)
models/attention.py:651
↓ 2 callersFunctionnormal_kl
Compute the KL divergence between two gaussians. Shapes are automatically broadcasted, so batches can be compared to scalars, among ot
diffusion/diffusion_utils.py:10
↓ 2 callersMethodq_sample
Diffuse the data for a given number of diffusion steps. In other words, sample from q(x_t | x_0). :param x_start: the init
diffusion/gaussian_diffusion.py:218
↓ 1 callersMethod__init__
(self, model, timestep_map, original_num_steps)
diffusion/respace.py:119
↓ 1 callersMethod__init__
( self, heads=8, num_buckets=32, max_distance=128, )
models/unet.py:54
↓ 1 callersMethod_attention
(self, query, key, value, attention_mask=None, time_rel_pos_bias=None)
models/attention.py:870
↓ 1 callersMethod_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
diffusion/gaussian_diffusion.py:847
↓ 1 callersMethod_relative_position_bucket
(relative_position, num_buckets=32, max_distance=128)
models/unet.py:66
↓ 1 callersMethod_relative_position_bucket
(relative_position, num_buckets=32, max_distance=128)
models/attention.py:943
↓ 1 callersMethod_warmed_up
(self)
diffusion/timestep_sampler.py:149
↓ 1 callersFunctionauto_inpainting
(args, video_input, masked_video, mask, prompt, vae, text_encoder, diffusion, model, device,)
sample_scripts/with_mask_sample.py:114
↓ 1 callersFunctionbetas_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 =
diffusion/gaussian_diffusion.py:128
↓ 1 callersFunctioncenter_crop
(clip, crop_size)
datasets/video_transforms.py:94
↓ 1 callersFunctioncenter_crop_using_short_edge
(clip)
datasets/video_transforms.py:109
↓ 1 callersMethodcondition_mean
Compute the mean for the previous step, given a function cond_fn that computes the gradient of a conditional log probability with r
diffusion/gaussian_diffusion.py:358
↓ 1 callersFunctioncreate_diffusion
( timestep_respacing, noise_schedule="linear", use_kl=False, sigma_small=False, pred
diffusion/__init__.py:10
↓ 1 callersFunctioncustomized_lr_scheduler
(optimizer, warmup_steps=5000)
models/__init__.py:8
↓ 1 callersMethodddim_sample
Sample x_{t-1} from the model using DDIM. Same usage as p_sample().
diffusion/gaussian_diffusion.py:543
↓ 1 callersMethodddim_sample_loop
Generate samples from the model using DDIM. Same usage as p_sample_loop().
diffusion/gaussian_diffusion.py:636
↓ 1 callersMethodddim_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_p
diffusion/gaussian_diffusion.py:675
↓ 1 callersFunctiondiscretized_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 t
diffusion/diffusion_utils.py:62
↓ 1 callersMethodencode
(self, *args, **kwargs)
models/clip.py:28
↓ 1 callersFunctionexists
(x)
models/attention.py:39
↓ 1 callersMethodforward
r""" Args: sample (`torch.FloatTensor`): (batch, channel, height, width) noisy inputs tensor timestep (`torch.FloatTen
models/unet.py:366
↓ 1 callersMethodforward
(self, x)
models/utils.py:133
↓ 1 callersMethodforward
(self, hidden_states)
models/resnet.py:211
↓ 1 callersMethodforward_image
(self, hidden_states, encoder_hidden_states=None, attention_mask=None, use_image_num=None)
models/attention.py:708
↓ 1 callersMethodfreeze
(self)
models/clip.py:43
↓ 1 callersMethodfrom_pretrained_2d
(cls, pretrained_model_path, subfolder=None, use_concat=False)
models/unet.py:540
↓ 1 callersFunctionget_beta_schedule
This is the deprecated API for creating beta schedules. See get_named_beta_schedule() for the new library of schedules.
diffusion/gaussian_diffusion.py:65
↓ 1 callersFunctionget_down_block
( down_block_type, num_layers, in_channels, out_channels, temb_channels, add_downsampl
models/unet_blocks.py:17
↓ 1 callersFunctionget_input
(args)
sample_scripts/with_mask_sample.py:47
↓ 1 callersFunctionget_models
(args)
models/__init__.py:27
↓ 1 callersMethodget_params
(self, clip)
datasets/video_transforms.py:212
↓ 1 callersFunctionget_up_block
( up_block_type, num_layers, in_channels, out_channels, prev_output_channel, temb_chan
models/unet_blocks.py:82
↓ 1 callersFunctionmain
(args)
sample_scripts/with_mask_sample.py:171
↓ 1 callersFunctionmask_generation_before
(mask_type, shape, dtype, device, dropout_prob=0.0, use_image_num=0)
utils.py:356
↓ 1 callersFunctionnormalize
Args: clip (torch.tensor): Video clip to be normalized. Size is (T, C, H, W) mean (tuple): pixel RGB mean. Size is (3)
datasets/video_transforms.py:162
↓ 1 callersMethodp_sample
Sample x_{t-1} from the model at the given timestep. :param model: the model to sample from. :param x: the current tensor
diffusion/gaussian_diffusion.py:388
↓ 1 callersMethodp_sample_loop
Generate samples from the model. :param model: the model module. :param shape: the shape of the samples, (N, C, H, W).
diffusion/gaussian_diffusion.py:437
↓ 1 callersMethodp_sample_loop_progressive
Generate samples from the model and yield intermediate samples from each timestep of diffusion. Arguments are the same as
diffusion/gaussian_diffusion.py:488
↓ 1 callersMethodq_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 d
diffusion/gaussian_diffusion.py:206
↓ 1 callersMethodsample
Importance-sample timesteps for a batch. :param batch_size: the number of timesteps. :param device: the torch device to sa
diffusion/timestep_sampler.py:44
↓ 1 callersMethodset_attention_slice
r""" Enable sliced attention computation. When this option is enabled, the attention module will split the input tensor in slices, to
models/unet.py:297
↓ 1 callersFunctionspace_timesteps
Create a list of timesteps to use from an original diffusion process, given the number of timesteps we want to take from equally-sized port
diffusion/respace.py:12
↓ 1 callersFunctionto_tensor
Convert tensor data type from uint8 to float, divide value by 255.0 and permute the dimensions of clip tensor Args: clip (tor
datasets/video_transforms.py:146
↓ 1 callersMethodtoken_drop
Drops text to enable classifier-free guidance.
models/clip.py:70
↓ 1 callersMethodupdate_with_all_losses
Update the reweighting using losses from a model. Sub-classes should override this method to update the reweighting using
diffusion/timestep_sampler.py:106
↓ 1 callersMethodweights
Get a numpy array of weights, one per diffusion step. The weights needn't be normalized, but must be positive.
diffusion/timestep_sampler.py:38
Method__call__
(self, x, ts, **kwargs)
diffusion/respace.py:125
Method__call__
Args: clip (torch.tensor): Video clip to be cropped. Size is (T, C, H, W) Returns: torch.tensor: randomly
datasets/video_transforms.py:201
Method__call__
Args: clip (torch.tensor): Video clip to be cropped. Size is (T, C, H, W) Returns: torch.tensor: scale re
datasets/video_transforms.py:250
Method__call__
Args: clip (torch.tensor): Video clip to be cropped. Size is (T, C, H, W) Returns: torch.tensor: center c
datasets/video_transforms.py:284
Method__call__
Args: clip (torch.tensor): video clip must be normalized. Size is (C, T, H, W)
datasets/video_transforms.py:313
Method__call__
Args: clip (torch.tensor, dtype=torch.uint8): Size is (T, C, H, W) Return: clip (torch.tensor, dtype=torc
datasets/video_transforms.py:333
Method__call__
Args: clip (torch.tensor): Video clip to be cropped. Size is (T, C, H, W) Returns: torch.tensor: scale re
datasets/video_transforms.py:366
Method__init__
(self, diffusion)
diffusion/timestep_sampler.py:63
Method__init__
(self, diffusion, history_per_term=10, uniform_prob=0.001)
diffusion/timestep_sampler.py:121
Method__init__
( self, *, betas, model_mean_type, model_var_type, loss_
diffusion/gaussian_diffusion.py:156
Method__init__
(self, use_timesteps, **kwargs)
diffusion/respace.py:73
Method__init__
(self, size)
datasets/video_transforms.py:195
Method__init__
( self, size, interpolation_mode="bilinear", )
datasets/video_transforms.py:235
Method__init__
( self, size, interpolation_mode="bilinear", )
datasets/video_transforms.py:269
Method__init__
(self, mean, std, inplace=False)
datasets/video_transforms.py:308
Method__init__
(self)
datasets/video_transforms.py:330
Method__init__
( self, size, interpolation_mode="bilinear", )
datasets/video_transforms.py:351
Method__init__
( self, sample_size: Optional[int] = None, # 64 in_channels: int = 4, out_chan
models/unet.py:102
Method__init__
(self)
models/clip.py:25
Method__init__
(self, path, device="cuda", max_length=77)
models/clip.py:35
Method__init__
( self, in_channels: int, temb_channels: int, dropout: float = 0.0, nu
models/unet_blocks.py:146
Method__init__
( self, in_channels: int, out_channels: int, temb_channels: int, dropo
models/unet_blocks.py:236
Method__init__
( self, in_channels: int, out_channels: int, temb_channels: int, dropo
models/unet_blocks.py:366
Method__init__
( self, in_channels: int, out_channels: int, prev_output_channel: int,
models/unet_blocks.py:445
Method__init__
( self, num_attention_heads: int = 16, attention_head_dim: int = 88, in_channe
models/attention.py:316
Method__init__
( self, dim: int, num_attention_heads: int, attention_head_dim: int, d
models/attention.py:440
Method__init__
(self, query_dim: int, cross_attention_dim: Optional[int] = None,
models/attention.py:798
Method__init__
( self, heads=8, num_buckets=32, max_distance=128, )
models/attention.py:931
next →1–100 of 203, ranked by callers