SYMBOL INDEX (497 symbols across 31 files) FILE: i2v/gradio_app.py function videocrafter_demo (line 17) | def videocrafter_demo(result_dir='./tmp/'): FILE: i2v/lvdm/basics.py function disabled_train (line 14) | def disabled_train(self, mode=True): function zero_module (line 19) | def zero_module(module): function scale_module (line 27) | def scale_module(module, scale): function conv_nd (line 36) | def conv_nd(dims, *args, **kwargs): function linear (line 49) | def linear(*args, **kwargs): function avg_pool_nd (line 56) | def avg_pool_nd(dims, *args, **kwargs): function nonlinearity (line 69) | def nonlinearity(type='silu'): class GroupNormSpecific (line 76) | class GroupNormSpecific(nn.GroupNorm): method forward (line 77) | def forward(self, x): function normalization (line 81) | def normalization(channels, num_groups=32): class HybridConditioner (line 90) | class HybridConditioner(nn.Module): method __init__ (line 92) | def __init__(self, c_concat_config, c_crossattn_config): method forward (line 97) | def forward(self, c_concat, c_crossattn): FILE: i2v/lvdm/common.py function gather_data (line 8) | def gather_data(data, return_np=True): function autocast (line 16) | def autocast(f): function extract_into_tensor (line 25) | def extract_into_tensor(a, t, x_shape): function noise_like (line 31) | def noise_like(shape, device, repeat=False): function default (line 37) | def default(val, d): function exists (line 42) | def exists(val): function identity (line 45) | def identity(*args, **kwargs): function uniq (line 48) | def uniq(arr): function mean_flat (line 51) | def mean_flat(tensor): function ismap (line 57) | def ismap(x): function isimage (line 62) | def isimage(x): function max_neg_value (line 67) | def max_neg_value(t): function shape_to_str (line 70) | def shape_to_str(x): function init_ (line 74) | def init_(tensor): function checkpoint (line 81) | def checkpoint(func, inputs, params, flag): FILE: i2v/lvdm/data/frame_dataset.py function pil_loader (line 21) | def pil_loader(path): function accimage_loader (line 31) | def accimage_loader(path): function default_loader (line 39) | def default_loader(path): function is_image_file (line 48) | def is_image_file(filename): function find_classes (line 51) | def find_classes(dir): function class_name_to_idx (line 58) | def class_name_to_idx(annotation_dir): function make_dataset (line 68) | def make_dataset(dir, nframes, class_to_idx, frame_stride=1, **kwargs): function split_by_captical (line 124) | def split_by_captical(s): function make_dataset_ucf (line 131) | def make_dataset_ucf(dir, nframes, class_to_idx, frame_stride=1, clip_st... function load_and_transform_frames (line 206) | def load_and_transform_frames(frame_list, loader, img_transform=None): class VideoFrameDataset (line 230) | class VideoFrameDataset(data.Dataset): method __init__ (line 231) | def __init__(self, method __getitem__ (line 324) | def __getitem__(self, index): method __len__ (line 355) | def __len__(self): FILE: i2v/lvdm/data/taichi.py class Taichi (line 8) | class Taichi(Dataset): method __init__ (line 20) | def __init__(self, method _make_dataset (line 41) | def _make_dataset(self): method __getitem__ (line 50) | def __getitem__(self, index): method __len__ (line 81) | def __len__(self): FILE: i2v/lvdm/distributions.py class AbstractDistribution (line 5) | class AbstractDistribution: method sample (line 6) | def sample(self): method mode (line 9) | def mode(self): class DiracDistribution (line 13) | class DiracDistribution(AbstractDistribution): method __init__ (line 14) | def __init__(self, value): method sample (line 17) | def sample(self): method mode (line 20) | def mode(self): class DiagonalGaussianDistribution (line 24) | class DiagonalGaussianDistribution(object): method __init__ (line 25) | def __init__(self, parameters, deterministic=False): method sample (line 35) | def sample(self, noise=None): method kl (line 42) | def kl(self, other=None): method nll (line 56) | def nll(self, sample, dims=[1,2,3]): method mode (line 64) | def mode(self): function normal_kl (line 68) | def normal_kl(mean1, logvar1, mean2, logvar2): FILE: i2v/lvdm/ema.py class LitEma (line 5) | class LitEma(nn.Module): method __init__ (line 6) | def __init__(self, model, decay=0.9999, use_num_upates=True): method forward (line 25) | def forward(self,model): method copy_to (line 46) | def copy_to(self, model): method store (line 55) | def store(self, parameters): method restore (line 64) | def restore(self, parameters): FILE: i2v/lvdm/models/autoencoder.py class AutoencoderKL (line 13) | class AutoencoderKL(pl.LightningModule): method __init__ (line 14) | def __init__(self, method init_test (line 51) | def init_test(self,): method init_from_ckpt (line 80) | def init_from_ckpt(self, path, ignore_keys=list()): method encode (line 97) | def encode(self, x, **kwargs): method decode (line 104) | def decode(self, z, **kwargs): method forward (line 109) | def forward(self, input, sample_posterior=True): method get_input (line 118) | def get_input(self, batch, k): method training_step (line 128) | def training_step(self, batch, batch_idx, optimizer_idx): method validation_step (line 149) | def validation_step(self, batch, batch_idx): method configure_optimizers (line 163) | def configure_optimizers(self): method get_last_layer (line 174) | def get_last_layer(self): method log_images (line 178) | def log_images(self, batch, only_inputs=False, **kwargs): method to_rgb (line 194) | def to_rgb(self, x): class IdentityFirstStage (line 202) | class IdentityFirstStage(torch.nn.Module): method __init__ (line 203) | def __init__(self, *args, vq_interface=False, **kwargs): method encode (line 207) | def encode(self, x, *args, **kwargs): method decode (line 210) | def decode(self, x, *args, **kwargs): method quantize (line 213) | def quantize(self, x, *args, **kwargs): method forward (line 218) | def forward(self, x, *args, **kwargs): FILE: i2v/lvdm/models/ddpm3d.py class DDPM (line 43) | class DDPM(pl.LightningModule): method __init__ (line 45) | def __init__(self, method register_schedule (line 122) | def register_schedule(self, given_betas=None, beta_schedule="linear", ... method ema_scope (line 177) | def ema_scope(self, context=None): method init_from_ckpt (line 191) | def init_from_ckpt(self, path, ignore_keys=list(), only_model=False): method forward (line 209) | def forward(self, x, *args, **kwargs): method shared_step (line 213) | def shared_step(self, batch): method training_step (line 218) | def training_step(self, batch, batch_idx): method validation_step (line 233) | def validation_step(self, batch, batch_idx): method q_mean_variance (line 246) | def q_mean_variance(self, x_start, t): method predict_start_from_noise (line 258) | def predict_start_from_noise(self, x_t, t, noise): method q_posterior (line 264) | def q_posterior(self, x_start, x_t, t): method p_mean_variance (line 273) | def p_mean_variance(self, x, t, clip_denoised: bool): method p_sample (line 286) | def p_sample(self, x, t, clip_denoised=True, repeat_noise=False): method p_sample_loop (line 295) | def p_sample_loop(self, shape, return_intermediates=False): method sample (line 310) | def sample(self, batch_size=16, return_intermediates=False): method q_sample (line 316) | def q_sample(self, x_start, t, noise=None): method get_input (line 322) | def get_input(self, batch, k): method _get_rows_from_list (line 327) | def _get_rows_from_list(self, samples): method log_images (line 335) | def log_images(self, batch, N=8, n_row=2, sample=True, return_keys=Non... method get_loss (line 372) | def get_loss(self, pred, target, mean=True, mask=None): method p_losses (line 390) | def p_losses(self, x_start, cond, t, noise=None, skip_qsample=False, x... method configure_optimizers (line 430) | def configure_optimizers(self): class LatentDiffusion (line 441) | class LatentDiffusion(DDPM): method __init__ (line 443) | def __init__(self, method make_cond_schedule (line 524) | def make_cond_schedule(self, ): method q_sample (line 529) | def q_sample(self, x_start, t, noise=None): method _freeze_model (line 540) | def _freeze_model(self): method instantiate_first_stage (line 544) | def instantiate_first_stage(self, config): method instantiate_cond_stage (line 551) | def instantiate_cond_stage(self, config): method get_learned_conditioning (line 562) | def get_learned_conditioning(self, c): method get_first_stage_encoding (line 575) | def get_first_stage_encoding(self, encoder_posterior, noise=None): method encode_first_stage (line 605) | def encode_first_stage(self, x): method get_condition (line 617) | def get_condition(self, batch, x, bs, force_c_encode, k, cond_key): method get_input (line 656) | def get_input(self, batch, k, return_first_stage_outputs=False, force_... method shared_step (line 694) | def shared_step(self, batch, **kwargs): method forward (line 703) | def forward(self, x, c, *args, **kwargs): method encode_first_stage_2DAE (line 712) | def encode_first_stage_2DAE(self, x): method decode_core (line 719) | def decode_core(self, z, **kwargs): method decode_first_stage (line 736) | def decode_first_stage(self, z, **kwargs): method apply_model (line 739) | def apply_model(self, x_noisy, t, cond, **kwargs): method _get_denoise_row_from_list (line 756) | def _get_denoise_row_from_list(self, samples, desc=''): method decode_first_stage_2DAE (line 783) | def decode_first_stage_2DAE(self, z, **kwargs): method p_mean_variance (line 792) | def p_mean_variance(self, x, c, t, clip_denoised: bool, return_x0=Fals... method p_sample (line 818) | def p_sample(self, x, c, t, clip_denoised=False, repeat_noise=False, r... method p_sample_loop (line 840) | def p_sample_loop(self, cond, shape, return_intermediates=False, x_T=N... method sample (line 887) | def sample(self, cond, batch_size=16, return_intermediates=False, x_T=... method log_condition (line 905) | def log_condition(self, log, batch, xc, x, c, cond_stage_key=None): method sample_log (line 939) | def sample_log(self, cond, batch_size, ddim, ddim_steps, shape=None, *... method get_condition_validate (line 953) | def get_condition_validate(self, prompt): method log_images (line 964) | def log_images(self, batch, N=8, n_row=4, sample=True, ddim_steps=50, ... method decode_first_stage (line 1021) | def decode_first_stage(self, z, decode_bs=16, return_cpu=True, class LatentVisualDiffusion (line 1065) | class LatentVisualDiffusion(LatentDiffusion): method __init__ (line 1066) | def __init__(self, cond_img_config, finegrained=False, random_cond=Fal... method instantiate_img_embedder (line 1074) | def instantiate_img_embedder(self, config, freeze=True): method init_projector (line 1082) | def init_projector(self, use_finegrained, num_tokens, input_dim, cross... method get_image_embeds (line 1094) | def get_image_embeds(self, batch_imgs): class DiffusionWrapper (line 1101) | class DiffusionWrapper(pl.LightningModule): method __init__ (line 1102) | def __init__(self, diff_model_config, conditioning_key): method forward (line 1107) | def forward(self, x, t, c_concat: list = None, c_crossattn: list = None, FILE: i2v/lvdm/models/samplers/ddim.py class DDIMSampler (line 8) | class DDIMSampler(object): method __init__ (line 9) | def __init__(self, model, schedule="linear", **kwargs): method register_buffer (line 16) | def register_buffer(self, name, attr): method make_schedule (line 22) | def make_schedule(self, ddim_num_steps, ddim_discretize="uniform", ddi... method sample (line 63) | def sample(self, method ddim_sampling (line 133) | def ddim_sampling(self, cond, shape, method p_sample_ddim (line 213) | def p_sample_ddim(self, x, c, t, index, repeat_noise=False, use_origin... method stochastic_encode (line 295) | def stochastic_encode(self, x0, t, use_original_steps=False, noise=None): method decode (line 317) | def decode(self, x_latent, cond, t_start, unconditional_guidance_scale... FILE: i2v/lvdm/models/utils_diffusion.py function timestep_embedding (line 8) | def timestep_embedding(timesteps, dim, max_period=10000, repeat_only=Fal... function make_beta_schedule (line 31) | def make_beta_schedule(schedule, n_timestep, linear_start=1e-4, linear_e... function make_ddim_timesteps (line 56) | def make_ddim_timesteps(ddim_discr_method, num_ddim_timesteps, num_ddpm_... function make_ddim_sampling_parameters (line 73) | def make_ddim_sampling_parameters(alphacums, ddim_timesteps, eta, verbos... function betas_for_alpha_bar (line 88) | def betas_for_alpha_bar(num_diffusion_timesteps, alpha_bar, max_beta=0.9... FILE: i2v/lvdm/modules/attention.py class RelativePosition (line 21) | class RelativePosition(nn.Module): method __init__ (line 24) | def __init__(self, num_units, max_relative_position): method forward (line 31) | def forward(self, length_q, length_k): class CrossAttention (line 43) | class CrossAttention(nn.Module): method __init__ (line 45) | def __init__(self, query_dim, context_dim=None, heads=8, dim_head=64, ... method forward (line 76) | def forward(self, x, context=None, mask=None): method efficient_forward (line 129) | def efficient_forward(self, x, context=None, mask=None): class BasicTransformerBlock (line 187) | class BasicTransformerBlock(nn.Module): method __init__ (line 189) | def __init__(self, dim, n_heads, d_head, dropout=0., context_dim=None,... method forward (line 204) | def forward(self, x, context=None, mask=None): method _forward (line 216) | def _forward(self, x, context=None, mask=None): class SpatialTransformer (line 223) | class SpatialTransformer(nn.Module): method __init__ (line 233) | def __init__(self, in_channels, n_heads, d_head, depth=1, dropout=0., ... method forward (line 262) | def forward(self, x, context=None): class TemporalTransformer (line 281) | class TemporalTransformer(nn.Module): method __init__ (line 288) | def __init__(self, in_channels, n_heads, d_head, depth=1, dropout=0., ... method forward (line 331) | def forward(self, x, context=None): class GEGLU (line 376) | class GEGLU(nn.Module): method __init__ (line 377) | def __init__(self, dim_in, dim_out): method forward (line 381) | def forward(self, x): class FeedForward (line 386) | class FeedForward(nn.Module): method __init__ (line 387) | def __init__(self, dim, dim_out=None, mult=4, glu=False, dropout=0.): method forward (line 402) | def forward(self, x): class LinearAttention (line 406) | class LinearAttention(nn.Module): method __init__ (line 407) | def __init__(self, dim, heads=4, dim_head=32): method forward (line 414) | def forward(self, x): class SpatialSelfAttention (line 425) | class SpatialSelfAttention(nn.Module): method __init__ (line 426) | def __init__(self, in_channels): method forward (line 452) | def forward(self, x): FILE: i2v/lvdm/modules/encoders/condition.py class AbstractEncoder (line 10) | class AbstractEncoder(nn.Module): method __init__ (line 11) | def __init__(self): method encode (line 14) | def encode(self, *args, **kwargs): class IdentityEncoder (line 18) | class IdentityEncoder(AbstractEncoder): method encode (line 20) | def encode(self, x): class ClassEmbedder (line 24) | class ClassEmbedder(nn.Module): method __init__ (line 25) | def __init__(self, embed_dim, n_classes=1000, key='class', ucg_rate=0.1): method forward (line 32) | def forward(self, batch, key=None, disable_dropout=False): method get_unconditional_conditioning (line 44) | def get_unconditional_conditioning(self, bs, device="cuda"): function disabled_train (line 51) | def disabled_train(self, mode=True): class FrozenT5Embedder (line 57) | class FrozenT5Embedder(AbstractEncoder): method __init__ (line 60) | def __init__(self, version="google/t5-v1_1-large", device="cuda", max_... method freeze (line 70) | def freeze(self): method forward (line 76) | def forward(self, text): method encode (line 85) | def encode(self, text): class FrozenCLIPEmbedder (line 89) | class FrozenCLIPEmbedder(AbstractEncoder): method __init__ (line 97) | def __init__(self, version="openai/clip-vit-large-patch14", device="cu... method freeze (line 113) | def freeze(self): method forward (line 119) | def forward(self, text): method encode (line 132) | def encode(self, text): class ClipImageEmbedder (line 136) | class ClipImageEmbedder(nn.Module): method __init__ (line 137) | def __init__( method preprocess (line 155) | def preprocess(self, x): method forward (line 165) | def forward(self, x, no_dropout=False): class FrozenOpenCLIPEmbedder (line 174) | class FrozenOpenCLIPEmbedder(AbstractEncoder): method __init__ (line 184) | def __init__(self, arch="ViT-H-14", version="laion2b_s32b_b79k", devic... method freeze (line 204) | def freeze(self): method forward (line 209) | def forward(self, text): method encode_with_transformer (line 215) | def encode_with_transformer(self, text): method text_transformer_forward (line 224) | def text_transformer_forward(self, x: torch.Tensor, attn_mask=None): method encode (line 234) | def encode(self, text): class FrozenOpenCLIPImageEmbedder (line 238) | class FrozenOpenCLIPImageEmbedder(AbstractEncoder): method __init__ (line 243) | def __init__(self, arch="ViT-H-14", version="laion2b_s32b_b79k", devic... method preprocess (line 266) | def preprocess(self, x): method freeze (line 276) | def freeze(self): method forward (line 282) | def forward(self, image, no_dropout=False): method encode_with_vision_transformer (line 288) | def encode_with_vision_transformer(self, img): method encode (line 293) | def encode(self, text): class FrozenOpenCLIPImageEmbedderV2 (line 298) | class FrozenOpenCLIPImageEmbedderV2(AbstractEncoder): method __init__ (line 303) | def __init__(self, arch="ViT-H-14", version="laion2b_s32b_b79k", devic... method preprocess (line 324) | def preprocess(self, x): method freeze (line 334) | def freeze(self): method forward (line 339) | def forward(self, image, no_dropout=False): method encode_with_vision_transformer (line 344) | def encode_with_vision_transformer(self, x): class FrozenCLIPT5Encoder (line 377) | class FrozenCLIPT5Encoder(AbstractEncoder): method __init__ (line 378) | def __init__(self, clip_version="openai/clip-vit-large-patch14", t5_ve... method encode (line 386) | def encode(self, text): method forward (line 389) | def forward(self, text): FILE: i2v/lvdm/modules/encoders/ip_resampler.py class ImageProjModel (line 7) | class ImageProjModel(nn.Module): method __init__ (line 9) | def __init__(self, cross_attention_dim=1024, clip_embeddings_dim=1024,... method forward (line 16) | def forward(self, image_embeds): function FeedForward (line 24) | def FeedForward(dim, mult=4): function reshape_tensor (line 34) | def reshape_tensor(x, heads): class PerceiverAttention (line 45) | class PerceiverAttention(nn.Module): method __init__ (line 46) | def __init__(self, *, dim, dim_head=64, heads=8): method forward (line 61) | def forward(self, x, latents): class Resampler (line 93) | class Resampler(nn.Module): method __init__ (line 94) | def __init__( method forward (line 125) | def forward(self, x): FILE: i2v/lvdm/modules/networks/ae_modules.py function nonlinearity (line 10) | def nonlinearity(x): function Normalize (line 15) | def Normalize(in_channels, num_groups=32): class LinAttnBlock (line 20) | class LinAttnBlock(LinearAttention): method __init__ (line 22) | def __init__(self, in_channels): class AttnBlock (line 26) | class AttnBlock(nn.Module): method __init__ (line 27) | def __init__(self, in_channels): method forward (line 53) | def forward(self, x): function make_attn (line 80) | def make_attn(in_channels, attn_type="vanilla"): class Downsample (line 90) | class Downsample(nn.Module): method __init__ (line 91) | def __init__(self, in_channels, with_conv): method forward (line 102) | def forward(self, x): class Upsample (line 111) | class Upsample(nn.Module): method __init__ (line 112) | def __init__(self, in_channels, with_conv): method forward (line 123) | def forward(self, x): function get_timestep_embedding (line 129) | def get_timestep_embedding(timesteps, embedding_dim): class ResnetBlock (line 151) | class ResnetBlock(nn.Module): method __init__ (line 152) | def __init__(self, *, in_channels, out_channels=None, conv_shortcut=Fa... method forward (line 190) | def forward(self, x, temb): class Model (line 212) | class Model(nn.Module): method __init__ (line 213) | def __init__(self, *, ch, out_ch, ch_mult=(1,2,4,8), num_res_blocks, method forward (line 312) | def forward(self, x, t=None, context=None): method get_last_layer (line 360) | def get_last_layer(self): class Encoder (line 364) | class Encoder(nn.Module): method __init__ (line 365) | def __init__(self, *, ch, out_ch, ch_mult=(1,2,4,8), num_res_blocks, method forward (line 430) | def forward(self, x): class Decoder (line 466) | class Decoder(nn.Module): method __init__ (line 467) | def __init__(self, *, ch, out_ch, ch_mult=(1,2,4,8), num_res_blocks, method forward (line 539) | def forward(self, z): class SimpleDecoder (line 581) | class SimpleDecoder(nn.Module): method __init__ (line 582) | def __init__(self, in_channels, out_channels, *args, **kwargs): method forward (line 604) | def forward(self, x): class UpsampleDecoder (line 617) | class UpsampleDecoder(nn.Module): method __init__ (line 618) | def __init__(self, in_channels, out_channels, ch, num_res_blocks, reso... method forward (line 651) | def forward(self, x): class LatentRescaler (line 665) | class LatentRescaler(nn.Module): method __init__ (line 666) | def __init__(self, factor, in_channels, mid_channels, out_channels, de... method forward (line 690) | def forward(self, x): class MergedRescaleEncoder (line 702) | class MergedRescaleEncoder(nn.Module): method __init__ (line 703) | def __init__(self, in_channels, ch, resolution, out_ch, num_res_blocks, method forward (line 715) | def forward(self, x): class MergedRescaleDecoder (line 721) | class MergedRescaleDecoder(nn.Module): method __init__ (line 722) | def __init__(self, z_channels, out_ch, resolution, num_res_blocks, att... method forward (line 732) | def forward(self, x): class Upsampler (line 738) | class Upsampler(nn.Module): method __init__ (line 739) | def __init__(self, in_size, out_size, in_channels, out_channels, ch_mu... method forward (line 751) | def forward(self, x): class Resize (line 757) | class Resize(nn.Module): method __init__ (line 758) | def __init__(self, in_channels=None, learned=False, mode="bilinear"): method forward (line 773) | def forward(self, x, scale_factor=1.0): class FirstStagePostProcessor (line 780) | class FirstStagePostProcessor(nn.Module): method __init__ (line 782) | def __init__(self, ch_mult:list, in_channels, method instantiate_pretrained (line 817) | def instantiate_pretrained(self, config): method encode_with_pretrained (line 826) | def encode_with_pretrained(self,x): method forward (line 832) | def forward(self,x): FILE: i2v/lvdm/modules/networks/openaimodel3d.py class TimestepBlock (line 19) | class TimestepBlock(nn.Module): method forward (line 24) | def forward(self, x, emb): class TimestepEmbedSequential (line 30) | class TimestepEmbedSequential(nn.Sequential, TimestepBlock): method forward (line 36) | def forward(self, x, emb, context=None, batch_size=None): class Downsample (line 51) | class Downsample(nn.Module): method __init__ (line 60) | def __init__(self, channels, use_conv, dims=2, out_channels=None, padd... method forward (line 75) | def forward(self, x): class Upsample (line 80) | class Upsample(nn.Module): method __init__ (line 89) | def __init__(self, channels, use_conv, dims=2, out_channels=None, padd... method forward (line 98) | def forward(self, x): class ResBlock (line 109) | class ResBlock(TimestepBlock): method __init__ (line 124) | def __init__( method forward (line 195) | def forward(self, x, emb, batch_size=None): method _forward (line 208) | def _forward(self, x, emb, batch_size=None,): class TemporalConvBlock (line 237) | class TemporalConvBlock(nn.Module): method __init__ (line 242) | def __init__(self, in_channels, out_channels=None, dropout=0.0, spatia... method forward (line 269) | def forward(self, x): class UNetModel (line 279) | class UNetModel(nn.Module): method __init__ (line 307) | def __init__(self, method forward (line 534) | def forward(self, x, timesteps, context=None, features_adapter=None, f... FILE: i2v/lvdm/modules/x_transformer.py class AbsolutePositionalEmbedding (line 24) | class AbsolutePositionalEmbedding(nn.Module): method __init__ (line 25) | def __init__(self, dim, max_seq_len): method init_ (line 30) | def init_(self): method forward (line 33) | def forward(self, x): class FixedPositionalEmbedding (line 38) | class FixedPositionalEmbedding(nn.Module): method __init__ (line 39) | def __init__(self, dim): method forward (line 44) | def forward(self, x, seq_dim=1, offset=0): function exists (line 53) | def exists(val): function default (line 57) | def default(val, d): function always (line 63) | def always(val): function not_equals (line 69) | def not_equals(val): function equals (line 75) | def equals(val): function max_neg_value (line 81) | def max_neg_value(tensor): function pick_and_pop (line 87) | def pick_and_pop(keys, d): function group_dict_by_key (line 92) | def group_dict_by_key(cond, d): function string_begins_with (line 101) | def string_begins_with(prefix, str): function group_by_key_prefix (line 105) | def group_by_key_prefix(prefix, d): function groupby_prefix_and_trim (line 109) | def groupby_prefix_and_trim(prefix, d): class Scale (line 116) | class Scale(nn.Module): method __init__ (line 117) | def __init__(self, value, fn): method forward (line 122) | def forward(self, x, **kwargs): class Rezero (line 127) | class Rezero(nn.Module): method __init__ (line 128) | def __init__(self, fn): method forward (line 133) | def forward(self, x, **kwargs): class ScaleNorm (line 138) | class ScaleNorm(nn.Module): method __init__ (line 139) | def __init__(self, dim, eps=1e-5): method forward (line 145) | def forward(self, x): class RMSNorm (line 150) | class RMSNorm(nn.Module): method __init__ (line 151) | def __init__(self, dim, eps=1e-8): method forward (line 157) | def forward(self, x): class Residual (line 162) | class Residual(nn.Module): method forward (line 163) | def forward(self, x, residual): class GRUGating (line 167) | class GRUGating(nn.Module): method __init__ (line 168) | def __init__(self, dim): method forward (line 172) | def forward(self, x, residual): class GEGLU (line 183) | class GEGLU(nn.Module): method __init__ (line 184) | def __init__(self, dim_in, dim_out): method forward (line 188) | def forward(self, x): class FeedForward (line 193) | class FeedForward(nn.Module): method __init__ (line 194) | def __init__(self, dim, dim_out=None, mult=4, glu=False, dropout=0.): method forward (line 209) | def forward(self, x): class Attention (line 214) | class Attention(nn.Module): method __init__ (line 215) | def __init__( method forward (line 267) | def forward( class AttentionLayers (line 369) | class AttentionLayers(nn.Module): method __init__ (line 370) | def __init__( method forward (line 480) | def forward( class Encoder (line 540) | class Encoder(AttentionLayers): method __init__ (line 541) | def __init__(self, **kwargs): class TransformerWrapper (line 547) | class TransformerWrapper(nn.Module): method __init__ (line 548) | def __init__( method init_ (line 594) | def init_(self): method forward (line 597) | def forward( FILE: i2v/lvdm/utils/callbacks.py class ImageLogger (line 18) | class ImageLogger(Callback): method __init__ (line 19) | def __init__(self, batch_frequency, max_images, clamp=True, increase_l... method _testtube (line 51) | def _testtube(self, pl_module, images, batch_idx, split): method log_local (line 75) | def log_local(self, save_dir, split, images, method log_img (line 187) | def log_img(self, pl_module, batch, batch_idx, split="train", rank=0): method check_frequency (line 234) | def check_frequency(self, check_idx, split="train"): method on_train_batch_end (line 247) | def on_train_batch_end(self, trainer, pl_module, outputs, batch, batch... method on_validation_batch_end (line 252) | def on_validation_batch_end(self, trainer, pl_module, outputs, batch, ... method on_validation_epoch_end (line 263) | def on_validation_epoch_end(self, trainer, pl_module): class CUDACallback (line 284) | class CUDACallback(Callback): method on_train_epoch_start (line 285) | def on_train_epoch_start(self, trainer, pl_module): method on_train_epoch_end (line 296) | def on_train_epoch_end(self, trainer, pl_module): class SetupCallback_low (line 316) | class SetupCallback_low(Callback): method __init__ (line 317) | def __init__(self, resume, now, logdir, ckptdir, cfgdir, config, light... method on_keyboard_interrupt (line 329) | def on_keyboard_interrupt(self, trainer, pl_module): method on_pretrain_routine_start (line 336) | def on_pretrain_routine_start(self, trainer, pl_module): class SetupCallback_high (line 364) | class SetupCallback_high(Callback): method __init__ (line 365) | def __init__(self, resume, now, logdir, ckptdir, cfgdir, config, light... method on_keyboard_interrupt (line 377) | def on_keyboard_interrupt(self, trainer, pl_module): method on_fit_start (line 384) | def on_fit_start(self, trainer, pl_module): FILE: i2v/lvdm/utils/common_utils.py function shape_to_str (line 9) | def shape_to_str(x): function str2bool (line 14) | def str2bool(v): function get_obj_from_str (line 25) | def get_obj_from_str(string, reload=False): function instantiate_from_config (line 33) | def instantiate_from_config(config): function shift_dim (line 44) | def shift_dim(x, src_dim=-1, dest_dim=-1, make_contiguous=True): function torch_to_np (line 73) | def torch_to_np(x): function np_to_torch_video (line 84) | def np_to_torch_video(x): function load_npz_from_dir (line 90) | def load_npz_from_dir(data_dir): function load_npz_from_paths (line 96) | def load_npz_from_paths(data_paths): function ismap (line 102) | def ismap(x): function isimage (line 108) | def isimage(x): function exists (line 114) | def exists(x): function default (line 118) | def default(val, d): function mean_flat (line 124) | def mean_flat(tensor): function count_params (line 132) | def count_params(model, verbose=False): function check_istarget (line 139) | def check_istarget(name, para_list): FILE: i2v/lvdm/utils/saving_utils.py function tensor_to_mp4 (line 20) | def tensor_to_mp4(video, savepath, fps, rescale=True, nrow=None): function savenp2sheet (line 38) | def savenp2sheet(imgs, savepath, nrow=None): function save_np_to_img (line 71) | def save_np_to_img(img, path, norm=True): function npz_to_imgsheet_5d (line 79) | def npz_to_imgsheet_5d(data_path, res_dir, nrow=None,): function npz_to_imgsheet_4d (line 96) | def npz_to_imgsheet_4d(data_path, res_path, nrow=None,): function tensor_to_imgsheet (line 108) | def tensor_to_imgsheet(tensor, save_path): function npz_to_frames (line 120) | def npz_to_frames(data_path, res_dir, norm, num_frames=None, num_samples... function npz_to_gifs (line 144) | def npz_to_gifs(data_path, res_dir, duration=0.2, start_idx=0, num_video... function fill_with_black_squares (line 166) | def fill_with_black_squares(video, desired_len: int) -> Tensor: function load_num_videos (line 176) | def load_num_videos(data_path, num_videos): function npz_to_video_grid (line 190) | def npz_to_video_grid(data_path, out_path, num_frames=None, fps=8, num_v... function npz_to_gif_grid (line 228) | def npz_to_gif_grid(data_path, out_path, n_cols=None, num_videos=20): function torch_to_video_grid (line 249) | def torch_to_video_grid(videos, out_path, num_frames, fps, num_videos=No... function log_txt_as_img (line 274) | def log_txt_as_img(wh, xc, size=10): FILE: i2v/predict.py class Predictor (line 26) | class Predictor(BasePredictor): method setup (line 27) | def setup(self) -> None: method predict (line 41) | def predict( FILE: i2v/scripts/evaluation/ddp_wrapper.py function setup_dist (line 8) | def setup_dist(local_rank): function get_dist_info (line 15) | def get_dist_info(): FILE: i2v/scripts/evaluation/funcs.py function batch_ddim_sampling (line 13) | def batch_ddim_sampling(model, cond, noise_shape, n_samples=1, ddim_step... function get_filelist (line 85) | def get_filelist(data_dir, ext='*'): function get_dirlist (line 90) | def get_dirlist(path): function load_model_checkpoint (line 102) | def load_model_checkpoint(model, ckpt): function load_prompts (line 121) | def load_prompts(prompt_file): function load_video_batch (line 132) | def load_video_batch(filepath_list, frame_stride, video_size=(256,256), ... function load_image_batch (line 171) | def load_image_batch(filepath_list, image_size=(256,256)): function save_videos (line 195) | def save_videos(batch_tensors, savedir, filenames, fps=10): function save_videos_gif (line 209) | def save_videos_gif(batch_tensors, savepath, fps=10): FILE: i2v/scripts/evaluation/inference.py function get_parser (line 19) | def get_parser(): function run_inference (line 44) | def run_inference(args, gpu_num, gpu_no, **kwargs): FILE: i2v/scripts/evaluation/inference_util.py function get_parser (line 19) | def get_parser(): function run_inference (line 43) | def run_inference( function ensure_model (line 107) | def ensure_model(args): FILE: i2v/scripts/gradio/i2v_test.py class Image2Video (line 9) | class Image2Video(): method __init__ (line 10) | def __init__(self,result_dir='./tmp/',gpu_num=1) -> None: method get_image (line 31) | def get_image(self, image, prompt, steps=50, cfg_scale=12.0, eta=1.0, ... method download_model (line 70) | def download_model(self): FILE: i2v/scripts/gradio/t2v_test.py class Text2Video (line 9) | class Text2Video(): method __init__ (line 10) | def __init__(self,result_dir='./tmp/',gpu_num=1) -> None: method get_prompt (line 31) | def get_prompt(self, prompt, steps=50, cfg_scale=12.0, eta=1.0, fps=16): method download_model (line 62) | def download_model(self): FILE: i2v/train.py function get_parser (line 33) | def get_parser(**parser_kwargs): function nondefault_trainer_args (line 54) | def nondefault_trainer_args(opt): class WrappedDataset (line 61) | class WrappedDataset(Dataset): method __init__ (line 64) | def __init__(self, dataset): method __len__ (line 67) | def __len__(self): method __getitem__ (line 70) | def __getitem__(self, idx): class DataModuleFromConfig (line 74) | class DataModuleFromConfig(pl.LightningDataModule): method __init__ (line 75) | def __init__(self, batch_size, train=None, validation=None, test=None,... method prepare_data (line 101) | def prepare_data(self): method setup (line 104) | def setup(self, stage=None): method _train_dataloader (line 112) | def _train_dataloader(self): method _val_dataloader (line 119) | def _val_dataloader(self, shuffle=False): method _test_dataloader (line 132) | def _test_dataloader(self, shuffle=False): method _predict_dataloader (line 142) | def _predict_dataloader(self, shuffle=False): function melk (line 484) | def melk(*args, **kwargs): function divein (line 491) | def divein(*args, **kwargs): FILE: i2v/utils/common_utils.py function shape_to_str (line 9) | def shape_to_str(x): function str2bool (line 14) | def str2bool(v): function get_obj_from_str (line 25) | def get_obj_from_str(string, reload=False): function instantiate_from_config (line 33) | def instantiate_from_config(config): function shift_dim (line 44) | def shift_dim(x, src_dim=-1, dest_dim=-1, make_contiguous=True): function torch_to_np (line 73) | def torch_to_np(x): function np_to_torch_video (line 84) | def np_to_torch_video(x): function load_npz_from_dir (line 90) | def load_npz_from_dir(data_dir): function load_npz_from_paths (line 96) | def load_npz_from_paths(data_paths): function ismap (line 102) | def ismap(x): function isimage (line 108) | def isimage(x): function exists (line 114) | def exists(x): function default (line 118) | def default(val, d): function mean_flat (line 124) | def mean_flat(tensor): function count_params (line 132) | def count_params(model, verbose=False): function check_istarget (line 139) | def check_istarget(name, para_list): FILE: i2v/utils/log.py function release_logger_files (line 18) | def release_logger_files(): function set_experiment_logger (line 30) | def set_experiment_logger(path_out, file_name=FILE_LOGS, reset=True): function set_ptl_logger (line 53) | def set_ptl_logger(path_out, phase, file_name="ptl.log", reset=True): FILE: i2v/utils/utils.py function count_params (line 8) | def count_params(model, verbose=False): function check_istarget (line 15) | def check_istarget(name, para_list): function instantiate_from_config (line 27) | def instantiate_from_config(config): function get_obj_from_str (line 37) | def get_obj_from_str(string, reload=False): function load_npz_from_dir (line 45) | def load_npz_from_dir(data_dir): function load_npz_from_paths (line 51) | def load_npz_from_paths(data_paths): function resize_numpy_image (line 57) | def resize_numpy_image(image, max_resolution=512 * 512, resize_short_edg... function setup_dist (line 70) | def setup_dist(args):