SYMBOL INDEX (3978 symbols across 424 files) FILE: DiT-ToCa/cache_functions/attention.py class Attention (line 9) | class Attention(nn.Module): method __init__ (line 12) | def __init__( method forward (line 35) | def forward(self, x: torch.Tensor, cache_dic, current, fresh_indices=N... FILE: DiT-ToCa/cache_functions/cache_cutfresh.py function cache_cutfresh (line 5) | def cache_cutfresh(cache_dic, tokens, current): function local_selection_with_bonus (line 52) | def local_selection_with_bonus(score, bonus_ratio, grid_size=2): FILE: DiT-ToCa/cache_functions/cache_init.py function cache_init (line 1) | def cache_init(model_kwargs, num_steps): FILE: DiT-ToCa/cache_functions/cal_type.py function cal_type (line 1) | def cal_type(cache_dic, current): FILE: DiT-ToCa/cache_functions/force_init.py function force_init (line 3) | def force_init(cache_dic, current, tokens): FILE: DiT-ToCa/cache_functions/force_scheduler.py function force_scheduler (line 2) | def force_scheduler(cache_dic, current): FILE: DiT-ToCa/cache_functions/fresh_ratio_scheduler.py function fresh_ratio_scheduler (line 2) | def fresh_ratio_scheduler(cache_dic, current): FILE: DiT-ToCa/cache_functions/global_force_fresh.py function global_force_fresh (line 2) | def global_force_fresh(cache_dic, current): FILE: DiT-ToCa/cache_functions/score_evaluate.py function score_evaluate (line 4) | def score_evaluate(cache_dic, tokens, current) -> torch.Tensor: FILE: DiT-ToCa/cache_functions/scores.py function attn_score (line 5) | def attn_score(cache_dic, current): function similarity_score (line 18) | def similarity_score(cache_dic, current, tokens): function norm_score (line 23) | def norm_score(cache_dic, current, tokens): function kv_norm_score (line 27) | def kv_norm_score(cache_dic, current): FILE: DiT-ToCa/cache_functions/token_merge.py function token_merge (line 2) | def token_merge(cache_dic, tokens, current, fresh_indices, stale_indices): FILE: DiT-ToCa/cache_functions/update_cache.py function update_cache (line 2) | def update_cache(fresh_indices, fresh_tokens, cache_dic, current, fresh_... FILE: DiT-ToCa/diffusion/__init__.py function create_diffusion (line 10) | def create_diffusion( FILE: DiT-ToCa/diffusion/diffusion_utils.py function normal_kl (line 10) | def normal_kl(mean1, logvar1, mean2, logvar2): function approx_standard_normal_cdf (line 39) | def approx_standard_normal_cdf(x): function continuous_gaussian_log_likelihood (line 47) | def continuous_gaussian_log_likelihood(x, *, means, log_scales): function discretized_gaussian_log_likelihood (line 62) | def discretized_gaussian_log_likelihood(x, *, means, log_scales): FILE: DiT-ToCa/diffusion/gaussian_diffusion.py function mean_flat (line 17) | def mean_flat(tensor): class ModelMeanType (line 24) | class ModelMeanType(enum.Enum): class ModelVarType (line 34) | class ModelVarType(enum.Enum): class LossType (line 47) | class LossType(enum.Enum): method is_vb (line 55) | def is_vb(self): function _warmup_beta (line 59) | def _warmup_beta(beta_start, beta_end, num_diffusion_timesteps, warmup_f... function get_beta_schedule (line 66) | def get_beta_schedule(beta_schedule, *, beta_start, beta_end, num_diffus... function get_named_beta_schedule (line 99) | def get_named_beta_schedule(schedule_name, num_diffusion_timesteps): function betas_for_alpha_bar (line 126) | def betas_for_alpha_bar(num_diffusion_timesteps, alpha_bar, max_beta=0.9... class GaussianDiffusion (line 145) | class GaussianDiffusion: method __init__ (line 154) | def __init__( method q_mean_variance (line 206) | def q_mean_variance(self, x_start, t): method q_sample (line 218) | def q_sample(self, x_start, t, noise=None): method q_posterior_mean_variance (line 235) | def q_posterior_mean_variance(self, x_start, x_t, t): method p_mean_variance (line 257) | def p_mean_variance(self, model, x, t, current=None, cache_dic=None, c... method _predict_xstart_from_eps (line 339) | def _predict_xstart_from_eps(self, x_t, t, eps): method _predict_eps_from_xstart (line 346) | def _predict_eps_from_xstart(self, x_t, t, pred_xstart): method condition_mean (line 351) | def condition_mean(self, cond_fn, p_mean_var, x, t, model_kwargs=None): method condition_score (line 363) | def condition_score(self, cond_fn, p_mean_var, x, t, model_kwargs=None): method p_sample (line 381) | def p_sample( method p_sample_loop (line 428) | def p_sample_loop( method p_sample_loop_progressive (line 473) | def p_sample_loop_progressive( method ddim_sample (line 531) | def ddim_sample( method ddim_reverse_sample (line 584) | def ddim_reverse_sample( method ddim_sample_loop (line 622) | def ddim_sample_loop( method ddim_sample_loop_progressive (line 655) | def ddim_sample_loop_progressive( method _vb_terms_bpd (line 712) | def _vb_terms_bpd( method training_losses (line 745) | def training_losses(self, model, x_start, t, model_kwargs=None, noise=... method _prior_bpd (line 819) | def _prior_bpd(self, x_start): method calc_bpd_loop (line 835) | def calc_bpd_loop(self, model, x_start, clip_denoised=True, model_kwar... function _extract_into_tensor (line 891) | def _extract_into_tensor(arr, timesteps, broadcast_shape): FILE: DiT-ToCa/diffusion/respace.py function space_timesteps (line 12) | def space_timesteps(num_timesteps, section_counts): class SpacedDiffusion (line 65) | class SpacedDiffusion(GaussianDiffusion): method __init__ (line 73) | def __init__(self, use_timesteps, **kwargs): method p_mean_variance (line 89) | def p_mean_variance( method training_losses (line 94) | def training_losses( method condition_mean (line 99) | def condition_mean(self, cond_fn, *args, **kwargs): method condition_score (line 102) | def condition_score(self, cond_fn, *args, **kwargs): method _wrap_model (line 105) | def _wrap_model(self, model): method _scale_timesteps (line 112) | def _scale_timesteps(self, t): class _WrappedModel (line 117) | class _WrappedModel: method __init__ (line 118) | def __init__(self, model, timestep_map, original_num_steps): method __call__ (line 124) | def __call__(self, x, ts, **kwargs): FILE: DiT-ToCa/diffusion/timestep_sampler.py function create_named_schedule_sampler (line 13) | def create_named_schedule_sampler(name, diffusion): class ScheduleSampler (line 27) | class ScheduleSampler(ABC): method weights (line 38) | def weights(self): method sample (line 44) | def sample(self, batch_size, device): class UniformSampler (line 62) | class UniformSampler(ScheduleSampler): method __init__ (line 63) | def __init__(self, diffusion): method weights (line 67) | def weights(self): class LossAwareSampler (line 71) | class LossAwareSampler(ScheduleSampler): method update_with_local_losses (line 72) | def update_with_local_losses(self, local_ts, local_losses): method update_with_all_losses (line 106) | def update_with_all_losses(self, ts, losses): class LossSecondMomentResampler (line 120) | class LossSecondMomentResampler(LossAwareSampler): method __init__ (line 121) | def __init__(self, diffusion, history_per_term=10, uniform_prob=0.001): method weights (line 130) | def weights(self): method update_with_all_losses (line 139) | def update_with_all_losses(self, ts, losses): method _warmed_up (line 149) | def _warmed_up(self): FILE: DiT-ToCa/download.py function find_model (line 18) | def find_model(model_name): function download_model (line 32) | def download_model(model_name): FILE: DiT-ToCa/models.py function modulate (line 22) | def modulate(x, shift, scale): class TimestepEmbedder (line 30) | class TimestepEmbedder(nn.Module): method __init__ (line 34) | def __init__(self, hidden_size, frequency_embedding_size=256): method timestep_embedding (line 44) | def timestep_embedding(t, dim, max_period=10000): method forward (line 64) | def forward(self, t): class LabelEmbedder (line 70) | class LabelEmbedder(nn.Module): method __init__ (line 74) | def __init__(self, num_classes, hidden_size, dropout_prob): method token_drop (line 81) | def token_drop(self, labels, force_drop_ids=None): method forward (line 92) | def forward(self, labels, train, force_drop_ids=None): class DiTBlock (line 105) | class DiTBlock(nn.Module): method __init__ (line 109) | def __init__(self, hidden_size, num_heads, mlp_ratio=4.0, **block_kwar... method forward (line 122) | def forward(self, x, c, current, cache_dic): class FinalLayer (line 230) | class FinalLayer(nn.Module): method __init__ (line 234) | def __init__(self, hidden_size, patch_size, out_channels): method forward (line 243) | def forward(self, x, c): class DiT (line 250) | class DiT(nn.Module): method __init__ (line 254) | def __init__( method initialize_weights (line 287) | def initialize_weights(self): method unpatchify (line 323) | def unpatchify(self, x): method forward (line 338) | def forward(self, x, t, current, cache_dic, y): method forward_with_cfg (line 360) | def forward_with_cfg(self, x, t, current, cache_dic, y, cfg_scale, **k... function get_2d_sincos_pos_embed (line 388) | def get_2d_sincos_pos_embed(embed_dim, grid_size, cls_token=False, extra... function get_2d_sincos_pos_embed_from_grid (line 406) | def get_2d_sincos_pos_embed_from_grid(embed_dim, grid): function get_1d_sincos_pos_embed_from_grid (line 417) | def get_1d_sincos_pos_embed_from_grid(embed_dim, pos): function DiT_XL_2 (line 442) | def DiT_XL_2(**kwargs): function DiT_XL_4 (line 445) | def DiT_XL_4(**kwargs): function DiT_XL_8 (line 448) | def DiT_XL_8(**kwargs): function DiT_L_2 (line 451) | def DiT_L_2(**kwargs): function DiT_L_4 (line 454) | def DiT_L_4(**kwargs): function DiT_L_8 (line 457) | def DiT_L_8(**kwargs): function DiT_B_2 (line 460) | def DiT_B_2(**kwargs): function DiT_B_4 (line 463) | def DiT_B_4(**kwargs): function DiT_B_8 (line 466) | def DiT_B_8(**kwargs): function DiT_S_2 (line 469) | def DiT_S_2(**kwargs): function DiT_S_4 (line 472) | def DiT_S_4(**kwargs): function DiT_S_8 (line 475) | def DiT_S_8(**kwargs): FILE: DiT-ToCa/sample.py function main (line 21) | def main(args): FILE: DiT-ToCa/sample_ddp.py function create_npz_from_sample_folder (line 28) | def create_npz_from_sample_folder(sample_dir, num=50_000): function main (line 44) | def main(args): FILE: DiT-ToCa/train.py function update_ema (line 40) | def update_ema(ema_model, model, decay=0.9999): function requires_grad (line 52) | def requires_grad(model, flag=True): function cleanup (line 60) | def cleanup(): function create_logger (line 67) | def create_logger(logging_dir): function center_crop_arr (line 85) | def center_crop_arr(pil_image, image_size): function main (line 110) | def main(args): FILE: Open-Sora/build/lib/opensora/acceleration/checkpoint.py function set_grad_checkpoint (line 7) | def set_grad_checkpoint(model, use_fp32_attention=False, gc_step=1): function auto_grad_checkpoint (line 18) | def auto_grad_checkpoint(module, *args, **kwargs): FILE: Open-Sora/build/lib/opensora/acceleration/communications.py function _all_to_all (line 8) | def _all_to_all( class _AllToAll (line 21) | class _AllToAll(torch.autograd.Function): method forward (line 32) | def forward(ctx, input_, process_group, scatter_dim, gather_dim): method backward (line 41) | def backward(ctx, grad_output): function all_to_all (line 57) | def all_to_all( function _gather (line 66) | def _gather( function _split (line 83) | def _split(input_, pg: dist.ProcessGroup, dim=-1): function _gather (line 103) | def _gather(input_, pg: dist.ProcessGroup, dim=-1): class _GatherForwardSplitBackward (line 123) | class _GatherForwardSplitBackward(torch.autograd.Function): method symbolic (line 133) | def symbolic(graph, input_): method forward (line 137) | def forward(ctx, input_, process_group, dim, grad_scale): method backward (line 144) | def backward(ctx, grad_output): class _SplitForwardGatherBackward (line 153) | class _SplitForwardGatherBackward(torch.autograd.Function): method symbolic (line 164) | def symbolic(graph, input_): method forward (line 168) | def forward(ctx, input_, process_group, dim, grad_scale): method backward (line 175) | def backward(ctx, grad_output): function split_forward_gather_backward (line 183) | def split_forward_gather_backward(input_, process_group, dim, grad_scale... function gather_forward_split_backward (line 187) | def gather_forward_split_backward(input_, process_group, dim, grad_scale... FILE: Open-Sora/build/lib/opensora/acceleration/parallel_states.py function set_data_parallel_group (line 6) | def set_data_parallel_group(group: dist.ProcessGroup): function get_data_parallel_group (line 10) | def get_data_parallel_group(): function set_sequence_parallel_group (line 14) | def set_sequence_parallel_group(group: dist.ProcessGroup): function get_sequence_parallel_group (line 18) | def get_sequence_parallel_group(): FILE: Open-Sora/build/lib/opensora/acceleration/plugin.py class ZeroSeqParallelPlugin (line 14) | class ZeroSeqParallelPlugin(LowLevelZeroPlugin): method __init__ (line 15) | def __init__( method __del__ (line 64) | def __del__(self): method prepare_dataloader (line 68) | def prepare_dataloader( FILE: Open-Sora/build/lib/opensora/acceleration/shardformer/modeling/t5.py class T5LayerNorm (line 5) | class T5LayerNorm(nn.Module): method __init__ (line 6) | def __init__(self, hidden_size, eps=1e-6): method forward (line 14) | def forward(self, hidden_states): method from_native_module (line 30) | def from_native_module(module, *args, **kwargs): FILE: Open-Sora/build/lib/opensora/acceleration/shardformer/policy/t5_encoder.py class T5EncoderPolicy (line 6) | class T5EncoderPolicy(Policy): method config_sanity_check (line 7) | def config_sanity_check(self): method preprocess (line 11) | def preprocess(self): method module_policy (line 14) | def module_policy(self): method postprocess (line 66) | def postprocess(self): FILE: Open-Sora/build/lib/opensora/datasets/aspect.py function get_h_w (line 5) | def get_h_w(a, ts, eps=1e-4): function get_aspect_ratios_dict (line 15) | def get_aspect_ratios_dict(ars, ts=360 * 640): function get_ar (line 20) | def get_ar(ratio): function get_closest_ratio (line 440) | def get_closest_ratio(height: float, width: float, ratios: dict): function get_num_pixels (line 463) | def get_num_pixels(name): function get_image_size (line 467) | def get_image_size(resolution, ar_ratio): function get_num_frames (line 491) | def get_num_frames(num_frames): FILE: Open-Sora/build/lib/opensora/datasets/bucket.py function find_approximate_hw (line 10) | def find_approximate_hw(hw, hw_dict, approx=0.8): function find_closet_smaller_bucket (line 17) | def find_closet_smaller_bucket(t, t_dict, frame_interval): class Bucket (line 31) | class Bucket: method __init__ (line 32) | def __init__(self, bucket_config): method get_bucket_id (line 74) | def get_bucket_id(self, T, H, W, frame_interval=1, seed=None): method get_thw (line 122) | def get_thw(self, bucket_id): method get_prob (line 128) | def get_prob(self, bucket_id): method get_batch_size (line 131) | def get_batch_size(self, bucket_id): method __len__ (line 134) | def __len__(self): function closet_smaller_bucket (line 138) | def closet_smaller_bucket(value, bucket): FILE: Open-Sora/build/lib/opensora/datasets/dataloader.py function get_seed_worker (line 16) | def get_seed_worker(seed): function prepare_dataloader (line 26) | def prepare_dataloader( function collate_fn_default (line 113) | def collate_fn_default(batch): function collate_fn_batch (line 134) | def collate_fn_batch(batch): FILE: Open-Sora/build/lib/opensora/datasets/datasets.py class VideoTextDataset (line 19) | class VideoTextDataset(torch.utils.data.Dataset): method __init__ (line 28) | def __init__( method _print_data_number (line 47) | def _print_data_number(self): method get_type (line 57) | def get_type(self, path): method getitem (line 65) | def getitem(self, index): method __getitem__ (line 101) | def __getitem__(self, index): method __len__ (line 111) | def __len__(self): class VariableVideoTextDataset (line 116) | class VariableVideoTextDataset(VideoTextDataset): method __init__ (line 117) | def __init__( method get_data_info (line 131) | def get_data_info(self, index): method getitem (line 137) | def getitem(self, index): method __getitem__ (line 192) | def __getitem__(self, index): class BatchFeatureDataset (line 200) | class BatchFeatureDataset(torch.utils.data.Dataset): method __init__ (line 209) | def __init__(self, data_path=None): method num_buffers (line 220) | def num_buffers(self): method len_buffer (line 224) | def len_buffer(self): method _load_buffer (line 227) | def _load_buffer(self, idx): method __len__ (line 233) | def __len__(self): method __getitem__ (line 236) | def __getitem__(self, idx): FILE: Open-Sora/build/lib/opensora/datasets/read_video.py function read_video_av (line 19) | def read_video_av( function _read_from_stream (line 119) | def _read_from_stream( function read_video_cv2 (line 213) | def read_video_cv2(video_path): function read_video (line 250) | def read_video(video_path, backend="av"): FILE: Open-Sora/build/lib/opensora/datasets/sampler.py function apply (line 19) | def apply(data, method=None, frame_interval=None, seed=None, num_bucket=... class StatefulDistributedSampler (line 29) | class StatefulDistributedSampler(DistributedSampler): method __init__ (line 30) | def __init__( method __iter__ (line 42) | def __iter__(self) -> Iterator: method __len__ (line 48) | def __len__(self) -> int: method reset (line 51) | def reset(self) -> None: method state_dict (line 54) | def state_dict(self, step) -> dict: method load_state_dict (line 57) | def load_state_dict(self, state_dict: dict) -> None: class VariableVideoBatchSampler (line 61) | class VariableVideoBatchSampler(DistributedSampler): method __init__ (line 62) | def __init__( method __iter__ (line 86) | def __iter__(self) -> Iterator[List[int]]: method __len__ (line 190) | def __len__(self) -> int: method group_by_bucket (line 193) | def group_by_bucket(self) -> dict: method get_num_batch (line 220) | def get_num_batch(self) -> int: method _print_bucket_info (line 229) | def _print_bucket_info(self, bucket_sample_dict: dict) -> None: method reset (line 275) | def reset(self): method state_dict (line 278) | def state_dict(self, num_steps: int) -> dict: method load_state_dict (line 285) | def load_state_dict(self, state_dict: dict) -> None: class BatchDistributedSampler (line 289) | class BatchDistributedSampler(DistributedSampler): method __init__ (line 300) | def __init__(self, dataset: Dataset, **kwargs): method __iter__ (line 304) | def __iter__(self): method reset (line 315) | def reset(self): method state_dict (line 318) | def state_dict(self, step) -> dict: method load_state_dict (line 321) | def load_state_dict(self, state_dict: dict): FILE: Open-Sora/build/lib/opensora/datasets/utils.py function is_img (line 30) | def is_img(path): function is_vid (line 35) | def is_vid(path): function is_url (line 40) | def is_url(url): function read_file (line 44) | def read_file(input_path): function download_url (line 53) | def download_url(input_path): function temporal_random_crop (line 65) | def temporal_random_crop(vframes, num_frames, frame_interval): function get_transforms_video (line 77) | def get_transforms_video(name="center", image_size=(256, 256)): function get_transforms_image (line 103) | def get_transforms_image(name="center", image_size=(256, 256)): function read_image_from_path (line 129) | def read_image_from_path(path, transform=None, transform_name="center", ... function read_video_from_path (line 139) | def read_video_from_path(path, transform=None, transform_name="center", ... function read_from_path (line 148) | def read_from_path(path, image_size, transform_name="center"): function save_sample (line 159) | def save_sample(x, save_path=None, fps=8, normalize=True, value_range=(-... function center_crop_arr (line 184) | def center_crop_arr(pil_image, image_size): function resize_crop_to_fill (line 201) | def resize_crop_to_fill(pil_image, image_size): FILE: Open-Sora/build/lib/opensora/datasets/video_transforms.py function _is_tensor_video_clip (line 25) | def _is_tensor_video_clip(clip): function crop (line 35) | def crop(clip, i, j, h, w): function resize (line 45) | def resize(clip, target_size, interpolation_mode): function resize_scale (line 51) | def resize_scale(clip, target_size, interpolation_mode): function resized_crop (line 59) | def resized_crop(clip, i, j, h, w, size, interpolation_mode="bilinear"): function center_crop (line 79) | def center_crop(clip, crop_size): function center_crop_using_short_edge (line 92) | def center_crop_using_short_edge(clip): function resize_crop_to_fill (line 107) | def resize_crop_to_fill(clip, target_size): function random_shift_crop (line 127) | def random_shift_crop(clip): function to_tensor (line 147) | def to_tensor(clip): function normalize (line 163) | def normalize(clip, mean, std, inplace=False): function hflip (line 183) | def hflip(clip): class ResizeCrop (line 195) | class ResizeCrop: method __init__ (line 196) | def __init__(self, size): method __call__ (line 202) | def __call__(self, clip): method __repr__ (line 206) | def __repr__(self) -> str: class RandomCropVideo (line 210) | class RandomCropVideo: method __init__ (line 211) | def __init__(self, size): method __call__ (line 217) | def __call__(self, clip): method get_params (line 228) | def get_params(self, clip): method __repr__ (line 243) | def __repr__(self) -> str: class CenterCropResizeVideo (line 247) | class CenterCropResizeVideo: method __init__ (line 253) | def __init__( method __call__ (line 267) | def __call__(self, clip): method __repr__ (line 281) | def __repr__(self) -> str: class UCFCenterCropVideo (line 285) | class UCFCenterCropVideo: method __init__ (line 291) | def __init__( method __call__ (line 305) | def __call__(self, clip): method __repr__ (line 317) | def __repr__(self) -> str: class KineticsRandomCropResizeVideo (line 321) | class KineticsRandomCropResizeVideo: method __init__ (line 326) | def __init__( method __call__ (line 340) | def __call__(self, clip): class CenterCropVideo (line 346) | class CenterCropVideo: method __init__ (line 347) | def __init__( method __call__ (line 361) | def __call__(self, clip): method __repr__ (line 372) | def __repr__(self) -> str: class NormalizeVideo (line 376) | class NormalizeVideo: method __init__ (line 385) | def __init__(self, mean, std, inplace=False): method __call__ (line 390) | def __call__(self, clip): method __repr__ (line 397) | def __repr__(self) -> str: class ToTensorVideo (line 401) | class ToTensorVideo: method __init__ (line 407) | def __init__(self): method __call__ (line 410) | def __call__(self, clip): method __repr__ (line 419) | def __repr__(self) -> str: class RandomHorizontalFlipVideo (line 423) | class RandomHorizontalFlipVideo: method __init__ (line 430) | def __init__(self, p=0.5): method __call__ (line 433) | def __call__(self, clip): method __repr__ (line 444) | def __repr__(self) -> str: class TemporalRandomCrop (line 451) | class TemporalRandomCrop(object): method __init__ (line 458) | def __init__(self, size): method __call__ (line 461) | def __call__(self, total_frames): FILE: Open-Sora/build/lib/opensora/models/cache_functions/attention.py function cached_attention_forward (line 8) | def cached_attention_forward( FILE: Open-Sora/build/lib/opensora/models/cache_functions/cache_cutfresh.py function cache_cutfresh (line 5) | def cache_cutfresh(cache_dic, tokens, current): function local_selection_with_space_time_bonus (line 63) | def local_selection_with_space_time_bonus(cache_dic, score, bonus_ratio,... FILE: Open-Sora/build/lib/opensora/models/cache_functions/cache_init.py function cache_init (line 1) | def cache_init(model_kwargs, num_steps): FILE: Open-Sora/build/lib/opensora/models/cache_functions/force_init.py function force_init (line 3) | def force_init(cache_dic, current, tokens): FILE: Open-Sora/build/lib/opensora/models/cache_functions/force_scheduler.py function force_scheduler (line 2) | def force_scheduler(cache_dic, current): FILE: Open-Sora/build/lib/opensora/models/cache_functions/fresh_ratio_scheduler.py function fresh_ratio_scheduler (line 2) | def fresh_ratio_scheduler(cache_dic, current): FILE: Open-Sora/build/lib/opensora/models/cache_functions/global_force_fresh.py function global_force_fresh (line 2) | def global_force_fresh(cache_dic, current): FILE: Open-Sora/build/lib/opensora/models/cache_functions/score_evaluate.py function score_evaluate (line 4) | def score_evaluate(cache_dic, tokens, current) -> torch.Tensor: FILE: Open-Sora/build/lib/opensora/models/cache_functions/scores.py function attn_score (line 5) | def attn_score(cache_dic, current): function similarity_score (line 23) | def similarity_score(cache_dic, current, tokens): function norm_score (line 28) | def norm_score(cache_dic, current, tokens): FILE: Open-Sora/build/lib/opensora/models/cache_functions/token_merge.py function token_merge (line 2) | def token_merge(cache_dic, tokens, current, fresh_indices, stale_indices): FILE: Open-Sora/build/lib/opensora/models/cache_functions/update_cache.py function update_cache (line 2) | def update_cache(fresh_indices, fresh_tokens, cache_dic, current, fresh_... FILE: Open-Sora/build/lib/opensora/models/dit/dit.py class DiTBlock (line 37) | class DiTBlock(nn.Module): method __init__ (line 42) | def __init__( method forward (line 67) | def forward(self, x, c): class DiT (line 75) | class DiT(nn.Module): method __init__ (line 80) | def __init__( method get_spatial_pos_embed (line 158) | def get_spatial_pos_embed(self): method get_temporal_pos_embed (line 166) | def get_temporal_pos_embed(self): method unpatchify (line 174) | def unpatchify(self, x): method forward (line 184) | def forward(self, x, t, y): method initialize_weights (line 226) | def initialize_weights(self): function DiT_XL_2 (line 264) | def DiT_XL_2(from_pretrained=None, **kwargs): function DiT_XL_2x2 (line 278) | def DiT_XL_2x2(from_pretrained=None, **kwargs): FILE: Open-Sora/build/lib/opensora/models/latte/latte.py class Latte (line 33) | class Latte(DiT): method forward (line 34) | def forward(self, x, t, y): function Latte_XL_2 (line 88) | def Latte_XL_2(from_pretrained=None, **kwargs): function Latte_XL_2x2 (line 102) | def Latte_XL_2x2(from_pretrained=None, **kwargs): FILE: Open-Sora/build/lib/opensora/models/layers/blocks.py class LlamaRMSNorm (line 34) | class LlamaRMSNorm(nn.Module): method __init__ (line 35) | def __init__(self, hidden_size, eps=1e-6): method forward (line 43) | def forward(self, hidden_states): function get_layernorm (line 51) | def get_layernorm(hidden_size: torch.Tensor, eps: float, affine: bool, u... function modulate (line 63) | def modulate(norm_func, x, shift, scale): function t2i_modulate (line 72) | def t2i_modulate(x, shift, scale): class PatchEmbed3D (line 81) | class PatchEmbed3D(nn.Module): method __init__ (line 91) | def __init__( method forward (line 112) | def forward(self, x): class Attention (line 134) | class Attention(nn.Module): method __init__ (line 135) | def __init__( method forward (line 171) | def forward(self, x: torch.Tensor) -> torch.Tensor: class KVCompressAttention (line 232) | class KVCompressAttention(nn.Module): method __init__ (line 233) | def __init__( method downsample_2d (line 276) | def downsample_2d(self, tensor, H, W, scale_factor, sampling=None): method forward (line 300) | def forward(self, x: torch.Tensor, mask=None, HW=None, block_id=None, ... class SeqParallelAttention (line 362) | class SeqParallelAttention(Attention): method __init__ (line 363) | def __init__( method forward (line 387) | def forward(self, x: torch.Tensor) -> torch.Tensor: class MultiHeadCrossAttention (line 455) | class MultiHeadCrossAttention(nn.Module): method __init__ (line 456) | def __init__(self, d_model, num_heads, attn_drop=0.0, proj_drop=0.0): method forward (line 470) | def forward(self, x, cond, mask=None): class SeqParallelMultiHeadCrossAttention (line 496) | class SeqParallelMultiHeadCrossAttention(MultiHeadCrossAttention): method __init__ (line 497) | def __init__( method forward (line 511) | def forward(self, x, cond, mask=None): class FinalLayer (line 549) | class FinalLayer(nn.Module): method __init__ (line 554) | def __init__(self, hidden_size, num_patch, out_channels): method forward (line 560) | def forward(self, x, c): class T2IFinalLayer (line 567) | class T2IFinalLayer(nn.Module): method __init__ (line 572) | def __init__(self, hidden_size, num_patch, out_channels, d_t=None, d_s... method t_mask_select (line 581) | def t_mask_select(self, x_mask, x, masked_x, T, S): method forward (line 591) | def forward(self, x, t, x_mask=None, t0=None, T=None, S=None): class TimestepEmbedder (line 611) | class TimestepEmbedder(nn.Module): method __init__ (line 616) | def __init__(self, hidden_size, frequency_embedding_size=256): method timestep_embedding (line 626) | def timestep_embedding(t, dim, max_period=10000): method forward (line 645) | def forward(self, t, dtype): class LabelEmbedder (line 653) | class LabelEmbedder(nn.Module): method __init__ (line 658) | def __init__(self, num_classes, hidden_size, dropout_prob): method token_drop (line 665) | def token_drop(self, labels, force_drop_ids=None): method forward (line 676) | def forward(self, labels, train, force_drop_ids=None): class SizeEmbedder (line 683) | class SizeEmbedder(TimestepEmbedder): method __init__ (line 688) | def __init__(self, hidden_size, frequency_embedding_size=256): method forward (line 698) | def forward(self, s, bs): method dtype (line 713) | def dtype(self): class CaptionEmbedder (line 717) | class CaptionEmbedder(nn.Module): method __init__ (line 722) | def __init__( method token_drop (line 744) | def token_drop(self, caption, force_drop_ids=None): method forward (line 755) | def forward(self, caption, train, force_drop_ids=None): class PositionEmbedding2D (line 765) | class PositionEmbedding2D(nn.Module): method __init__ (line 766) | def __init__(self, dim: int) -> None: method _get_sin_cos_emb (line 774) | def _get_sin_cos_emb(self, t: torch.Tensor): method _get_cached_emb (line 781) | def _get_cached_emb( method forward (line 806) | def forward( function get_2d_sincos_pos_embed (line 823) | def get_2d_sincos_pos_embed(embed_dim, grid_size, cls_token=False, extra... function get_2d_sincos_pos_embed_from_grid (line 847) | def get_2d_sincos_pos_embed_from_grid(embed_dim, grid): function get_1d_sincos_pos_embed (line 858) | def get_1d_sincos_pos_embed(embed_dim, length, scale=1.0): function get_1d_sincos_pos_embed_from_grid (line 863) | def get_1d_sincos_pos_embed_from_grid(embed_dim, pos): FILE: Open-Sora/build/lib/opensora/models/pixart/pixart.py class PixArtBlock (line 53) | class PixArtBlock(nn.Module): method __init__ (line 58) | def __init__( method forward (line 95) | def forward(self, x, y, t, mask=None): class PixArt (line 109) | class PixArt(nn.Module): method __init__ (line 114) | def __init__( method forward (line 200) | def forward(self, x, timestep, y, mask=None, **kwargs): method unpatchify (line 249) | def unpatchify(self, x): method get_spatial_pos_embed (line 259) | def get_spatial_pos_embed(self, grid_size=None): method get_temporal_pos_embed (line 271) | def get_temporal_pos_embed(self): method freeze_text (line 280) | def freeze_text(self): method initialize_weights (line 285) | def initialize_weights(self): class PixArtMS (line 319) | class PixArtMS(PixArt): method __init__ (line 320) | def __init__(self, *args, **kwargs): method forward (line 327) | def forward(self, x, timestep, y, mask=None, data_info=None): function PixArt_XL_2 (line 385) | def PixArt_XL_2(from_pretrained=None, **kwargs): function PixArt_1B_2 (line 393) | def PixArt_1B_2(from_pretrained=None, **kwargs): function PixArtMS_XL_2 (line 401) | def PixArtMS_XL_2(from_pretrained=None, **kwargs): FILE: Open-Sora/build/lib/opensora/models/pixart/pixart_sigma.py class PixArtBlock (line 50) | class PixArtBlock(nn.Module): method __init__ (line 55) | def __init__( method forward (line 98) | def forward(self, x, y, t, hw, mask=None): class PixArt_Sigma (line 114) | class PixArt_Sigma(nn.Module): method __init__ (line 119) | def __init__( method forward (line 219) | def forward(self, x, timestep, y, mask=None): method unpatchify (line 268) | def unpatchify(self, x): method get_spatial_pos_embed (line 278) | def get_spatial_pos_embed(self, grid_size=None): method get_temporal_pos_embed (line 290) | def get_temporal_pos_embed(self): method freeze_text (line 299) | def freeze_text(self): method initialize_weights (line 304) | def initialize_weights(self): function PixArt_Sigma_XL_2 (line 338) | def PixArt_Sigma_XL_2(from_pretrained=None, **kwargs): FILE: Open-Sora/build/lib/opensora/models/stdit/stdit.py class STDiTBlock (line 31) | class STDiTBlock(nn.Module): method __init__ (line 32) | def __init__( method t_mask_select (line 88) | def t_mask_select(self, x, masked_x, x_mask): method forward (line 98) | def forward(self, x, y, t, mask=None, tpe=None, x_mask=None, t0=None): class STDiT (line 157) | class STDiT(nn.Module): method __init__ (line 158) | def __init__( method forward (line 258) | def forward(self, x, timestep, y, mask=None, x_mask=None, **kwargs): method unpatchify (line 331) | def unpatchify(self, x): method unpatchify_old (line 355) | def unpatchify_old(self, x): method get_spatial_pos_embed (line 365) | def get_spatial_pos_embed(self, grid_size=None): method get_temporal_pos_embed (line 376) | def get_temporal_pos_embed(self): method freeze_not_temporal (line 385) | def freeze_not_temporal(self): method freeze_text (line 390) | def freeze_text(self): method initialize_temporal (line 395) | def initialize_temporal(self): method initialize_weights (line 400) | def initialize_weights(self): function STDiT_XL_2 (line 434) | def STDiT_XL_2(from_pretrained=None, **kwargs): FILE: Open-Sora/build/lib/opensora/models/stdit/stdit2.py class STDiT2Block (line 31) | class STDiT2Block(nn.Module): method __init__ (line 32) | def __init__( method t_mask_select (line 85) | def t_mask_select(self, x_mask, x, masked_x, T, S): method forward (line 95) | def forward(self, x, y, t, t_tmp, mask=None, x_mask=None, t0=None, t0_... class STDiT2Config (line 170) | class STDiT2Config(PretrainedConfig): method __init__ (line 173) | def __init__( class STDiT2 (line 219) | class STDiT2(PreTrainedModel): method __init__ (line 222) | def __init__(self, config): method get_dynamic_size (line 292) | def get_dynamic_size(self, x): method forward (line 305) | def forward( method unpatchify (line 413) | def unpatchify(self, x, N_t, N_h, N_w, R_t, R_h, R_w): method unpatchify_old (line 439) | def unpatchify_old(self, x): method get_spatial_pos_embed (line 449) | def get_spatial_pos_embed(self, H, W, scale=1.0, base_size=None): method freeze_not_temporal (line 459) | def freeze_not_temporal(self): method freeze_text (line 464) | def freeze_text(self): method initialize_temporal (line 469) | def initialize_temporal(self): method initialize_weights (line 474) | def initialize_weights(self): function STDiT2_XL_2 (line 509) | def STDiT2_XL_2(from_pretrained=None, **kwargs): FILE: Open-Sora/build/lib/opensora/models/stdit/stdit3 copy.py class STDiT3Block (line 37) | class STDiT3Block(nn.Module): method __init__ (line 38) | def __init__( method t_mask_select (line 81) | def t_mask_select(self, x_mask, x, masked_x, T, S): method forward (line 91) | def forward( class STDiT3Config (line 263) | class STDiT3Config(PretrainedConfig): method __init__ (line 266) | def __init__( class STDiT3 (line 313) | class STDiT3(PreTrainedModel): method __init__ (line 316) | def __init__(self, config): method initialize_weights (line 410) | def initialize_weights(self): method get_dynamic_size (line 432) | def get_dynamic_size(self, x): method encode_text (line 445) | def encode_text(self, y, mask=None): method forward (line 458) | def forward(self, x, timestep, y, mask=None, x_mask=None, fps=None, he... method unpatchify (line 546) | def unpatchify(self, x, N_t, N_h, N_w, R_t, R_h, R_w): function STDiT3_XL_2 (line 574) | def STDiT3_XL_2(from_pretrained=None, **kwargs): function STDiT3_3B_2 (line 587) | def STDiT3_3B_2(from_pretrained=None, **kwargs): FILE: Open-Sora/build/lib/opensora/models/stdit/stdit3.py class STDiT3Block (line 37) | class STDiT3Block(nn.Module): method __init__ (line 38) | def __init__( method t_mask_select (line 81) | def t_mask_select(self, x_mask, x, masked_x, T, S): method forward (line 91) | def forward( class STDiT3Config (line 213) | class STDiT3Config(PretrainedConfig): method __init__ (line 216) | def __init__( class STDiT3 (line 263) | class STDiT3(PreTrainedModel): method __init__ (line 266) | def __init__(self, config): method initialize_weights (line 360) | def initialize_weights(self): method get_dynamic_size (line 382) | def get_dynamic_size(self, x): method encode_text (line 395) | def encode_text(self, y, mask=None): method forward (line 408) | def forward(self, x, timestep, y, mask=None, x_mask=None, fps=None, he... method unpatchify (line 496) | def unpatchify(self, x, N_t, N_h, N_w, R_t, R_h, R_w): function STDiT3_XL_2 (line 524) | def STDiT3_XL_2(from_pretrained=None, **kwargs): function STDiT3_3B_2 (line 537) | def STDiT3_3B_2(from_pretrained=None, **kwargs): FILE: Open-Sora/build/lib/opensora/models/text_encoder/classes.py class ClassEncoder (line 7) | class ClassEncoder: method __init__ (line 8) | def __init__(self, num_classes, model_max_length=None, device="cuda", ... method encode (line 16) | def encode(self, text): method null (line 19) | def null(self, n): FILE: Open-Sora/build/lib/opensora/models/text_encoder/clip.py class AbstractEncoder (line 36) | class AbstractEncoder(nn.Module): method __init__ (line 37) | def __init__(self): method encode (line 40) | def encode(self, *args, **kwargs): class FrozenCLIPEmbedder (line 44) | class FrozenCLIPEmbedder(AbstractEncoder): method __init__ (line 47) | def __init__(self, path="openai/clip-vit-huge-patch14", device="cuda",... method _freeze (line 55) | def _freeze(self): method forward (line 60) | def forward(self, text): method encode (line 77) | def encode(self, text): class ClipEncoder (line 82) | class ClipEncoder: method __init__ (line 87) | def __init__( method encode (line 103) | def encode(self, text): method null (line 108) | def null(self, n): method to (line 112) | def to(self, dtype): FILE: Open-Sora/build/lib/opensora/models/text_encoder/t5.py class T5Embedder (line 34) | class T5Embedder: method __init__ (line 35) | def __init__( method get_text_embeddings (line 113) | def get_text_embeddings(self, texts): class T5Encoder (line 135) | class T5Encoder: method __init__ (line 136) | def __init__( method shardformer_t5 (line 166) | def shardformer_t5(self): method encode (line 189) | def encode(self, text): method null (line 194) | def null(self, n): function basic_clean (line 199) | def basic_clean(text): function clean_caption (line 210) | def clean_caption(caption): function text_preprocessing (line 328) | def text_preprocessing(text, use_text_preprocessing: bool = True): FILE: Open-Sora/build/lib/tools/caption/acceleration/llava/policies/llama.py class LlavaLlamaPolicy (line 10) | class LlavaLlamaPolicy(Policy): method config_sanity_check (line 11) | def config_sanity_check(self): method preprocess (line 14) | def preprocess(self): method module_policy (line 26) | def module_policy(self) -> Dict[Union[str, nn.Module], ModulePolicyDes... method postprocess (line 77) | def postprocess(self): class LlavaLlamaForCausalLMPolicy (line 81) | class LlavaLlamaForCausalLMPolicy(LlavaLlamaPolicy): method module_policy (line 82) | def module_policy(self): FILE: Open-Sora/build/lib/tools/caption/acceleration/llava/policies/mistral.py class LlavaMistralPolicy (line 11) | class LlavaMistralPolicy(Policy): method config_sanity_check (line 12) | def config_sanity_check(self): method preprocess (line 15) | def preprocess(self): method module_policy (line 27) | def module_policy(self) -> Dict[Union[str, nn.Module], ModulePolicyDes... method postprocess (line 91) | def postprocess(self): class LlavaMistralForCausalLMPolicy (line 95) | class LlavaMistralForCausalLMPolicy(LlavaMistralPolicy): method module_policy (line 96) | def module_policy(self): FILE: Open-Sora/build/lib/tools/caption/camera_motion/camera_motion.py function transform (line 10) | def transform(vector): class CameraPredict (line 16) | class CameraPredict: method __init__ (line 17) | def __init__(self, device, submodules_list, factor=0.25): method infer (line 30) | def infer(self, video_path, save_video=False, save_dir="./saved_videos"): method transform_class (line 46) | def transform_class(self, vector, min_reso): # 768*0.05 method get_edge_point (line 62) | def get_edge_point(self, track): method get_edge_direction (line 71) | def get_edge_direction(self, track1, track2): method classify_top_down (line 84) | def classify_top_down(self, top, down): method classify_left_right (line 100) | def classify_left_right(self, left, right): method camera_classify (line 115) | def camera_classify(self, track1, track2): method predict (line 130) | def predict(self, video_path): function compute_camera_motion (line 138) | def compute_camera_motion(device, submodules_dict, video_paths, factor): FILE: Open-Sora/build/lib/tools/caption/camera_motion/detect.py function process (line 11) | def process(paths: List[str], threshold: float) -> List[str]: function main (line 18) | def main(args): FILE: Open-Sora/build/lib/tools/caption/camera_motion/utils.py function get_frame_indices (line 7) | def get_frame_indices(num_frames, vlen, sample="rand", fix_start=None, i... function load_video (line 48) | def load_video(video_path, data_transform=None, num_frames=None, return_... FILE: Open-Sora/build/lib/tools/caption/camera_motion/visualizer.py function read_video_from_path (line 17) | def read_video_from_path(path): function draw_circle (line 29) | def draw_circle(rgb, coord, radius, color=(255, 0, 0), visible=True): function draw_line (line 44) | def draw_line(rgb, coord_y, coord_x, color, linewidth): function add_weighted (line 54) | def add_weighted(rgb, alpha, original, beta, gamma): class Visualizer (line 58) | class Visualizer: method __init__ (line 59) | def __init__( method visualize (line 83) | def visualize( method save_video (line 133) | def save_video(self, video, filename, writer=None, step=0): method draw_tracks_on_video (line 160) | def draw_tracks_on_video( method _draw_pred_tracks (line 277) | def _draw_pred_tracks( method _draw_gt_tracks (line 306) | def _draw_gt_tracks( FILE: Open-Sora/build/lib/tools/caption/camera_motion_detect.py function apply (line 13) | def apply(df, func, **kwargs): function make_empty (line 28) | def make_empty(new_w, new_h): function get_type (line 40) | def get_type(mag, ang, zoom_in, tau_static=1.0, tau_zoom=(0.4, 0.6)): function get_video_type (line 58) | def get_video_type(frame_types): function process (line 79) | def process(path: str, frame_interval=15) -> str: function main (line 117) | def main(args): FILE: Open-Sora/build/lib/tools/caption/caption_gpt4.py function to_base64 (line 13) | def to_base64(image): function get_caption (line 19) | def get_caption(frame, prompt, api_key): function main (line 45) | def main(args): FILE: Open-Sora/build/lib/tools/caption/caption_llama3.py class CSVTextDataset (line 22) | class CSVTextDataset(Dataset): method __init__ (line 23) | def __init__(self, csv_path): method __len__ (line 28) | def __len__(self): method __getitem__ (line 31) | def __getitem__(self, idx): method set_rank_and_world_size (line 36) | def set_rank_and_world_size(self, rank, world_size): method write_to_csv (line 44) | def write_to_csv(self, output_file, data, new_key): function pad_left (line 56) | def pad_left(sequences, padding_value=0): function main (line 75) | def main(args): FILE: Open-Sora/build/lib/tools/caption/caption_llava.py class NoPaddingDistributedSampler (line 27) | class NoPaddingDistributedSampler(DistributedSampler): method __init__ (line 28) | def __init__(self, dataset, num_replicas=None, rank=None, shuffle=True... method __iter__ (line 41) | def __iter__(self): function main (line 60) | def main(args): FILE: Open-Sora/build/lib/tools/caption/utils.py function read_file (line 59) | def read_file(input_path): class VideoTextDataset (line 68) | class VideoTextDataset(torch.utils.data.Dataset): method __init__ (line 69) | def __init__(self, csv_path, transform=None, num_frames=3, get_text_in... method getitem (line 81) | def getitem(self, index): method __len__ (line 114) | def __len__(self): method __getitem__ (line 117) | def __getitem__(self, index): function collate_fn (line 121) | def collate_fn(batch): class Timer (line 130) | class Timer: method __init__ (line 131) | def __init__(self): method __enter__ (line 136) | def __enter__(self): method __exit__ (line 140) | def __exit__(self, exc_type, exc_value, exc_tb): FILE: Open-Sora/build/lib/tools/datasets/analyze.py function read_file (line 8) | def read_file(input_path): function parse_args (line 17) | def parse_args(): function plot_data (line 24) | def plot_data(data, column, bins, name): function plot_categorical_data (line 32) | def plot_categorical_data(data, column, name): function main (line 51) | def main(args): FILE: Open-Sora/build/lib/tools/datasets/convert.py function scan_recursively (line 12) | def scan_recursively(root): function get_filelist (line 24) | def get_filelist(file_path, exts=None): function split_by_capital (line 48) | def split_by_capital(name): function process_imagenet (line 58) | def process_imagenet(root, split): function process_ucf101 (line 69) | def process_ucf101(root, split): function process_vidprom (line 82) | def process_vidprom(root, info): function process_general_images (line 95) | def process_general_images(root, output): function process_general_videos (line 108) | def process_general_videos(root, output): FILE: Open-Sora/build/lib/tools/datasets/datautil.py function apply (line 30) | def apply(df, func, **kwargs): function get_video_length (line 43) | def get_video_length(cap, method="header"): function get_info_old (line 53) | def get_info_old(path): function get_info (line 77) | def get_info(path): function get_image_info (line 88) | def get_image_info(path, backend="pillow"): function get_video_info (line 117) | def get_video_info(path, backend="torchvision"): function remove_caption_prefix (line 174) | def remove_caption_prefix(caption): function merge_cmotion (line 215) | def merge_cmotion(caption, cmotion): function build_lang_detector (line 228) | def build_lang_detector(lang_to_detect): function basic_clean (line 251) | def basic_clean(text): function clean_caption (line 264) | def clean_caption(caption): function text_preprocessing (line 382) | def text_preprocessing(text, use_text_preprocessing: bool = True): function load_caption (line 397) | def load_caption(path, ext): function score_to_text (line 416) | def score_to_text(data): function read_file (line 440) | def read_file(input_path): function save_file (line 449) | def save_file(data, output_path): function read_data (line 461) | def read_data(input_paths): function main (line 490) | def main(args): function parse_args (line 685) | def parse_args(): function get_output_path (line 769) | def get_output_path(args, input_name): FILE: Open-Sora/build/lib/tools/datasets/filter_panda10m.py function apply (line 22) | def apply(df, func, **kwargs): function basic_clean (line 28) | def basic_clean(text): function clean_caption (line 41) | def clean_caption(caption): function get_10m_set (line 159) | def get_10m_set(): function filter_panda10m_text (line 191) | def filter_panda10m_text(meta_path, text_set): function filter_panda10m_timestamp (line 212) | def filter_panda10m_timestamp(meta_path): function parse_args (line 248) | def parse_args(): FILE: Open-Sora/build/lib/tools/datasets/split.py function split_by_bucket (line 10) | def split_by_bucket( FILE: Open-Sora/build/lib/tools/datasets/transform.py function apply (line 23) | def apply(df, func, **kwargs): function get_new_path (line 29) | def get_new_path(path, input_dir, output): function resize (line 35) | def resize(path, length, input_dir, output): function rand_crop (line 56) | def rand_crop(path, input_dir, output): function main (line 79) | def main(args): function parse_args (line 104) | def parse_args(): FILE: Open-Sora/build/lib/tools/datasets/utils.py function is_video (line 11) | def is_video(filename): function extract_frames (line 16) | def extract_frames( FILE: Open-Sora/build/lib/tools/frame_interpolation/interpolation.py function init (line 29) | def init(): function get_input_video_from_path (line 50) | def get_input_video_from_path(input_path): function load_model (line 93) | def load_model(ckpt): function interpolater (line 105) | def interpolater(model, inputs, scale, padder, iters=1): function write (line 136) | def write(outputs, input_path, output_path, fps=30): function process (line 162) | def process( function parse_args (line 174) | def parse_args(): FILE: Open-Sora/build/lib/tools/frame_interpolation/networks/amt_g.py class Model (line 10) | class Model(nn.Module): method __init__ (line 11) | def __init__(self, corr_radius=3, corr_lvls=4, num_flows=5, channels=[... method _get_updateblock (line 37) | def _get_updateblock(self, cdim, scale_factor=None): method _corr_scale_lookup (line 50) | def _corr_scale_lookup(self, corr_fn, coord, flow0, flow1, embt, downs... method forward (line 65) | def forward(self, img0, img1, embt, scale_factor=1.0, eval=False, **kw... FILE: Open-Sora/build/lib/tools/frame_interpolation/networks/blocks/feat_enc.py class BottleneckBlock (line 5) | class BottleneckBlock(nn.Module): method __init__ (line 6) | def __init__(self, in_planes, planes, norm_fn="group", stride=1): method forward (line 50) | def forward(self, x): class ResidualBlock (line 62) | class ResidualBlock(nn.Module): method __init__ (line 63) | def __init__(self, in_planes, planes, norm_fn="group", stride=1): method forward (line 102) | def forward(self, x): class SmallEncoder (line 113) | class SmallEncoder(nn.Module): method __init__ (line 114) | def __init__(self, output_dim=128, norm_fn="batch", dropout=0.0): method _make_layer (line 153) | def _make_layer(self, dim, stride=1): method forward (line 161) | def forward(self, x): class BasicEncoder (line 186) | class BasicEncoder(nn.Module): method __init__ (line 187) | def __init__(self, output_dim=128, norm_fn="batch", dropout=0.0): method _make_layer (line 227) | def _make_layer(self, dim, stride=1): method forward (line 235) | def forward(self, x): class LargeEncoder (line 261) | class LargeEncoder(nn.Module): method __init__ (line 262) | def __init__(self, output_dim=128, norm_fn="batch", dropout=0.0): method _make_layer (line 303) | def _make_layer(self, dim, stride=1): method forward (line 311) | def forward(self, x): FILE: Open-Sora/build/lib/tools/frame_interpolation/networks/blocks/ifrnet.py function resize (line 8) | def resize(x, scale_factor): function convrelu (line 12) | def convrelu(in_channels, out_channels, kernel_size=3, stride=1, padding... class ResBlock (line 19) | class ResBlock(nn.Module): method __init__ (line 20) | def __init__(self, in_channels, side_channels, bias=True): method forward (line 40) | def forward(self, x): class Encoder (line 57) | class Encoder(nn.Module): method __init__ (line 58) | def __init__(self, channels, large=False): method forward (line 70) | def forward(self, in_x): class InitDecoder (line 79) | class InitDecoder(nn.Module): method __init__ (line 80) | def __init__(self, in_ch, out_ch, skip_ch) -> None: method forward (line 88) | def forward(self, f0, f1, embt): class IntermediateDecoder (line 97) | class IntermediateDecoder(nn.Module): method __init__ (line 98) | def __init__(self, in_ch, out_ch, skip_ch) -> None: method forward (line 106) | def forward(self, ft_, f0, f1, flow0_in, flow1_in): FILE: Open-Sora/build/lib/tools/frame_interpolation/networks/blocks/multi_flow.py function multi_flow_combine (line 9) | def multi_flow_combine(comb_block, img0, img1, flow0, flow1, mask=None, ... class MultiFlowDecoder (line 41) | class MultiFlowDecoder(nn.Module): method __init__ (line 42) | def __init__(self, in_ch, skip_ch, num_flows=3): method forward (line 51) | def forward(self, ft_, f0, f1, flow0, flow1): FILE: Open-Sora/build/lib/tools/frame_interpolation/networks/blocks/raft.py function resize (line 6) | def resize(x, scale_factor): function bilinear_sampler (line 10) | def bilinear_sampler(img, coords, mask=False): function coords_grid (line 27) | def coords_grid(batch, ht, wd, device): class SmallUpdateBlock (line 33) | class SmallUpdateBlock(nn.Module): method __init__ (line 34) | def __init__(self, cdim, hidden_dim, flow_dim, corr_dim, fc_dim, corr_... method forward (line 64) | def forward(self, net, flow, corr): class BasicUpdateBlock (line 84) | class BasicUpdateBlock(nn.Module): method __init__ (line 85) | def __init__( method forward (line 128) | def forward(self, net, flow, corr): class BidirCorrBlock (line 148) | class BidirCorrBlock: method __init__ (line 149) | def __init__(self, fmap1, fmap2, num_levels=4, radius=4): method __call__ (line 171) | def __call__(self, coords0, coords1): method corr (line 206) | def corr(fmap1, fmap2): FILE: Open-Sora/build/lib/tools/frame_interpolation/utils/dist_utils.py function get_world_size (line 6) | def get_world_size(): function get_global_rank (line 18) | def get_global_rank(): function get_local_rank (line 30) | def get_local_rank(): function get_master_ip (line 42) | def get_master_ip(): FILE: Open-Sora/build/lib/tools/frame_interpolation/utils/flow_utils.py function warp (line 9) | def warp(img, flow): function make_colorwheel (line 20) | def make_colorwheel(): function flow_uv_to_colors (line 68) | def flow_uv_to_colors(u, v, convert_to_bgr=False): function flow_to_image (line 104) | def flow_to_image(flow_uv, clip_flow=None, convert_to_bgr=False): FILE: Open-Sora/build/lib/tools/frame_interpolation/utils/utils.py class AverageMeter (line 14) | class AverageMeter: method __init__ (line 15) | def __init__(self): method reset (line 18) | def reset(self): method update (line 24) | def update(self, val, n=1): class AverageMeterGroups (line 31) | class AverageMeterGroups: method __init__ (line 32) | def __init__(self) -> None: method update (line 35) | def update(self, dict, n=1): method reset (line 41) | def reset(self, name=None): method avg (line 50) | def avg(self, name): class InputPadder (line 56) | class InputPadder: method __init__ (line 59) | def __init__(self, dims, divisor=16): method pad (line 65) | def pad(self, *inputs): method unpad (line 71) | def unpad(self, *inputs): method _unpad (line 77) | def _unpad(self, x): function img2tensor (line 83) | def img2tensor(img): function tensor2img (line 89) | def tensor2img(img_t): function seed_all (line 93) | def seed_all(seed): function read (line 100) | def read(file): function write (line 119) | def write(file, data): function readPFM (line 138) | def readPFM(file): function writePFM (line 176) | def writePFM(file, image, scale=1): function readFlow (line 206) | def readFlow(name): function readImage (line 224) | def readImage(name): function writeImage (line 234) | def writeImage(name, data): function writeFlow (line 240) | def writeFlow(name, flow): function readFloat (line 248) | def readFloat(name): function writeFloat (line 273) | def writeFloat(name, data): function check_dim_and_resize (line 299) | def check_dim_and_resize(tensor_list): FILE: Open-Sora/build/lib/tools/scene_cut/convert_id_to_path.py function is_intact_video (line 17) | def is_intact_video(video_path, mode="moviepy", verbose=False, logger=No... function has_downloaded_success (line 50) | def has_downloaded_success(json_path): function parse_args (line 65) | def parse_args(): function main (line 76) | def main(): FILE: Open-Sora/build/lib/tools/scene_cut/cut.py function print_log (line 17) | def print_log(s, logger=None): function process_single_row (line 24) | def process_single_row(row, args): function split_video (line 71) | def split_video( function parse_args (line 157) | def parse_args(): function main (line 178) | def main(): FILE: Open-Sora/build/lib/tools/scene_cut/scene_detect.py function process_single_row (line 13) | def process_single_row(row): function parse_args (line 34) | def parse_args(): function main (line 43) | def main(): FILE: Open-Sora/build/lib/tools/scoring/aesthetic/inference.py function merge_scores (line 30) | def merge_scores(gathered_list: list, meta: pd.DataFrame, column): class VideoTextDataset (line 53) | class VideoTextDataset(torch.utils.data.Dataset): method __init__ (line 54) | def __init__(self, meta_path, transform=None, num_frames=3): method __getitem__ (line 60) | def __getitem__(self, index): method __len__ (line 80) | def __len__(self): class MLP (line 84) | class MLP(nn.Module): method __init__ (line 85) | def __init__(self, input_size): method forward (line 99) | def forward(self, x): class AestheticScorer (line 103) | class AestheticScorer(nn.Module): method __init__ (line 104) | def __init__(self, input_size, device): method forward (line 112) | def forward(self, x): function parse_args (line 118) | def parse_args(): function main (line 131) | def main(): FILE: Open-Sora/build/lib/tools/scoring/matching/inference.py function merge_scores (line 18) | def merge_scores(gathered_list: list, meta: pd.DataFrame, column): class VideoTextDataset (line 38) | class VideoTextDataset(torch.utils.data.Dataset): method __init__ (line 39) | def __init__(self, meta_path, transform): method __getitem__ (line 44) | def __getitem__(self, index): method __len__ (line 60) | def __len__(self): function parse_args (line 64) | def parse_args(): function main (line 74) | def main(): FILE: Open-Sora/build/lib/vbench/__init__.py class VBench (line 8) | class VBench(object): method __init__ (line 9) | def __init__(self, device, full_info_dir, output_path): method build_full_dimension_list (line 16) | def build_full_dimension_list(self, ): method check_dimension_requires_extra_info (line 19) | def check_dimension_requires_extra_info(self, dimension_list): method build_full_info_json (line 26) | def build_full_info_json(self, videos_path, name, dimension_list, prom... method evaluate (line 134) | def evaluate(self, videos_path, name, prompt_list=[], dimension_list=N... FILE: Open-Sora/build/lib/vbench/aesthetic_quality.py function get_aesthetic_model (line 12) | def get_aesthetic_model(cache_folder): function laion_aesthetic (line 36) | def laion_aesthetic(aesthetic_model, clip_model, video_list, device): function compute_aesthetic_quality (line 59) | def compute_aesthetic_quality(json_dir, device, submodules_list, **kwargs): FILE: Open-Sora/build/lib/vbench/appearance_style.py function get_text_features (line 11) | def get_text_features(model, input_text, tokenizer, text_feature_dict={}): function get_vid_features (line 21) | def get_vid_features(model, input_frames): function get_predict_label (line 27) | def get_predict_label(clip_feature, text_feats_tensor, top=5): function appearance_style (line 32) | def appearance_style(clip_model, video_dict, device, sample="rand"): function compute_appearance_style (line 62) | def compute_appearance_style(json_dir, device, submodules_list, **kwargs): FILE: Open-Sora/build/lib/vbench/background_consistency.py function background_consistency (line 14) | def background_consistency(clip_model, preprocess, video_list, device, r... function compute_background_consistency (line 53) | def compute_background_consistency(json_dir, device, submodules_list, **... FILE: Open-Sora/build/lib/vbench/cli/evaluate.py function register_subparsers (line 9) | def register_subparsers(subparser): function evaluate (line 108) | def evaluate(args): FILE: Open-Sora/build/lib/vbench/cli/static_filter.py class StaticFilter (line 24) | class StaticFilter: method __init__ (line 25) | def __init__(self, args, device): method load_model (line 31) | def load_model(self): method get_score (line 40) | def get_score(self, img, flo): method check_static (line 57) | def check_static(self, score_list): method set_params (line 72) | def set_params(self, frame, count): method infer (line 77) | def infer(self, path): method get_frames (line 92) | def get_frames(self, video_path): function check_and_move (line 108) | def check_and_move(args, filter_results, target_path=None): function static_filter (line 120) | def static_filter(args): function register_subparsers (line 164) | def register_subparsers(subparser): FILE: Open-Sora/build/lib/vbench/cli/vbench.py function main (line 7) | def main(): function help (line 18) | def help(args): FILE: Open-Sora/build/lib/vbench/color.py function get_dect_from_grit (line 14) | def get_dect_from_grit(model, image_arrays): function check_generate (line 30) | def check_generate(color_key, object_key, predictions): function color (line 47) | def color(model, video_dict, device): function compute_color (line 70) | def compute_color(json_dir, device, submodules_dict, **kwargs): FILE: Open-Sora/build/lib/vbench/dynamic_degree.py class DynamicDegree (line 15) | class DynamicDegree: method __init__ (line 16) | def __init__(self, args, device): method load_model (line 22) | def load_model(self): method get_score (line 32) | def get_score(self, img, flo): method set_params (line 49) | def set_params(self, frame, count): method infer (line 54) | def infer(self, video_path): method check_move (line 74) | def check_move(self, score_list): method get_frames (line 86) | def get_frames(self, video_path): method extract_frame (line 106) | def extract_frame(self, frame_list, interval=1): method get_frames_from_img_folder (line 113) | def get_frames_from_img_folder(self, img_folder): function dynamic_degree (line 131) | def dynamic_degree(dynamic, video_list): function compute_dynamic_degree (line 143) | def compute_dynamic_degree(json_dir, device, submodules_list, **kwargs): FILE: Open-Sora/build/lib/vbench/human_action.py function build_dict (line 21) | def build_dict(): function human_action (line 34) | def human_action(umt_path, video_list, device): function compute_human_action (line 98) | def compute_human_action(json_dir, device, submodules_list, **kwargs): FILE: Open-Sora/build/lib/vbench/imaging_quality.py function transform (line 7) | def transform(images, preprocess_mode='shorter'): function technical_quality (line 29) | def technical_quality(model, video_list, device, **kwargs): function compute_imaging_quality (line 46) | def compute_imaging_quality(json_dir, device, submodules_list, **kwargs): FILE: Open-Sora/build/lib/vbench/motion_smoothness.py class FrameProcess (line 19) | class FrameProcess: method __init__ (line 20) | def __init__(self): method get_frames (line 24) | def get_frames(self, video_path): method get_frames_from_img_folder (line 39) | def get_frames_from_img_folder(self, img_folder): method extract_frame (line 54) | def extract_frame(self, frame_list, start_from=0): class MotionSmoothness (line 61) | class MotionSmoothness: method __init__ (line 62) | def __init__(self, config, ckpt, device): method load_model (line 71) | def load_model(self): method initialization (line 84) | def initialization(self): method motion_score (line 102) | def motion_score(self, video_path): method vfi_score (line 147) | def vfi_score(self, ori_frames, interpolate_frames): method get_diff (line 156) | def get_diff(self, img1, img2): function motion_smoothness (line 162) | def motion_smoothness(motion, video_list): function compute_motion_smoothness (line 174) | def compute_motion_smoothness(json_dir, device, submodules_list, **kwargs): FILE: Open-Sora/build/lib/vbench/multiple_objects.py function get_dect_from_grit (line 14) | def get_dect_from_grit(model, image_arrays): function check_generate (line 27) | def check_generate(key_info, predictions): function multiple_objects (line 37) | def multiple_objects(model, video_dict, device): function compute_multiple_objects (line 56) | def compute_multiple_objects(json_dir, device, submodules_dict, **kwargs): FILE: Open-Sora/build/lib/vbench/object_class.py function get_dect_from_grit (line 14) | def get_dect_from_grit(model, image_arrays): function check_generate (line 26) | def check_generate(key_info, predictions): function object_class (line 33) | def object_class(model, video_dict, device): function compute_object_class (line 52) | def compute_object_class(json_dir, device, submodules_dict, **kwargs): FILE: Open-Sora/build/lib/vbench/overall_consistency.py function get_text_features (line 12) | def get_text_features(model, input_text, tokenizer, text_feature_dict={}): function get_vid_features (line 22) | def get_vid_features(model, input_frames): function get_predict_label (line 28) | def get_predict_label(clip_feature, text_feats_tensor, top=5): function overall_consistency (line 33) | def overall_consistency(clip_model, video_dict, tokenizer, device, sampl... function compute_overall_consistency (line 56) | def compute_overall_consistency(json_dir, device, submodules_list, **kwa... FILE: Open-Sora/build/lib/vbench/scene.py function get_caption (line 14) | def get_caption(model, image_arrays): function check_generate (line 18) | def check_generate(key_info, predictions): function scene (line 27) | def scene(model, video_dict, device): function compute_scene (line 51) | def compute_scene(json_dir, device, submodules_dict, **kwargs): FILE: Open-Sora/build/lib/vbench/spatial_relationship.py function get_position_score (line 14) | def get_position_score(locality, obj1,obj2, iou_threshold=0.1): function get_dect_from_grit (line 73) | def get_dect_from_grit(model, image_arrays): function check_generate (line 87) | def check_generate(key_info, predictions): function spatial_relationship (line 106) | def spatial_relationship(model, video_dict, device): function compute_spatial_relationship (line 124) | def compute_spatial_relationship(json_dir, device, submodules_dict, **kw... FILE: Open-Sora/build/lib/vbench/subject_consistency.py function subject_consistency (line 19) | def subject_consistency(model, video_list, device, read_frame): function compute_subject_consistency (line 60) | def compute_subject_consistency(json_dir, device, submodules_list, **kwa... FILE: Open-Sora/build/lib/vbench/temporal_flickering.py function get_frames (line 7) | def get_frames(video_path): function mae_seq (line 21) | def mae_seq(frames): function calculate_mae (line 28) | def calculate_mae(img1, img2): function cal_score (line 36) | def cal_score(video_path): function temporal_flickering (line 43) | def temporal_flickering(video_list): function compute_temporal_flickering (line 57) | def compute_temporal_flickering(json_dir, device, submodules_list, **kwa... FILE: Open-Sora/build/lib/vbench/temporal_style.py function get_text_features (line 12) | def get_text_features(model, input_text, tokenizer, text_feature_dict={}): function get_vid_features (line 22) | def get_vid_features(model, input_frames): function get_predict_label (line 28) | def get_predict_label(clip_feature, text_feats_tensor, top=5): function temporal_style (line 33) | def temporal_style(clip_model, video_dict, tokenizer, device, sample="mi... function compute_temporal_style (line 57) | def compute_temporal_style(json_dir, device, submodules_list, **kwargs): FILE: Open-Sora/build/lib/vbench/third_pary/RAFT/core/corr.py class CorrBlock (line 12) | class CorrBlock: method __init__ (line 13) | def __init__(self, fmap1, fmap2, num_levels=4, radius=4): method __call__ (line 29) | def __call__(self, coords): method corr (line 53) | def corr(fmap1, fmap2): class AlternateCorrBlock (line 63) | class AlternateCorrBlock: method __init__ (line 64) | def __init__(self, fmap1, fmap2, num_levels=4, radius=4): method __call__ (line 74) | def __call__(self, coords): FILE: Open-Sora/build/lib/vbench/third_pary/RAFT/core/datasets.py class FlowDataset (line 18) | class FlowDataset(data.Dataset): method __init__ (line 19) | def __init__(self, aug_params=None, sparse=False): method __getitem__ (line 34) | def __getitem__(self, index): method __rmul__ (line 93) | def __rmul__(self, v): method __len__ (line 98) | def __len__(self): class MpiSintel (line 102) | class MpiSintel(FlowDataset): method __init__ (line 103) | def __init__(self, aug_params=None, split='training', root='datasets/S... class FlyingChairs (line 121) | class FlyingChairs(FlowDataset): method __init__ (line 122) | def __init__(self, aug_params=None, split='train', root='datasets/Flyi... class FlyingThings3D (line 137) | class FlyingThings3D(FlowDataset): method __init__ (line 138) | def __init__(self, aug_params=None, root='datasets/FlyingThings3D', ds... class KITTI (line 161) | class KITTI(FlowDataset): method __init__ (line 162) | def __init__(self, aug_params=None, split='training', root='datasets/K... class HD1K (line 180) | class HD1K(FlowDataset): method __init__ (line 181) | def __init__(self, aug_params=None, root='datasets/HD1k'): function fetch_dataloader (line 199) | def fetch_dataloader(args, TRAIN_DS='C+T+K+S+H'): FILE: Open-Sora/build/lib/vbench/third_pary/RAFT/core/extractor.py class ResidualBlock (line 6) | class ResidualBlock(nn.Module): method __init__ (line 7) | def __init__(self, in_planes, planes, norm_fn='group', stride=1): method forward (line 48) | def forward(self, x): class BottleneckBlock (line 60) | class BottleneckBlock(nn.Module): method __init__ (line 61) | def __init__(self, in_planes, planes, norm_fn='group', stride=1): method forward (line 107) | def forward(self, x): class BasicEncoder (line 118) | class BasicEncoder(nn.Module): method __init__ (line 119) | def __init__(self, output_dim=128, norm_fn='batch', dropout=0.0): method _make_layer (line 159) | def _make_layer(self, dim, stride=1): method forward (line 168) | def forward(self, x): class SmallEncoder (line 195) | class SmallEncoder(nn.Module): method __init__ (line 196) | def __init__(self, output_dim=128, norm_fn='batch', dropout=0.0): method _make_layer (line 235) | def _make_layer(self, dim, stride=1): method forward (line 244) | def forward(self, x): FILE: Open-Sora/build/lib/vbench/third_pary/RAFT/core/raft.py class autocast (line 15) | class autocast: method __init__ (line 16) | def __init__(self, enabled): method __enter__ (line 18) | def __enter__(self): method __exit__ (line 20) | def __exit__(self, *args): class RAFT (line 24) | class RAFT(nn.Module): method __init__ (line 25) | def __init__(self, args): method freeze_bn (line 58) | def freeze_bn(self): method initialize_flow (line 63) | def initialize_flow(self, img): method upsample_flow (line 72) | def upsample_flow(self, flow, mask): method forward (line 86) | def forward(self, image1, image2, iters=12, flow_init=None, upsample=T... FILE: Open-Sora/build/lib/vbench/third_pary/RAFT/core/update.py class FlowHead (line 6) | class FlowHead(nn.Module): method __init__ (line 7) | def __init__(self, input_dim=128, hidden_dim=256): method forward (line 13) | def forward(self, x): class ConvGRU (line 16) | class ConvGRU(nn.Module): method __init__ (line 17) | def __init__(self, hidden_dim=128, input_dim=192+128): method forward (line 23) | def forward(self, h, x): class SepConvGRU (line 33) | class SepConvGRU(nn.Module): method __init__ (line 34) | def __init__(self, hidden_dim=128, input_dim=192+128): method forward (line 45) | def forward(self, h, x): class SmallMotionEncoder (line 62) | class SmallMotionEncoder(nn.Module): method __init__ (line 63) | def __init__(self, args): method forward (line 71) | def forward(self, flow, corr): class BasicMotionEncoder (line 79) | class BasicMotionEncoder(nn.Module): method __init__ (line 80) | def __init__(self, args): method forward (line 89) | def forward(self, flow, corr): class SmallUpdateBlock (line 99) | class SmallUpdateBlock(nn.Module): method __init__ (line 100) | def __init__(self, args, hidden_dim=96): method forward (line 106) | def forward(self, net, inp, corr, flow): class BasicUpdateBlock (line 114) | class BasicUpdateBlock(nn.Module): method __init__ (line 115) | def __init__(self, args, hidden_dim=128, input_dim=128): method forward (line 127) | def forward(self, net, inp, corr, flow, upsample=True): FILE: Open-Sora/build/lib/vbench/third_pary/RAFT/core/utils_core/augmentor.py class FlowAugmentor (line 15) | class FlowAugmentor: method __init__ (line 16) | def __init__(self, crop_size, min_scale=-0.2, max_scale=0.5, do_flip=T... method color_transform (line 36) | def color_transform(self, img1, img2): method eraser_transform (line 52) | def eraser_transform(self, img1, img2, bounds=[50, 100]): method spatial_transform (line 67) | def spatial_transform(self, img1, img2, flow): method __call__ (line 111) | def __call__(self, img1, img2, flow): class SparseFlowAugmentor (line 122) | class SparseFlowAugmentor: method __init__ (line 123) | def __init__(self, crop_size, min_scale=-0.2, max_scale=0.5, do_flip=F... method color_transform (line 142) | def color_transform(self, img1, img2): method eraser_transform (line 148) | def eraser_transform(self, img1, img2): method resize_sparse_flow_map (line 161) | def resize_sparse_flow_map(self, flow, valid, fx=1.0, fy=1.0): method spatial_transform (line 195) | def spatial_transform(self, img1, img2, flow, valid): method __call__ (line 236) | def __call__(self, img1, img2, flow, valid): FILE: Open-Sora/build/lib/vbench/third_pary/RAFT/core/utils_core/flow_viz.py function make_colorwheel (line 20) | def make_colorwheel(): function flow_uv_to_colors (line 70) | def flow_uv_to_colors(u, v, convert_to_bgr=False): function flow_to_image (line 109) | def flow_to_image(flow_uv, clip_flow=None, convert_to_bgr=False): FILE: Open-Sora/build/lib/vbench/third_pary/RAFT/core/utils_core/frame_utils.py function readFlow (line 12) | def readFlow(fn): function readPFM (line 33) | def readPFM(file): function writeFlow (line 70) | def writeFlow(filename,uv,v=None): function readFlowKITTI (line 102) | def readFlowKITTI(filename): function readDispKITTI (line 109) | def readDispKITTI(filename): function writeFlowKITTI (line 116) | def writeFlowKITTI(filename, uv): function read_gen (line 123) | def read_gen(file_name, pil=False): FILE: Open-Sora/build/lib/vbench/third_pary/RAFT/core/utils_core/utils.py class InputPadder (line 7) | class InputPadder: method __init__ (line 9) | def __init__(self, dims, mode='sintel'): method pad (line 18) | def pad(self, *inputs): method unpad (line 21) | def unpad(self,x): function forward_interpolate (line 26) | def forward_interpolate(flow): function bilinear_sampler (line 57) | def bilinear_sampler(img, coords, mode='bilinear', mask=False): function coords_grid (line 74) | def coords_grid(batch, ht, wd, device): function upflow8 (line 80) | def upflow8(flow, mode='bilinear'): FILE: Open-Sora/build/lib/vbench/third_pary/ViCLIP/simple_tokenizer.py function default_bpe (line 10) | def default_bpe(): function bytes_to_unicode (line 20) | def bytes_to_unicode(): function get_pairs (line 42) | def get_pairs(word): function basic_clean (line 54) | def basic_clean(text): function whitespace_clean (line 60) | def whitespace_clean(text): class SimpleTokenizer (line 66) | class SimpleTokenizer(object): method __init__ (line 67) | def __init__(self, bpe_path: str = default_bpe()): method bpe (line 84) | def bpe(self, token): method encode (line 125) | def encode(self, text): method decode (line 133) | def decode(self, tokens): FILE: Open-Sora/build/lib/vbench/third_pary/ViCLIP/viclip.py class ViCLIP (line 16) | class ViCLIP(nn.Module): method __init__ (line 19) | def __init__(self, tokenizer=None, pretrain=os.path.join(os.path.dirn... method freeze_text (line 67) | def freeze_text(self): method no_weight_decay (line 72) | def no_weight_decay(self): method forward (line 83) | def forward(self, image, text, raw_text, idx, log_generation=None, ret... method encode_vision (line 114) | def encode_vision(self, image, test=False): method encode_text (line 138) | def encode_text(self, text): method clip_contrastive_temperature (line 158) | def clip_contrastive_temperature(self, min_val=0.001, max_val=0.5): method build_vision_encoder (line 162) | def build_vision_encoder(self): method build_text_encoder (line 181) | def build_text_encoder(self): method get_text_encoder (line 199) | def get_text_encoder(self): method get_text_features (line 204) | def get_text_features(self, input_text, tokenizer, text_feature_dict={}): method get_vid_features (line 215) | def get_vid_features(self, input_frames): method get_predict_label (line 221) | def get_predict_label(self, clip_feature, text_feats_tensor, top=5): FILE: Open-Sora/build/lib/vbench/third_pary/ViCLIP/viclip_text.py class LayerNorm (line 23) | class LayerNorm(nn.LayerNorm): method forward (line 26) | def forward(self, x: torch.Tensor): class QuickGELU (line 32) | class QuickGELU(nn.Module): method forward (line 33) | def forward(self, x: torch.Tensor): class ResidualAttentionBlock (line 37) | class ResidualAttentionBlock(nn.Module): method __init__ (line 38) | def __init__(self, d_model: int, n_head: int, attn_mask: torch.Tensor ... method attention (line 51) | def attention(self, x: torch.Tensor): method forward (line 55) | def forward(self, x: torch.Tensor): class Transformer (line 61) | class Transformer(nn.Module): method __init__ (line 62) | def __init__(self, width: int, layers: int, heads: int, attn_mask: tor... method forward (line 71) | def forward(self, x: torch.Tensor): class CLIP_TEXT (line 79) | class CLIP_TEXT(nn.Module): method __init__ (line 80) | def __init__( method no_weight_decay (line 110) | def no_weight_decay(self): method build_attention_mask (line 114) | def build_attention_mask(self): method tokenize (line 122) | def tokenize(self, texts, context_length=77, truncate=True): method forward (line 160) | def forward(self, text): function clip_text_b16 (line 176) | def clip_text_b16( function clip_text_l14 (line 200) | def clip_text_l14( function clip_text_l14_336 (line 243) | def clip_text_l14_336( function build_clip (line 267) | def build_clip(config): FILE: Open-Sora/build/lib/vbench/third_pary/ViCLIP/viclip_vision.py function load_temp_embed_with_mismatch (line 16) | def load_temp_embed_with_mismatch(temp_embed_old, temp_embed_new, add_ze... class QuickGELU (line 49) | class QuickGELU(nn.Module): method forward (line 50) | def forward(self, x): class ResidualAttentionBlock (line 54) | class ResidualAttentionBlock(nn.Module): method __init__ (line 55) | def __init__(self, d_model, n_head, drop_path=0., attn_mask=None, drop... method attention (line 72) | def attention(self, x): method forward (line 76) | def forward(self, x): class Transformer (line 82) | class Transformer(nn.Module): method __init__ (line 83) | def __init__(self, width, layers, heads, drop_path=0., checkpoint_num=... method forward (line 91) | def forward(self, x): class VisionTransformer (line 100) | class VisionTransformer(nn.Module): method __init__ (line 101) | def __init__( method get_num_layers (line 134) | def get_num_layers(self): method no_weight_decay (line 138) | def no_weight_decay(self): method mask_tokens (line 141) | def mask_tokens(self, inputs, masking_prob=0.0): method forward (line 157) | def forward(self, x, masking_prob=0.0): function inflate_weight (line 197) | def inflate_weight(weight_2d, time_dim, center=True): function load_state_dict (line 210) | def load_state_dict(model, state_dict, input_resolution=224, patch_size=... function clip_joint_b16 (line 242) | def clip_joint_b16( function clip_joint_l14 (line 261) | def clip_joint_l14( function clip_joint_l14_336 (line 285) | def clip_joint_l14_336( function interpolate_pos_embed_vit (line 303) | def interpolate_pos_embed_vit(state_dict, new_model): FILE: Open-Sora/build/lib/vbench/third_pary/amt/benchmarks/snu_film.py function parse_path (line 16) | def parse_path(path): FILE: Open-Sora/build/lib/vbench/third_pary/amt/datasets/adobe_datasets.py class Adobe240_Dataset (line 19) | class Adobe240_Dataset(Dataset): method __init__ (line 20) | def __init__(self, dataset_dir='data/adobe240/test_frames', interFrame... method __getitem__ (line 36) | def __getitem__(self, idx): method __len__ (line 74) | def __len__(self): FILE: Open-Sora/build/lib/vbench/third_pary/amt/datasets/gopro_datasets.py function random_resize_woflow (line 14) | def random_resize_woflow(img0, imgt, img1, p=0.1): function random_crop_woflow (line 21) | def random_crop_woflow(img0, imgt, img1, crop_size=(224, 224)): function center_crop_woflow (line 31) | def center_crop_woflow(img0, imgt, img1, crop_size=(512, 512)): function random_reverse_channel_woflow (line 39) | def random_reverse_channel_woflow(img0, imgt, img1, p=0.5): function random_vertical_flip_woflow (line 46) | def random_vertical_flip_woflow(img0, imgt, img1, p=0.3): function random_horizontal_flip_woflow (line 53) | def random_horizontal_flip_woflow(img0, imgt, img1, p=0.5): function random_rotate_woflow (line 60) | def random_rotate_woflow(img0, imgt, img1, p=0.05): function random_reverse_time_woflow (line 67) | def random_reverse_time_woflow(img0, imgt, img1, embt, p=0.5): class GoPro_Train_Dataset (line 75) | class GoPro_Train_Dataset(Dataset): method __init__ (line 76) | def __init__(self, dataset_dir='data/GOPRO', interFrames=7, augment=Tr... method __len__ (line 98) | def __len__(self): method __getitem__ (line 101) | def __getitem__(self, idx): class GoPro_Test_Dataset (line 139) | class GoPro_Test_Dataset(Dataset): method __init__ (line 140) | def __init__(self, dataset_dir='data/GOPRO', interFrames=7): method __len__ (line 159) | def __len__(self): method __getitem__ (line 162) | def __getitem__(self, idx): FILE: Open-Sora/build/lib/vbench/third_pary/amt/datasets/vimeo_datasets.py function random_resize (line 13) | def random_resize(img0, imgt, img1, flow, p=0.1): function random_crop (line 21) | def random_crop(img0, imgt, img1, flow, crop_size=(224, 224)): function random_reverse_channel (line 32) | def random_reverse_channel(img0, imgt, img1, flow, p=0.5): function random_vertical_flip (line 39) | def random_vertical_flip(img0, imgt, img1, flow, p=0.3): function random_horizontal_flip (line 48) | def random_horizontal_flip(img0, imgt, img1, flow, p=0.5): function random_rotate (line 57) | def random_rotate(img0, imgt, img1, flow, p=0.05): function random_reverse_time (line 66) | def random_reverse_time(img0, imgt, img1, flow, p=0.5): class Vimeo90K_Train_Dataset (line 75) | class Vimeo90K_Train_Dataset(Dataset): method __init__ (line 76) | def __init__(self, method __len__ (line 102) | def __len__(self): method __getitem__ (line 105) | def __getitem__(self, idx): class Vimeo90K_Test_Dataset (line 132) | class Vimeo90K_Test_Dataset(Dataset): method __init__ (line 133) | def __init__(self, dataset_dir='data/vimeo_triplet'): method __len__ (line 151) | def __len__(self): method __getitem__ (line 154) | def __getitem__(self, idx): FILE: Open-Sora/build/lib/vbench/third_pary/amt/flow_generation/gen_flow.py function pred_flow (line 24) | def pred_flow(img1, img2): FILE: Open-Sora/build/lib/vbench/third_pary/amt/flow_generation/liteflownet/run.py function backwarp (line 43) | def backwarp(tenInput, tenFlow): class Network (line 58) | class Network(torch.nn.Module): method __init__ (line 59) | def __init__(self): method forward (line 301) | def forward(self, tenOne, tenTwo): function estimate (line 337) | def estimate(tenOne, tenTwo): FILE: Open-Sora/build/lib/vbench/third_pary/amt/losses/loss.py class Loss (line 7) | class Loss(nn.Module): method __init__ (line 8) | def __init__(self, loss_weight, keys, mapping=None) -> None: method forward (line 20) | def forward(self, **kwargs): method _forward (line 29) | def _forward(self, **kwargs): class CharbonnierLoss (line 33) | class CharbonnierLoss(Loss): method __init__ (line 34) | def __init__(self, loss_weight, keys) -> None: method _forward (line 37) | def _forward(self, imgt_pred, imgt): class AdaCharbonnierLoss (line 43) | class AdaCharbonnierLoss(Loss): method __init__ (line 44) | def __init__(self, loss_weight, keys) -> None: method _forward (line 47) | def _forward(self, imgt_pred, imgt, weight): class TernaryLoss (line 56) | class TernaryLoss(Loss): method __init__ (line 57) | def __init__(self, loss_weight, keys, patch_size=7): method transform (line 65) | def transform(self, tensor): method valid_mask (line 73) | def valid_mask(self, tensor): method _forward (line 80) | def _forward(self, imgt_pred, imgt): class GeometryLoss (line 90) | class GeometryLoss(Loss): method __init__ (line 91) | def __init__(self, loss_weight, keys, patch_size=3): method transform (line 99) | def transform(self, tensor): method valid_mask (line 109) | def valid_mask(self, tensor): method _forward (line 116) | def _forward(self, ft_pred, ft_gt): class IFRFlowLoss (line 128) | class IFRFlowLoss(Loss): method __init__ (line 129) | def __init__(self, loss_weight, keys, beta=0.3) -> None: method _forward (line 134) | def _forward(self, flow0_pred, flow1_pred, flow): method resize (line 153) | def resize(self, x, scale_factor): method get_robust_weight (line 156) | def get_robust_weight(self, flow_pred, flow_gt): class MultipleFlowLoss (line 162) | class MultipleFlowLoss(Loss): method __init__ (line 163) | def __init__(self, loss_weight, keys, beta=0.3) -> None: method _forward (line 168) | def _forward(self, flow0_pred, flow1_pred, flow): method resize (line 187) | def resize(self, x, scale_factor): method get_mutli_flow_robust_weight (line 190) | def get_mutli_flow_robust_weight(self, flow_pred, flow_gt): FILE: Open-Sora/build/lib/vbench/third_pary/amt/metrics/psnr_ssim.py function gaussian (line 7) | def gaussian(window_size, sigma): function create_window (line 12) | def create_window(window_size, channel=1): function create_window_3d (line 19) | def create_window_3d(window_size, channel=1): function ssim (line 27) | def ssim(img1, img2, window_size=11, window=None, size_average=True, ful... function calculate_ssim (line 78) | def calculate_ssim(img1, img2, window_size=11, window=None, size_average... function calculate_psnr (line 133) | def calculate_psnr(img1, img2): function calculate_ie (line 138) | def calculate_ie(img1, img2): FILE: Open-Sora/build/lib/vbench/third_pary/amt/networks/AMT-G.py class Model (line 23) | class Model(nn.Module): method __init__ (line 24) | def __init__(self, method _get_updateblock (line 55) | def _get_updateblock(self, cdim, scale_factor=None): method _corr_scale_lookup (line 61) | def _corr_scale_lookup(self, corr_fn, coord, flow0, flow1, embt, downs... method forward (line 76) | def forward(self, img0, img1, embt, scale_factor=1.0, eval=False, **kw... FILE: Open-Sora/build/lib/vbench/third_pary/amt/networks/AMT-L.py class Model (line 21) | class Model(nn.Module): method __init__ (line 22) | def __init__(self, method _get_updateblock (line 52) | def _get_updateblock(self, cdim, scale_factor=None): method _corr_scale_lookup (line 58) | def _corr_scale_lookup(self, corr_fn, coord, flow0, flow1, embt, downs... method forward (line 73) | def forward(self, img0, img1, embt, scale_factor=1.0, eval=False, **kw... FILE: Open-Sora/build/lib/vbench/third_pary/amt/networks/AMT-S.py class Model (line 22) | class Model(nn.Module): method __init__ (line 23) | def __init__(self, method _get_updateblock (line 54) | def _get_updateblock(self, cdim, scale_factor=None): method _corr_scale_lookup (line 59) | def _corr_scale_lookup(self, corr_fn, coord, flow0, flow1, embt, downs... method forward (line 74) | def forward(self, img0, img1, embt, scale_factor=1.0, eval=False, **kw... FILE: Open-Sora/build/lib/vbench/third_pary/amt/networks/blocks/feat_enc.py class BottleneckBlock (line 5) | class BottleneckBlock(nn.Module): method __init__ (line 6) | def __init__(self, in_planes, planes, norm_fn='group', stride=1): method forward (line 52) | def forward(self, x): class ResidualBlock (line 64) | class ResidualBlock(nn.Module): method __init__ (line 65) | def __init__(self, in_planes, planes, norm_fn='group', stride=1): method forward (line 106) | def forward(self, x): class SmallEncoder (line 117) | class SmallEncoder(nn.Module): method __init__ (line 118) | def __init__(self, output_dim=128, norm_fn='batch', dropout=0.0): method _make_layer (line 157) | def _make_layer(self, dim, stride=1): method forward (line 166) | def forward(self, x): class BasicEncoder (line 191) | class BasicEncoder(nn.Module): method __init__ (line 192) | def __init__(self, output_dim=128, norm_fn='batch', dropout=0.0): method _make_layer (line 232) | def _make_layer(self, dim, stride=1): method forward (line 241) | def forward(self, x): class LargeEncoder (line 267) | class LargeEncoder(nn.Module): method __init__ (line 268) | def __init__(self, output_dim=128, norm_fn='batch', dropout=0.0): method _make_layer (line 309) | def _make_layer(self, dim, stride=1): method forward (line 318) | def forward(self, x): FILE: Open-Sora/build/lib/vbench/third_pary/amt/networks/blocks/ifrnet.py function resize (line 7) | def resize(x, scale_factor): function convrelu (line 10) | def convrelu(in_channels, out_channels, kernel_size=3, stride=1, padding... class ResBlock (line 16) | class ResBlock(nn.Module): method __init__ (line 17) | def __init__(self, in_channels, side_channels, bias=True): method forward (line 39) | def forward(self, x): class Encoder (line 55) | class Encoder(nn.Module): method __init__ (line 56) | def __init__(self, channels, large=False): method forward (line 70) | def forward(self, in_x): class InitDecoder (line 78) | class InitDecoder(nn.Module): method __init__ (line 79) | def __init__(self, in_ch, out_ch, skip_ch) -> None: method forward (line 86) | def forward(self, f0, f1, embt): class IntermediateDecoder (line 94) | class IntermediateDecoder(nn.Module): method __init__ (line 95) | def __init__(self, in_ch, out_ch, skip_ch) -> None: method forward (line 102) | def forward(self, ft_, f0, f1, flow0_in, flow1_in): FILE: Open-Sora/build/lib/vbench/third_pary/amt/networks/blocks/multi_flow.py function multi_flow_combine (line 10) | def multi_flow_combine(comb_block, img0, img1, flow0, flow1, class MultiFlowDecoder (line 46) | class MultiFlowDecoder(nn.Module): method __init__ (line 47) | def __init__(self, in_ch, skip_ch, num_flows=3): method forward (line 56) | def forward(self, ft_, f0, f1, flow0, flow1): FILE: Open-Sora/build/lib/vbench/third_pary/amt/networks/blocks/raft.py function resize (line 6) | def resize(x, scale_factor): function bilinear_sampler (line 10) | def bilinear_sampler(img, coords, mask=False): function coords_grid (line 27) | def coords_grid(batch, ht, wd, device): class SmallUpdateBlock (line 35) | class SmallUpdateBlock(nn.Module): method __init__ (line 36) | def __init__(self, cdim, hidden_dim, flow_dim, corr_dim, fc_dim, method forward (line 67) | def forward(self, net, flow, corr): class BasicUpdateBlock (line 88) | class BasicUpdateBlock(nn.Module): method __init__ (line 89) | def __init__(self, cdim, hidden_dim, flow_dim, corr_dim, corr_dim2, method forward (line 121) | def forward(self, net, flow, corr): class BidirCorrBlock (line 142) | class BidirCorrBlock: method __init__ (line 143) | def __init__(self, fmap1, fmap2, num_levels=4, radius=4): method __call__ (line 165) | def __call__(self, coords0, coords1): method corr (line 200) | def corr(fmap1, fmap2): FILE: Open-Sora/build/lib/vbench/third_pary/grit_model.py class DenseCaptioning (line 7) | class DenseCaptioning(): method __init__ (line 8) | def __init__(self, device): method initialize_model (line 13) | def initialize_model(self, model_weight): method initialize_model_det (line 16) | def initialize_model_det(self, model_weight): method image_dense_caption (line 19) | def image_dense_caption(self, image_src): method run_caption_api (line 27) | def run_caption_api(self,image_src): method run_caption_tensor (line 34) | def run_caption_tensor(self,img): method run_det_tensor (line 39) | def run_det_tensor(self,img): FILE: Open-Sora/build/lib/vbench/third_pary/grit_src/centernet2/centernet/config.py function add_centernet_config (line 3) | def add_centernet_config(cfg): FILE: Open-Sora/build/lib/vbench/third_pary/grit_src/centernet2/centernet/modeling/backbone/bifpn.py function get_fpn_config (line 22) | def get_fpn_config(base_reduction=8): function swish (line 40) | def swish(x, inplace: bool = False): class Swish (line 46) | class Swish(nn.Module): method __init__ (line 47) | def __init__(self, inplace: bool = False): method forward (line 51) | def forward(self, x): class SequentialAppend (line 55) | class SequentialAppend(nn.Sequential): method __init__ (line 56) | def __init__(self, *args): method forward (line 59) | def forward(self, x): class SequentialAppendLast (line 65) | class SequentialAppendLast(nn.Sequential): method __init__ (line 66) | def __init__(self, *args): method forward (line 70) | def forward(self, x): class ConvBnAct2d (line 76) | class ConvBnAct2d(nn.Module): method __init__ (line 77) | def __init__(self, in_channels, out_channels, kernel_size, stride=1, d... method forward (line 88) | def forward(self, x): class SeparableConv2d (line 97) | class SeparableConv2d(nn.Module): method __init__ (line 100) | def __init__(self, in_channels, out_channels, kernel_size=3, stride=1,... method forward (line 125) | def forward(self, x): class ResampleFeatureMap (line 135) | class ResampleFeatureMap(nn.Sequential): method __init__ (line 136) | def __init__(self, in_channels, out_channels, reduction_ratio=1., pad_... class FpnCombine (line 174) | class FpnCombine(nn.Module): method __init__ (line 175) | def __init__(self, feature_info, fpn_config, fpn_channels, inputs_offs... method forward (line 205) | def forward(self, x): class BiFpnLayer (line 229) | class BiFpnLayer(nn.Module): method __init__ (line 230) | def __init__(self, feature_info, fpn_config, fpn_channels, num_levels=... method forward (line 274) | def forward(self, x): class BiFPN (line 279) | class BiFPN(Backbone): method __init__ (line 280) | def __init__( method size_divisibility (line 363) | def size_divisibility(self): method forward (line 366) | def forward(self, x): function build_resnet_bifpn_backbone (line 381) | def build_resnet_bifpn_backbone(cfg, input_shape: ShapeSpec): function build_p37_dla_bifpn_backbone (line 404) | def build_p37_dla_bifpn_backbone(cfg, input_shape: ShapeSpec): FILE: Open-Sora/build/lib/vbench/third_pary/grit_src/centernet2/centernet/modeling/backbone/bifpn_fcos.py function swish (line 16) | def swish(x): function split_name (line 20) | def split_name(name): class FeatureMapResampler (line 27) | class FeatureMapResampler(nn.Module): method __init__ (line 28) | def __init__(self, in_channels, out_channels, stride, norm=""): method forward (line 43) | def forward(self, x): class BackboneWithTopLevels (line 59) | class BackboneWithTopLevels(Backbone): method __init__ (line 60) | def __init__(self, backbone, out_channels, num_top_levels, norm=""): method forward (line 89) | def forward(self, x): class SingleBiFPN (line 103) | class SingleBiFPN(Backbone): method __init__ (line 109) | def __init__( method forward (line 192) | def forward(self, feats): class BiFPN (line 268) | class BiFPN(Backbone): method __init__ (line 274) | def __init__( method size_divisibility (line 337) | def size_divisibility(self): method forward (line 340) | def forward(self, x): function _assert_strides_are_log2_contiguous (line 361) | def _assert_strides_are_log2_contiguous(strides): function build_fcos_resnet_bifpn_backbone (line 372) | def build_fcos_resnet_bifpn_backbone(cfg, input_shape: ShapeSpec): function build_p35_fcos_resnet_bifpn_backbone (line 398) | def build_p35_fcos_resnet_bifpn_backbone(cfg, input_shape: ShapeSpec): function build_p35_fcos_dla_bifpn_backbone (line 423) | def build_p35_fcos_dla_bifpn_backbone(cfg, input_shape: ShapeSpec): function build_p37_fcos_dla_bifpn_backbone (line 447) | def build_p37_fcos_dla_bifpn_backbone(cfg, input_shape: ShapeSpec): FILE: Open-Sora/build/lib/vbench/third_pary/grit_src/centernet2/centernet/modeling/backbone/dla.py function get_model_url (line 38) | def get_model_url(data, name, hash): class BasicBlock (line 41) | class BasicBlock(nn.Module): method __init__ (line 42) | def __init__(self, inplanes, planes, stride=1, dilation=1, norm='BN'): method forward (line 55) | def forward(self, x, residual=None): class Bottleneck (line 71) | class Bottleneck(nn.Module): method __init__ (line 74) | def __init__(self, inplanes, planes, stride=1, dilation=1, norm='BN'): method forward (line 91) | def forward(self, x, residual=None): class Root (line 111) | class Root(nn.Module): method __init__ (line 112) | def __init__(self, in_channels, out_channels, kernel_size, residual, n... method forward (line 121) | def forward(self, *x): class Tree (line 132) | class Tree(nn.Module): method __init__ (line 133) | def __init__(self, levels, block, in_channels, out_channels, stride=1, method forward (line 174) | def forward(self, x, residual=None, children=None): class DLA (line 189) | class DLA(nn.Module): method __init__ (line 190) | def __init__(self, num_layers, levels, channels, method load_pretrained_model (line 223) | def load_pretrained_model(self, data, name, hash): method _make_conv_level (line 233) | def _make_conv_level(self, inplanes, planes, convs, stride=1, dilation... method forward (line 245) | def forward(self, x): function fill_up_weights (line 254) | def fill_up_weights(up): class _DeformConv (line 266) | class _DeformConv(nn.Module): method __init__ (line 267) | def __init__(self, chi, cho, norm='BN'): method forward (line 290) | def forward(self, x): class IDAUp (line 304) | class IDAUp(nn.Module): method __init__ (line 305) | def __init__(self, o, channels, up_f, norm='BN'): method forward (line 323) | def forward(self, layers, startp, endp): class DLAUp (line 332) | class DLAUp(nn.Module): method __init__ (line 333) | def __init__(self, startp, channels, scales, in_channels=None, norm='B... method forward (line 349) | def forward(self, layers): class DLASeg (line 363) | class DLASeg(Backbone): method __init__ (line 364) | def __init__(self, num_layers, out_features, use_dla_up=True, method size_divisibility (line 396) | def size_divisibility(self): method forward (line 399) | def forward(self, x): function build_dla_backbone (line 425) | def build_dla_backbone(cfg, input_shape): class LastLevelP6P7 (line 439) | class LastLevelP6P7(nn.Module): method __init__ (line 445) | def __init__(self, in_channels, out_channels): method forward (line 454) | def forward(self, c5): function build_retinanet_dla_fpn_backbone (line 460) | def build_retinanet_dla_fpn_backbone(cfg, input_shape: ShapeSpec): FILE: Open-Sora/build/lib/vbench/third_pary/grit_src/centernet2/centernet/modeling/backbone/dlafpn.py function get_model_url (line 25) | def get_model_url(data, name, hash): function conv3x3 (line 30) | def conv3x3(in_planes, out_planes, stride=1): class BasicBlock (line 36) | class BasicBlock(nn.Module): method __init__ (line 37) | def __init__(self, cfg, inplanes, planes, stride=1, dilation=1): method forward (line 50) | def forward(self, x, residual=None): class Bottleneck (line 67) | class Bottleneck(nn.Module): method __init__ (line 70) | def __init__(self, cfg, inplanes, planes, stride=1, dilation=1): method forward (line 87) | def forward(self, x, residual=None): class Root (line 108) | class Root(nn.Module): method __init__ (line 109) | def __init__(self, cfg, in_channels, out_channels, kernel_size, residu... method forward (line 118) | def forward(self, *x): class Tree (line 129) | class Tree(nn.Module): method __init__ (line 130) | def __init__(self, cfg, levels, block, in_channels, out_channels, stri... method forward (line 169) | def forward(self, x, residual=None, children=None): class DLA (line 187) | class DLA(Backbone): method __init__ (line 188) | def __init__(self, cfg, levels, channels, block=BasicBlock, residual_r... method load_pretrained_model (line 224) | def load_pretrained_model(self, data, name, hash): method _make_conv_level (line 232) | def _make_conv_level(self, inplanes, planes, convs, stride=1, dilation... method forward (line 244) | def forward(self, x): function fill_up_weights (line 254) | def fill_up_weights(up): class Conv (line 266) | class Conv(nn.Module): method __init__ (line 267) | def __init__(self, chi, cho, norm): method forward (line 274) | def forward(self, x): class DeformConv (line 278) | class DeformConv(nn.Module): method __init__ (line 279) | def __init__(self, chi, cho, norm): method forward (line 294) | def forward(self, x): class IDAUp (line 304) | class IDAUp(nn.Module): method __init__ (line 305) | def __init__(self, o, channels, up_f, norm='FrozenBN', node_type=Conv): method forward (line 323) | def forward(self, layers, startp, endp): class DLAUP (line 337) | class DLAUP(Backbone): method __init__ (line 338) | def __init__(self, bottom_up, in_features, norm, dlaup_node='conv'): method size_divisibility (line 376) | def size_divisibility(self): method forward (line 379) | def forward(self, x): function dla34 (line 394) | def dla34(cfg, pretrained=None): # DLA-34 class LastLevelP6P7 (line 401) | class LastLevelP6P7(nn.Module): method __init__ (line 407) | def __init__(self, in_channels, out_channels): method forward (line 416) | def forward(self, c5): function build_dla_fpn3_backbone (line 423) | def build_dla_fpn3_backbone(cfg, input_shape: ShapeSpec): function build_dla_fpn5_backbone (line 448) | def build_dla_fpn5_backbone(cfg, input_shape: ShapeSpec): function build_dlaup_backbone (line 475) | def build_dlaup_backbone(cfg, input_shape: ShapeSpec): FILE: Open-Sora/build/lib/vbench/third_pary/grit_src/centernet2/centernet/modeling/backbone/fpn_p5.py class LastLevelP6P7_P5 (line 15) | class LastLevelP6P7_P5(nn.Module): method __init__ (line 21) | def __init__(self, in_channels, out_channels): method forward (line 30) | def forward(self, c5): function build_p67_resnet_fpn_backbone (line 37) | def build_p67_resnet_fpn_backbone(cfg, input_shape: ShapeSpec): function build_p35_resnet_fpn_backbone (line 59) | def build_p35_resnet_fpn_backbone(cfg, input_shape: ShapeSpec): FILE: Open-Sora/build/lib/vbench/third_pary/grit_src/centernet2/centernet/modeling/backbone/res2net.py class BasicBlock (line 43) | class BasicBlock(CNNBlockBase): method __init__ (line 49) | def __init__(self, in_channels, out_channels, *, stride=1, norm="BN"): method forward (line 96) | def forward(self, x): class BottleneckBlock (line 111) | class BottleneckBlock(CNNBlockBase): method __init__ (line 116) | def __init__( method forward (line 233) | def forward(self, x): class DeformBottleneckBlock (line 266) | class DeformBottleneckBlock(ResNetBlockBase): method __init__ (line 272) | def __init__( method forward (line 429) | def forward(self, x): function make_stage (line 483) | def make_stage(block_class, num_blocks, first_stride, *, in_channels, ou... class BasicStem (line 511) | class BasicStem(CNNBlockBase): method __init__ (line 516) | def __init__(self, in_channels=3, out_channels=64, norm="BN"): method forward (line 560) | def forward(self, x): class ResNet (line 568) | class ResNet(Backbone): method __init__ (line 569) | def __init__(self, stem, stages, num_classes=None, out_features=None): method forward (line 624) | def forward(self, x): method output_shape (line 641) | def output_shape(self): method freeze (line 649) | def freeze(self, freeze_at=0): function build_res2net_backbone (line 670) | def build_res2net_backbone(cfg, input_shape): function build_p67_res2net_fpn_backbone (line 759) | def build_p67_res2net_fpn_backbone(cfg, input_shape: ShapeSpec): function build_res2net_bifpn_backbone (line 782) | def build_res2net_bifpn_backbone(cfg, input_shape: ShapeSpec): FILE: Open-Sora/build/lib/vbench/third_pary/grit_src/centernet2/centernet/modeling/debug.py function _get_color_image (line 9) | def _get_color_image(heatmap): function _blend_image (line 20) | def _blend_image(image, color_map, a=0.7): function _blend_image_heatmaps (line 25) | def _blend_image_heatmaps(image, color_maps, a=0.7): function _decompose_level (line 33) | def _decompose_level(x, shapes_per_level, N): function _imagelist_to_tensor (line 50) | def _imagelist_to_tensor(images): function _ind2il (line 63) | def _ind2il(ind, shapes_per_level, N): function debug_train (line 73) | def debug_train( function debug_test (line 141) | def debug_test( function debug_second_stage (line 218) | def debug_second_stage(images, instances, proposals=None, vis_thresh=0.3, FILE: Open-Sora/build/lib/vbench/third_pary/grit_src/centernet2/centernet/modeling/dense_heads/centernet.py class CenterNet (line 31) | class CenterNet(nn.Module): method __init__ (line 33) | def __init__(self, method from_config (line 131) | def from_config(cls, cfg, input_shape): method forward (line 179) | def forward(self, images, features_dict, gt_instances): method losses (line 237) | def losses( method compute_grids (line 317) | def compute_grids(self, features): method _get_ground_truth (line 338) | def _get_ground_truth(self, grids, shapes_per_level, gt_instances): method _get_label_inds (line 439) | def _get_label_inds(self, gt_instances, shapes_per_level): method assign_fpn_level (line 486) | def assign_fpn_level(self, boxes): method assign_reg_fpn (line 505) | def assign_reg_fpn(self, reg_targets_per_im, size_ranges): method _get_reg_targets (line 519) | def _get_reg_targets(self, reg_targets, dist, mask, area): method _create_heatmaps_from_dist (line 533) | def _create_heatmaps_from_dist(self, dist, labels, channels): method _create_agn_heatmaps_from_dist (line 551) | def _create_agn_heatmaps_from_dist(self, dist): method _flatten_outputs (line 565) | def _flatten_outputs(self, clss, reg_pred, agn_hm_pred): method get_center3x3 (line 576) | def get_center3x3(self, locations, centers, strides): method inference (line 595) | def inference(self, images, clss_per_level, reg_pred_per_level, method predict_instances (line 626) | def predict_instances( method predict_single_level (line 641) | def predict_single_level( method nms_and_topK (line 708) | def nms_and_topK(self, boxlists, nms=True): method _add_more_pos (line 736) | def _add_more_pos(self, reg_pred, gt_instances, shapes_per_level): method _get_c33_inds (line 768) | def _get_c33_inds(self, gt_instances, shapes_per_level): FILE: Open-Sora/build/lib/vbench/third_pary/grit_src/centernet2/centernet/modeling/dense_heads/centernet_head.py class Scale (line 13) | class Scale(nn.Module): method __init__ (line 14) | def __init__(self, init_value=1.0): method forward (line 18) | def forward(self, input): class CenterNetHead (line 21) | class CenterNetHead(nn.Module): method __init__ (line 23) | def __init__(self, method from_config (line 124) | def from_config(cls, cfg, input_shape): method forward (line 141) | def forward(self, x): FILE: Open-Sora/build/lib/vbench/third_pary/grit_src/centernet2/centernet/modeling/dense_heads/utils.py function _transpose (line 15) | def _transpose(training_targets, num_loc_list): function reduce_sum (line 32) | def reduce_sum(tensor): FILE: Open-Sora/build/lib/vbench/third_pary/grit_src/centernet2/centernet/modeling/layers/deform_conv.py class _NewEmptyTensorOp (line 7) | class _NewEmptyTensorOp(torch.autograd.Function): method forward (line 9) | def forward(ctx, x, new_shape): method backward (line 14) | def backward(ctx, grad): class DFConv2d (line 19) | class DFConv2d(nn.Module): method __init__ (line 21) | def __init__( method forward (line 91) | def forward(self, x, return_offset=False): FILE: Open-Sora/build/lib/vbench/third_pary/grit_src/centernet2/centernet/modeling/layers/heatmap_focal_loss.py function heatmap_focal_loss (line 5) | def heatmap_focal_loss( function binary_heatmap_focal_loss (line 51) | def binary_heatmap_focal_loss( FILE: Open-Sora/build/lib/vbench/third_pary/grit_src/centernet2/centernet/modeling/layers/iou_loss.py class IOULoss (line 5) | class IOULoss(nn.Module): method __init__ (line 6) | def __init__(self, loc_loss_type='iou'): method forward (line 10) | def forward(self, pred, target, weight=None, reduction='sum'): function giou_loss (line 66) | def giou_loss( FILE: Open-Sora/build/lib/vbench/third_pary/grit_src/centernet2/centernet/modeling/layers/ml_nms.py function ml_nms (line 4) | def ml_nms(boxlist, nms_thresh, max_proposals=-1, FILE: Open-Sora/build/lib/vbench/third_pary/grit_src/centernet2/centernet/modeling/meta_arch/centernet_detector.py class CenterNetDetector (line 13) | class CenterNetDetector(nn.Module): method __init__ (line 14) | def __init__(self, cfg): method forward (line 25) | def forward(self, batched_inputs): method device (line 38) | def device(self): method inference (line 43) | def inference(self, batched_inputs, do_postprocess=True): method preprocess_image (line 62) | def preprocess_image(self, batched_inputs): FILE: Open-Sora/build/lib/vbench/third_pary/grit_src/centernet2/centernet/modeling/roi_heads/custom_fast_rcnn.py class CustomFastRCNNOutputLayers (line 25) | class CustomFastRCNNOutputLayers(FastRCNNOutputLayers): method __init__ (line 26) | def __init__( method losses (line 36) | def losses(self, predictions, proposals): method sigmoid_cross_entropy_loss (line 65) | def sigmoid_cross_entropy_loss(self, pred_class_logits, gt_classes): method softmax_cross_entropy_loss (line 84) | def softmax_cross_entropy_loss(self, pred_class_logits, gt_classes): method inference (line 96) | def inference(self, predictions, proposals): method predict_probs (line 117) | def predict_probs(self, predictions, proposals): FILE: Open-Sora/build/lib/vbench/third_pary/grit_src/centernet2/centernet/modeling/roi_heads/custom_roi_heads.py class CustomROIHeads (line 23) | class CustomROIHeads(StandardROIHeads): method _init_box_head (line 25) | def _init_box_head(self, cfg, input_shape): method forward (line 41) | def forward(self, images, features, proposals, targets=None): class CustomCascadeROIHeads (line 71) | class CustomCascadeROIHeads(CascadeROIHeads): method _init_box_head (line 73) | def _init_box_head(self, cfg, input_shape): method _forward_box (line 98) | def _forward_box(self, features, proposals, targets=None): method forward (line 156) | def forward(self, images, features, proposals, targets=None): FILE: Open-Sora/build/lib/vbench/third_pary/grit_src/centernet2/centernet/modeling/roi_heads/fed_loss.py function load_class_freq (line 6) | def load_class_freq( function get_fed_loss_inds (line 15) | def get_fed_loss_inds( FILE: Open-Sora/build/lib/vbench/third_pary/tag2Text/med.py class BertEmbeddings_nopos (line 52) | class BertEmbeddings_nopos(nn.Module): method __init__ (line 55) | def __init__(self, config): method forward (line 71) | def forward( class BertEmbeddings (line 100) | class BertEmbeddings(nn.Module): method __init__ (line 103) | def __init__(self, config): method forward (line 119) | def forward( class BertSelfAttention (line 146) | class BertSelfAttention(nn.Module): method __init__ (line 147) | def __init__(self, config, is_cross_attention): method save_attn_gradients (line 175) | def save_attn_gradients(self, attn_gradients): method get_attn_gradients (line 178) | def get_attn_gradients(self): method save_attention_map (line 181) | def save_attention_map(self, attention_map): method get_attention_map (line 184) | def get_attention_map(self): method transpose_for_scores (line 187) | def transpose_for_scores(self, x): method forward (line 192) | def forward( class BertSelfOutput (line 284) | class BertSelfOutput(nn.Module): method __init__ (line 285) | def __init__(self, config): method forward (line 291) | def forward(self, hidden_states, input_tensor): class BertAttention (line 298) | class BertAttention(nn.Module): method __init__ (line 299) | def __init__(self, config, is_cross_attention=False): method prune_heads (line 305) | def prune_heads(self, heads): method forward (line 323) | def forward( class BertIntermediate (line 347) | class BertIntermediate(nn.Module): method __init__ (line 348) | def __init__(self, config): method forward (line 356) | def forward(self, hidden_states): class BertOutput (line 362) | class BertOutput(nn.Module): method __init__ (line 363) | def __init__(self, config): method forward (line 369) | def forward(self, hidden_states, input_tensor): class BertLayer (line 376) | class BertLayer(nn.Module): method __init__ (line 377) | def __init__(self, config, layer_num): method forward (line 389) | def forward( method feed_forward_chunk (line 457) | def feed_forward_chunk(self, attention_output): class BertEncoder (line 463) | class BertEncoder(nn.Module): method __init__ (line 464) | def __init__(self, config): method forward (line 470) | def forward( class BertPooler (line 563) | class BertPooler(nn.Module): method __init__ (line 564) | def __init__(self, config): method forward (line 569) | def forward(self, hidden_states): class BertPredictionHeadTransform (line 578) | class BertPredictionHeadTransform(nn.Module): method __init__ (line 579) | def __init__(self, config): method forward (line 588) | def forward(self, hidden_states): class BertLMPredictionHead (line 595) | class BertLMPredictionHead(nn.Module): method __init__ (line 596) | def __init__(self, config): method forward (line 609) | def forward(self, hidden_states): class BertOnlyMLMHead (line 615) | class BertOnlyMLMHead(nn.Module): method __init__ (line 616) | def __init__(self, config): method forward (line 620) | def forward(self, sequence_output): class BertPreTrainedModel (line 625) | class BertPreTrainedModel(PreTrainedModel): method _init_weights (line 635) | def _init_weights(self, module): class BertModel (line 648) | class BertModel(BertPreTrainedModel): method __init__ (line 658) | def __init__(self, config, add_pooling_layer=True): method get_input_embeddings (line 671) | def get_input_embeddings(self): method set_input_embeddings (line 674) | def set_input_embeddings(self, value): method _prune_heads (line 677) | def _prune_heads(self, heads_to_prune): method get_extended_attention_mask (line 686) | def get_extended_attention_mask(self, attention_mask: Tensor, input_sh... method forward (line 747) | def forward( class BertLMHeadModel (line 887) | class BertLMHeadModel(BertPreTrainedModel): method __init__ (line 892) | def __init__(self, config): method get_output_embeddings (line 900) | def get_output_embeddings(self): method set_output_embeddings (line 903) | def set_output_embeddings(self, new_embeddings): method forward (line 906) | def forward( method prepare_inputs_for_generation (line 1012) | def prepare_inputs_for_generation(self, input_ids, past=None, attentio... method _reorder_cache (line 1031) | def _reorder_cache(self, past, beam_idx): FILE: Open-Sora/build/lib/vbench/third_pary/tag2Text/swin_transformer.py class Mlp (line 17) | class Mlp(nn.Module): method __init__ (line 18) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 27) | def forward(self, x): function window_partition (line 36) | def window_partition(x, window_size): function window_reverse (line 51) | def window_reverse(windows, window_size, H, W): class WindowAttention (line 68) | class WindowAttention(nn.Module): method __init__ (line 82) | def __init__(self, dim, window_size, num_heads, qkv_bias=True, qk_scal... method forward (line 116) | def forward(self, x, mask=None): method extra_repr (line 149) | def extra_repr(self) -> str: method flops (line 152) | def flops(self, N): class SwinTransformerBlock (line 166) | class SwinTransformerBlock(nn.Module): method __init__ (line 185) | def __init__(self, dim, input_resolution, num_heads, window_size=7, sh... method forward (line 236) | def forward(self, x): method extra_repr (line 275) | def extra_repr(self) -> str: method flops (line 279) | def flops(self): class PatchMerging (line 294) | class PatchMerging(nn.Module): method __init__ (line 303) | def __init__(self, input_resolution, dim, norm_layer=nn.LayerNorm): method forward (line 310) | def forward(self, x): method extra_repr (line 333) | def extra_repr(self) -> str: method flops (line 336) | def flops(self): class BasicLayer (line 343) | class BasicLayer(nn.Module): method __init__ (line 363) | def __init__(self, dim, input_resolution, depth, num_heads, window_size, method forward (line 391) | def forward(self, x): method extra_repr (line 401) | def extra_repr(self) -> str: method flops (line 404) | def flops(self): class PatchEmbed (line 413) | class PatchEmbed(nn.Module): method __init__ (line 424) | def __init__(self, img_size=224, patch_size=4, in_chans=3, embed_dim=9... method forward (line 443) | def forward(self, x): method flops (line 453) | def flops(self): class SwinTransformer (line 461) | class SwinTransformer(nn.Module): method __init__ (line 487) | def __init__(self, img_size=224, patch_size=4, in_chans=3, num_classes... method _init_weights (line 545) | def _init_weights(self, m): method no_weight_decay (line 555) | def no_weight_decay(self): method no_weight_decay_keywords (line 559) | def no_weight_decay_keywords(self): method forward (line 562) | def forward(self, x, idx_to_group_img=None, image_atts=None, **kwargs): method flops (line 586) | def flops(self): function interpolate_relative_pos_embed (line 596) | def interpolate_relative_pos_embed(rel_pos_bias, dst_num_pos, param_name... FILE: Open-Sora/build/lib/vbench/third_pary/tag2Text/tag2text.py function read_json (line 26) | def read_json(rpath): class Tag2Text_Caption (line 32) | class Tag2Text_Caption(nn.Module): method __init__ (line 33) | def __init__(self, method del_selfattention (line 109) | def del_selfattention(self): method generate (line 114) | def generate(self, image, sample=False, num_beams=3, max_length=30, mi... function tag2text_caption (line 213) | def tag2text_caption(pretrained='',**kwargs): function tie_encoder_decoder_weights (line 226) | def tie_encoder_decoder_weights(encoder: nn.Module, decoder: nn.Module, ... class GroupWiseLinear (line 298) | class GroupWiseLinear(nn.Module): method __init__ (line 302) | def __init__(self, num_class, hidden_dim, bias=True): method reset_parameters (line 313) | def reset_parameters(self): method forward (line 321) | def forward(self, x): function init_tokenizer (line 329) | def init_tokenizer(): function create_vit (line 337) | def create_vit(vit, image_size, use_grad_checkpointing=False, ckpt_layer... function is_url (line 354) | def is_url(url_or_filename): function load_checkpoint (line 358) | def load_checkpoint(model,url_or_filename): function load_checkpoint_swinbase (line 383) | def load_checkpoint_swinbase(model,url_or_filename,kwargs): FILE: Open-Sora/build/lib/vbench/third_pary/tag2Text/vit.py class Mlp (line 23) | class Mlp(nn.Module): method __init__ (line 26) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 35) | def forward(self, x): class Attention (line 44) | class Attention(nn.Module): method __init__ (line 45) | def __init__(self, dim, num_heads=8, qkv_bias=False, qk_scale=None, at... method save_attn_gradients (line 58) | def save_attn_gradients(self, attn_gradients): method get_attn_gradients (line 61) | def get_attn_gradients(self): method save_attention_map (line 64) | def save_attention_map(self, attention_map): method get_attention_map (line 67) | def get_attention_map(self): method forward (line 70) | def forward(self, x, register_hook=False): class Block (line 89) | class Block(nn.Module): method __init__ (line 91) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, qk_sc... method forward (line 107) | def forward(self, x, register_hook=False): class VisionTransformer (line 113) | class VisionTransformer(nn.Module): method __init__ (line 118) | def __init__(self, img_size=224, patch_size=16, in_chans=3, num_classe... method _init_weights (line 167) | def _init_weights(self, m): method no_weight_decay (line 177) | def no_weight_decay(self): method forward (line 180) | def forward(self, x, register_blk=-1): method load_pretrained (line 197) | def load_pretrained(self, checkpoint_path, prefix=''): function _load_weights (line 202) | def _load_weights(model: VisionTransformer, checkpoint_path: str, prefix... function interpolate_pos_embed (line 281) | def interpolate_pos_embed(pos_embed_checkpoint, visual_encoder): FILE: Open-Sora/build/lib/vbench/third_pary/umt/datasets/build.py class DataAugmentationForVideoMAE (line 11) | class DataAugmentationForVideoMAE(object): method __init__ (line 12) | def __init__(self, args): method __call__ (line 45) | def __call__(self, images): method __repr__ (line 52) | def __repr__(self): function build_pretraining_dataset (line 60) | def build_pretraining_dataset(args): function build_dataset (line 83) | def build_dataset(is_train, test_mode, args): FILE: Open-Sora/build/lib/vbench/third_pary/umt/datasets/kinetics.py class VideoClsDataset (line 26) | class VideoClsDataset(Dataset): method __init__ (line 29) | def __init__(self, anno_path, prefix='', split=' ', mode='train', clip... method __getitem__ (line 100) | def __getitem__(self, index): method _aug_frame (line 177) | def _aug_frame( method loadvideo_decord (line 239) | def loadvideo_decord(self, sample, sample_rate_scale=1, chunk_nb=0): method __len__ (line 306) | def __len__(self): function spatial_sampling (line 313) | def spatial_sampling( function tensor_normalize (line 387) | def tensor_normalize(tensor, mean, std): FILE: Open-Sora/build/lib/vbench/third_pary/umt/datasets/kinetics_sparse.py class VideoClsDataset_sparse (line 27) | class VideoClsDataset_sparse(Dataset): method __init__ (line 30) | def __init__(self, anno_path, prefix='', split=' ', mode='train', clip... method __getitem__ (line 101) | def __getitem__(self, index): method _aug_frame (line 176) | def _aug_frame( method _get_seq_frames (line 237) | def _get_seq_frames(self, video_size, num_frames, clip_idx=-1): method loadvideo_decord (line 260) | def loadvideo_decord(self, sample, chunk_nb=0): method __len__ (line 294) | def __len__(self): function spatial_sampling (line 301) | def spatial_sampling( function tensor_normalize (line 375) | def tensor_normalize(tensor, mean, std): FILE: Open-Sora/build/lib/vbench/third_pary/umt/datasets/mae.py class VideoMAE (line 18) | class VideoMAE(torch.utils.data.Dataset): method __init__ (line 72) | def __init__(self, method __getitem__ (line 134) | def __getitem__(self, index): method __len__ (line 197) | def __len__(self): method _make_dataset (line 200) | def _make_dataset(self, directory, setting): method _sample_train_indices (line 226) | def _sample_train_indices(self, num_frames): method _get_frame_id_list (line 248) | def _get_frame_id_list(self, duration, indices, skip_offsets): method _video_TSN_decord_batch_loader (line 262) | def _video_TSN_decord_batch_loader(self, directory, video_reader, dura... FILE: Open-Sora/build/lib/vbench/third_pary/umt/datasets/masking_generator.py class TubeMaskingGenerator (line 4) | class TubeMaskingGenerator: method __init__ (line 5) | def __init__(self, input_size, mask_ratio): method __repr__ (line 12) | def __repr__(self): method __call__ (line 18) | def __call__(self): class RandomMaskingGenerator (line 28) | class RandomMaskingGenerator: method __init__ (line 29) | def __init__(self, input_size, mask_ratio): method __repr__ (line 38) | def __repr__(self): method __call__ (line 43) | def __call__(self): FILE: Open-Sora/build/lib/vbench/third_pary/umt/datasets/mixup.py function one_hot (line 17) | def one_hot(x, num_classes, on_value=1., off_value=0., device='cuda'): function mixup_target (line 22) | def mixup_target(target, num_classes, lam=1., smoothing=0.0, device='cud... function rand_bbox (line 30) | def rand_bbox(img_shape, lam, margin=0., count=None): function rand_bbox_minmax (line 54) | def rand_bbox_minmax(img_shape, minmax, count=None): function cutmix_bbox_and_lam (line 77) | def cutmix_bbox_and_lam(img_shape, lam, ratio_minmax=None, correct_lam=T... class Mixup (line 90) | class Mixup: method __init__ (line 104) | def __init__(self, mixup_alpha=1., cutmix_alpha=0., cutmix_minmax=None... method _params_per_elem (line 121) | def _params_per_elem(self, batch_size): method _params_per_batch (line 141) | def _params_per_batch(self): method _mix_elem (line 159) | def _mix_elem(self, x): method _mix_pair (line 176) | def _mix_pair(self, x): method _mix_batch (line 196) | def _mix_batch(self, x): method __call__ (line 209) | def __call__(self, x, target): class FastCollateMixup (line 221) | class FastCollateMixup(Mixup): method _mix_elem_collate (line 227) | def _mix_elem_collate(self, output, batch, half=False): method _mix_pair_collate (line 252) | def _mix_pair_collate(self, output, batch): method _mix_batch_collate (line 280) | def _mix_batch_collate(self, output, batch): method __call__ (line 299) | def __call__(self, batch, _=None): FILE: Open-Sora/build/lib/vbench/third_pary/umt/datasets/rand_augment.py function _interpolation (line 50) | def _interpolation(kwargs): function _check_args_tf (line 58) | def _check_args_tf(kwargs): function shear_x (line 64) | def shear_x(img, factor, **kwargs): function shear_y (line 71) | def shear_y(img, factor, **kwargs): function translate_x_rel (line 78) | def translate_x_rel(img, pct, **kwargs): function translate_y_rel (line 86) | def translate_y_rel(img, pct, **kwargs): function translate_x_abs (line 94) | def translate_x_abs(img, pixels, **kwargs): function translate_y_abs (line 101) | def translate_y_abs(img, pixels, **kwargs): function rotate (line 108) | def rotate(img, degrees, **kwargs): function auto_contrast (line 142) | def auto_contrast(img, **__): function invert (line 146) | def invert(img, **__): function equalize (line 150) | def equalize(img, **__): function solarize (line 154) | def solarize(img, thresh, **__): function solarize_add (line 158) | def solarize_add(img, add, thresh=128, **__): function posterize (line 173) | def posterize(img, bits_to_keep, **__): function contrast (line 179) | def contrast(img, factor, **__): function color (line 183) | def color(img, factor, **__): function brightness (line 187) | def brightness(img, factor, **__): function sharpness (line 191) | def sharpness(img, factor, **__): function _randomly_negate (line 195) | def _randomly_negate(v): function _rotate_level_to_arg (line 200) | def _rotate_level_to_arg(level, _hparams): function _enhance_level_to_arg (line 207) | def _enhance_level_to_arg(level, _hparams): function _enhance_increasing_level_to_arg (line 212) | def _enhance_increasing_level_to_arg(level, _hparams): function _shear_level_to_arg (line 220) | def _shear_level_to_arg(level, _hparams): function _translate_abs_level_to_arg (line 227) | def _translate_abs_level_to_arg(level, hparams): function _translate_rel_level_to_arg (line 234) | def _translate_rel_level_to_arg(level, hparams): function _posterize_level_to_arg (line 242) | def _posterize_level_to_arg(level, _hparams): function _posterize_increasing_level_to_arg (line 249) | def _posterize_increasing_level_to_arg(level, hparams): function _posterize_original_level_to_arg (line 256) | def _posterize_original_level_to_arg(level, _hparams): function _solarize_level_to_arg (line 263) | def _solarize_level_to_arg(level, _hparams): function _solarize_increasing_level_to_arg (line 269) | def _solarize_increasing_level_to_arg(level, _hparams): function _solarize_add_level_to_arg (line 275) | def _solarize_add_level_to_arg(level, _hparams): class AugmentOp (line 337) | class AugmentOp: method __init__ (line 342) | def __init__(self, name, prob=0.5, magnitude=10, hparams=None): method __call__ (line 364) | def __call__(self, img_list): function _select_rand_weights (line 444) | def _select_rand_weights(weight_idx=0, transforms=None): function rand_augment_ops (line 453) | def rand_augment_ops(magnitude=10, hparams=None, transforms=None): class RandAugment (line 462) | class RandAugment: method __init__ (line 463) | def __init__(self, ops, num_layers=2, choice_weights=None): method __call__ (line 468) | def __call__(self, img): function rand_augment_transform (line 481) | def rand_augment_transform(config_str, hparams): FILE: Open-Sora/build/lib/vbench/third_pary/umt/datasets/random_erasing.py function _get_pixels (line 11) | def _get_pixels( class RandomErasing (line 27) | class RandomErasing: method __init__ (line 46) | def __init__( method _erase (line 80) | def _erase(self, img, chan, img_h, img_w, dtype): method _erase_cube (line 109) | def _erase_cube( method __call__ (line 151) | def __call__(self, input): FILE: Open-Sora/build/lib/vbench/third_pary/umt/datasets/ssv2.py class SSRawFrameClsDataset (line 26) | class SSRawFrameClsDataset(Dataset): method __init__ (line 29) | def __init__(self, anno_path, prefix='', split=' ', mode='train', clip... method __getitem__ (line 105) | def __getitem__(self, index): method _aug_frame (line 195) | def _aug_frame( method load_frame (line 252) | def load_frame(self, sample, num_frames, sample_rate_scale=1): method __len__ (line 315) | def __len__(self): class SSVideoClsDataset (line 322) | class SSVideoClsDataset(Dataset): method __init__ (line 325) | def __init__(self, anno_path, prefix='', split=' ', mode='train', clip... method __getitem__ (line 394) | def __getitem__(self, index): method _aug_frame (line 470) | def _aug_frame( method loadvideo_decord (line 532) | def loadvideo_decord(self, sample, sample_rate_scale=1): method __len__ (line 591) | def __len__(self): function spatial_sampling (line 598) | def spatial_sampling( function tensor_normalize (line 672) | def tensor_normalize(tensor, mean, std): FILE: Open-Sora/build/lib/vbench/third_pary/umt/datasets/transforms.py class GroupRandomCrop (line 11) | class GroupRandomCrop(object): method __init__ (line 12) | def __init__(self, size): method __call__ (line 18) | def __call__(self, img_tuple): class GroupCenterCrop (line 39) | class GroupCenterCrop(object): method __init__ (line 40) | def __init__(self, size): method __call__ (line 43) | def __call__(self, img_tuple): class GroupRandomHorizontalFlip (line 48) | class GroupRandomHorizontalFlip(object): method __init__ (line 49) | def __init__(self, flip=False): method __call__ (line 52) | def __call__(self, img_tuple): class GroupNormalize (line 62) | class GroupNormalize(object): method __init__ (line 63) | def __init__(self, mean, std): method __call__ (line 67) | def __call__(self, tensor_tuple): class GroupGrayScale (line 79) | class GroupGrayScale(object): method __init__ (line 80) | def __init__(self, size): method __call__ (line 83) | def __call__(self, img_tuple): class GroupColorJitter (line 88) | class GroupColorJitter(object): method __init__ (line 89) | def __init__(self, size): method __call__ (line 94) | def __call__(self, img_tuple): class GroupScale (line 99) | class GroupScale(object): method __init__ (line 108) | def __init__(self, size, interpolation=Image.BILINEAR): method __call__ (line 111) | def __call__(self, img_tuple): class GroupMultiScaleCrop (line 116) | class GroupMultiScaleCrop(object): method __init__ (line 118) | def __init__(self, input_size, scales=None, max_distort=1, fix_crop=Tr... method __call__ (line 126) | def __call__(self, img_tuple): method _sample_crop_size (line 136) | def _sample_crop_size(self, im_size): method _sample_fix_offset (line 160) | def _sample_fix_offset(self, image_w, image_h, crop_w, crop_h): method fill_fix_offset (line 165) | def fill_fix_offset(more_fix_crop, image_w, image_h, crop_w, crop_h): class Stack (line 189) | class Stack(object): method __init__ (line 191) | def __init__(self, roll=False): method __call__ (line 194) | def __call__(self, img_tuple): class ToTorchFormatTensor (line 206) | class ToTorchFormatTensor(object): method __init__ (line 209) | def __init__(self, div=True): method __call__ (line 212) | def __call__(self, pic_tuple): class IdentityTransform (line 228) | class IdentityTransform(object): method __call__ (line 230) | def __call__(self, data): FILE: Open-Sora/build/lib/vbench/third_pary/umt/datasets/video_transforms.py function _pil_interp (line 32) | def _pil_interp(method): function random_short_side_scale_jitter (line 43) | def random_short_side_scale_jitter( function crop_boxes (line 100) | def crop_boxes(boxes, x_offset, y_offset): function random_crop (line 119) | def random_crop(images, size, boxes=None): function horizontal_flip (line 155) | def horizontal_flip(prob, images, boxes=None): function uniform_crop (line 190) | def uniform_crop(images, size, spatial_idx, boxes=None, scale_size=None): function clip_boxes_to_image (line 253) | def clip_boxes_to_image(boxes, height, width): function blend (line 275) | def blend(images1, images2, alpha): function grayscale (line 291) | def grayscale(images): function color_jitter (line 313) | def color_jitter(images, img_brightness=0, img_contrast=0, img_saturatio... function brightness_jitter (line 348) | def brightness_jitter(var, images): function contrast_jitter (line 367) | def contrast_jitter(var, images): function saturation_jitter (line 387) | def saturation_jitter(var, images): function lighting_jitter (line 406) | def lighting_jitter(images, alphastd, eigval, eigvec): function color_normalization (line 454) | def color_normalization(images, mean, stddev): function _get_param_spatial_crop (line 498) | def _get_param_spatial_crop( function random_resized_crop (line 540) | def random_resized_crop( function random_resized_crop_with_shift (line 575) | def random_resized_crop_with_shift( function create_random_augment (line 620) | def create_random_augment( function random_sized_crop_img (line 656) | def random_sized_crop_img( class RandomResizedCropAndInterpolation (line 691) | class RandomResizedCropAndInterpolation: method __init__ (line 704) | def __init__( method get_params (line 726) | def get_params(img, scale, ratio): method __call__ (line 766) | def __call__(self, img): method __repr__ (line 780) | def __repr__(self): function transforms_imagenet_train (line 798) | def transforms_imagenet_train( class Compose (line 901) | class Compose(object): method __init__ (line 908) | def __init__(self, transforms): method __call__ (line 911) | def __call__(self, clip): class RandomHorizontalFlip (line 917) | class RandomHorizontalFlip(object): method __call__ (line 922) | def __call__(self, clip): class RandomResize (line 943) | class RandomResize(object): method __init__ (line 953) | def __init__(self, ratio=(3. / 4., 4. / 3.), interpolation='nearest'): method __call__ (line 957) | def __call__(self, clip): class Resize (line 973) | class Resize(object): method __init__ (line 983) | def __init__(self, size, interpolation='nearest'): method __call__ (line 987) | def __call__(self, clip): class RandomCrop (line 993) | class RandomCrop(object): method __init__ (line 1000) | def __init__(self, size): method __call__ (line 1006) | def __call__(self, clip): class ThreeCrop (line 1037) | class ThreeCrop(object): method __init__ (line 1044) | def __init__(self, size): method __call__ (line 1050) | def __call__(self, clip): class RandomRotation (line 1084) | class RandomRotation(object): method __init__ (line 1093) | def __init__(self, degrees): method __call__ (line 1106) | def __call__(self, clip): class CenterCrop (line 1127) | class CenterCrop(object): method __init__ (line 1134) | def __init__(self, size): method __call__ (line 1140) | def __call__(self, clip): class ColorJitter (line 1171) | class ColorJitter(object): method __init__ (line 1184) | def __init__(self, brightness=0, contrast=0, saturation=0, hue=0): method get_params (line 1190) | def get_params(self, brightness, contrast, saturation, hue): method __call__ (line 1215) | def __call__(self, clip): class Normalize (line 1254) | class Normalize(object): method __init__ (line 1266) | def __init__(self, mean, std): method __call__ (line 1270) | def __call__(self, clip): method __repr__ (line 1279) | def __repr__(self): FILE: Open-Sora/build/lib/vbench/third_pary/umt/datasets/volume_transforms.py function convert_img (line 6) | def convert_img(img): class ClipToTensor (line 16) | class ClipToTensor(object): method __init__ (line 21) | def __init__(self, channel_nb=3, div_255=True, numpy=False): method __call__ (line 26) | def __call__(self, clip): class ClipToTensor_K (line 71) | class ClipToTensor_K(object): method __init__ (line 76) | def __init__(self, channel_nb=3, div_255=True, numpy=False): method __call__ (line 81) | def __call__(self, clip): class ToTensor (line 125) | class ToTensor(object): method __call__ (line 129) | def __call__(self, array): FILE: Open-Sora/build/lib/vbench/third_pary/umt/functional.py function _is_tensor_clip (line 8) | def _is_tensor_clip(clip): function crop_clip (line 12) | def crop_clip(clip, min_h, min_w, h, w): function resize_clip (line 26) | def resize_clip(clip, size, interpolation='bilinear'): function get_resize_sizes (line 67) | def get_resize_sizes(im_h, im_w, size): function normalize (line 77) | def normalize(clip, mean, std, inplace=False): FILE: Open-Sora/build/lib/vbench/third_pary/umt/models/clip.py class LayerNorm (line 18) | class LayerNorm(nn.LayerNorm): method forward (line 21) | def forward(self, x): class QuickGELU (line 27) | class QuickGELU(nn.Module): method forward (line 28) | def forward(self, x): class ResidualAttentionBlock (line 32) | class ResidualAttentionBlock(nn.Module): method __init__ (line 33) | def __init__(self, d_model, n_head, attn_mask=None): method attention (line 46) | def attention(self, x, return_attn=False): method forward (line 53) | def forward(self, x, return_attn=False): class Transformer (line 65) | class Transformer(nn.Module): method __init__ (line 66) | def __init__( method forward (line 85) | def forward(self, x): class VisionTransformer (line 99) | class VisionTransformer(nn.Module): method __init__ (line 100) | def __init__( method forward (line 135) | def forward(self, x, mask=None): function inflate_weight (line 175) | def inflate_weight(weight_2d, time_dim, center=True): function load_state_dict (line 188) | def load_state_dict(model, state_dict, input_resolution=224, patch_size=... function clip_b16 (line 218) | def clip_b16( function clip_l14 (line 239) | def clip_l14( function clip_l14_336 (line 260) | def clip_l14_336( FILE: Open-Sora/build/lib/vbench/third_pary/umt/models/modeling_finetune.py function _cfg (line 11) | def _cfg(url='', **kwargs): class DropPath (line 21) | class DropPath(nn.Module): method __init__ (line 24) | def __init__(self, drop_prob=None): method forward (line 28) | def forward(self, x): method extra_repr (line 31) | def extra_repr(self) -> str: class Mlp (line 35) | class Mlp(nn.Module): method __init__ (line 36) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 45) | def forward(self, x): class Attention (line 55) | class Attention(nn.Module): method __init__ (line 56) | def __init__( method forward (line 79) | def forward(self, x): class Block (line 101) | class Block(nn.Module): method __init__ (line 102) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, qk_sc... method forward (line 122) | def forward(self, x): class PatchEmbed (line 132) | class PatchEmbed(nn.Module): method __init__ (line 135) | def __init__(self, img_size=224, patch_size=16, in_chans=3, embed_dim=... method forward (line 148) | def forward(self, x, **kwargs): function get_sinusoid_encoding_table (line 158) | def get_sinusoid_encoding_table(n_position, d_hid, cur_frame=-1, pre_n_p... class VisionTransformer (line 205) | class VisionTransformer(nn.Module): method __init__ (line 208) | def __init__(self, method _init_weights (line 280) | def _init_weights(self, m): method get_num_layers (line 289) | def get_num_layers(self): method no_weight_decay (line 293) | def no_weight_decay(self): method get_classifier (line 296) | def get_classifier(self): method reset_classifier (line 299) | def reset_classifier(self, num_classes, global_pool=''): method forward_features (line 303) | def forward_features(self, x): method forward (line 323) | def forward(self, x): function vit_large_patch16_224 (line 348) | def vit_large_patch16_224(pretrained=False, **kwargs): FILE: Open-Sora/build/lib/vbench/third_pary/umt/models/modeling_pretrain.py function trunc_normal_ (line 13) | def trunc_normal_(tensor, mean=0., std=1.): class PretrainVisionTransformerEncoder (line 17) | class PretrainVisionTransformerEncoder(nn.Module): method __init__ (line 20) | def __init__(self, img_size=224, patch_size=16, in_chans=3, num_classe... method _init_weights (line 57) | def _init_weights(self, m): method get_num_layers (line 66) | def get_num_layers(self): method no_weight_decay (line 70) | def no_weight_decay(self): method get_classifier (line 73) | def get_classifier(self): method reset_classifier (line 76) | def reset_classifier(self, num_classes, global_pool=''): method forward_features (line 80) | def forward_features(self, x, mask): method forward (line 99) | def forward(self, x, mask): class PretrainVisionTransformerDecoder (line 105) | class PretrainVisionTransformerDecoder(nn.Module): method __init__ (line 108) | def __init__(self, patch_size=16, num_classes=768, embed_dim=768, dept... method _init_weights (line 131) | def _init_weights(self, m): method get_num_layers (line 140) | def get_num_layers(self): method no_weight_decay (line 144) | def no_weight_decay(self): method get_classifier (line 147) | def get_classifier(self): method reset_classifier (line 150) | def reset_classifier(self, num_classes, global_pool=''): method forward (line 154) | def forward(self, x, return_token_num): class PretrainVisionTransformer (line 170) | class PretrainVisionTransformer(nn.Module): method __init__ (line 173) | def __init__(self, method _init_weights (line 248) | def _init_weights(self, m): method get_num_layers (line 257) | def get_num_layers(self): method no_weight_decay (line 261) | def no_weight_decay(self): method forward (line 264) | def forward(self, x, mask): function pretrain_videomae_base_patch16_224 (line 281) | def pretrain_videomae_base_patch16_224(pretrained=False, **kwargs): function pretrain_videomae_large_patch16_224 (line 306) | def pretrain_videomae_large_patch16_224(pretrained=False, **kwargs): function pretrain_videomae_huge_patch16_224 (line 331) | def pretrain_videomae_huge_patch16_224(pretrained=False, **kwargs): FILE: Open-Sora/build/lib/vbench/third_pary/umt/models/modeling_pretrain_umt.py function trunc_normal_ (line 14) | def trunc_normal_(tensor, mean=0., std=1.): function get_sinusoid_encoding_table (line 20) | def get_sinusoid_encoding_table(n_position, d_hid): class PretrainVisionTransformerEncoder (line 33) | class PretrainVisionTransformerEncoder(nn.Module): method __init__ (line 36) | def __init__(self, img_size=224, patch_size=16, in_chans=3, num_classe... method _init_weights (line 81) | def _init_weights(self, m): method get_num_layers (line 90) | def get_num_layers(self): method no_weight_decay (line 94) | def no_weight_decay(self): method get_classifier (line 97) | def get_classifier(self): method reset_classifier (line 100) | def reset_classifier(self, num_classes, global_pool=''): method forward_features (line 104) | def forward_features(self, x, mask): method forward (line 128) | def forward(self, x, mask): class Linear_Decoder (line 135) | class Linear_Decoder(nn.Module): method __init__ (line 136) | def __init__(self, num_classes=768, embed_dim=768, method _init_weights (line 147) | def _init_weights(self, m): method forward (line 156) | def forward(self, x): class PretrainVisionTransformer (line 169) | class PretrainVisionTransformer(nn.Module): method __init__ (line 172) | def __init__(self, method _init_weights (line 239) | def _init_weights(self, m): method get_num_layers (line 248) | def get_num_layers(self): method no_weight_decay (line 252) | def no_weight_decay(self): method forward (line 255) | def forward(self, x, mask): function pretrain_umt_base_patch16_224 (line 273) | def pretrain_umt_base_patch16_224(pretrained=False, **kwargs): function pretrain_umt_large_patch16_224 (line 295) | def pretrain_umt_large_patch16_224(pretrained=False, **kwargs): FILE: Open-Sora/build/lib/vbench/utils.py function clip_transform (line 28) | def clip_transform(n_px): function clip_transform_Image (line 36) | def clip_transform_Image(n_px): function dino_transform (line 44) | def dino_transform(n_px): function dino_transform_Image (line 51) | def dino_transform_Image(n_px): function tag2text_transform (line 58) | def tag2text_transform(n_px): function get_frame_indices (line 63) | def get_frame_indices(num_frames, vlen, sample='rand', fix_start=None, i... function load_video (line 103) | def load_video(video_path, data_transform=None, num_frames=None, return_... function read_frames_decord_by_fps (line 170) | def read_frames_decord_by_fps( function load_dimension_info (line 193) | def load_dimension_info(json_dir, dimension, lang): function init_submodules (line 227) | def init_submodules(dimension_list, local=False, read_frame=False): function get_prompt_from_filename (line 360) | def get_prompt_from_filename(path: str): function save_json (line 371) | def save_json(data, path, indent=4): function load_json (line 375) | def load_json(path): FILE: Open-Sora/build/lib/vbench2_beta_i2v/__init__.py class VBenchI2V (line 8) | class VBenchI2V(VBench): method build_full_dimension_list (line 9) | def build_full_dimension_list(self, ): method evaluate (line 12) | def evaluate(self, videos_path, name, dimension_list=None, local=False... FILE: Open-Sora/build/lib/vbench2_beta_i2v/camera_motion.py function transform (line 10) | def transform(vector): function transform_class (line 16) | def transform_class(vector, min_reso, factor=0.005): # 768*0.05 class CameraPredict (line 35) | class CameraPredict: method __init__ (line 36) | def __init__(self, device, submodules_list): method infer (line 47) | def infer(self, video_path, save_video=False, save_dir="./saved_videos"): method get_edge_point (line 64) | def get_edge_point(self, track): method get_edge_direction (line 74) | def get_edge_direction(self, track1, track2): method classify_top_down (line 88) | def classify_top_down(self, top, down): method classify_left_right (line 105) | def classify_left_right(self, left, right): method camera_classify (line 122) | def camera_classify(self, track1, track2): method predict (line 137) | def predict(self, video_path): function get_type (line 146) | def get_type(video_name): function camera_motion (line 165) | def camera_motion(camera, video_list): function compute_camera_motion (line 194) | def compute_camera_motion(json_dir, device, submodules_list): FILE: Open-Sora/build/lib/vbench2_beta_i2v/crop_to_diff_ratio.py function save_json (line 15) | def save_json(data, save_file): function crop (line 19) | def crop(img_path, bbox, save_root): function get_other_ratio_crop (line 27) | def get_other_ratio_crop(second_crop_info, ratio="8-5"): function transfer_bbox_to_origin_img (line 56) | def transfer_bbox_to_origin_img(first_crop_info, old_bbox): function get_target_crop (line 63) | def get_target_crop(args): FILE: Open-Sora/build/lib/vbench2_beta_i2v/i2v_background.py function i2v_background (line 19) | def i2v_background(model, video_pair_list, device): function compute_i2v_background (line 67) | def compute_i2v_background(json_dir, device, submodules_list): FILE: Open-Sora/build/lib/vbench2_beta_i2v/i2v_subject.py function i2v_subject (line 19) | def i2v_subject(model, video_pair_list, device): function compute_i2v_subject (line 67) | def compute_i2v_subject(json_dir, device, submodules_list): FILE: Open-Sora/build/lib/vbench2_beta_i2v/utils.py function clip_transform (line 26) | def clip_transform(n_px): function clip_transform_Image (line 34) | def clip_transform_Image(n_px): function dino_transform (line 42) | def dino_transform(n_px): function dino_transform_Image (line 49) | def dino_transform_Image(n_px): function tag2text_transform (line 56) | def tag2text_transform(n_px): function get_frame_indices (line 61) | def get_frame_indices(num_frames, vlen, sample='rand', fix_start=None, i... function load_video (line 101) | def load_video(video_path, data_transform=None, num_frames=None, return_... function read_frames_decord_by_fps (line 168) | def read_frames_decord_by_fps( function load_dimension_info (line 191) | def load_dimension_info(json_dir, dimension, lang): function load_i2v_dimension_info (line 226) | def load_i2v_dimension_info(json_dir, dimension, lang, resolution): function init_submodules (line 267) | def init_submodules(dimension_list, local=False, read_frame=False, resol... function save_json (line 309) | def save_json(data, path, indent=4): function load_json (line 313) | def load_json(path): FILE: Open-Sora/eval/loss/eval_loss.py function main (line 18) | def main(): FILE: Open-Sora/eval/loss/tabulate_rl_loss.py function parse_args (line 15) | def parse_args(): FILE: Open-Sora/eval/vae/cal_flolpips.py function trans (line 16) | def trans(x): function calculate_flolpips (line 20) | def calculate_flolpips(videos1, videos2, device): function main (line 74) | def main(): FILE: Open-Sora/eval/vae/cal_lpips.py function trans (line 13) | def trans(x): function calculate_lpips (line 24) | def calculate_lpips(videos1, videos2, device): function main (line 82) | def main(): FILE: Open-Sora/eval/vae/cal_psnr.py function img_psnr (line 8) | def img_psnr(img1, img2): function trans (line 20) | def trans(x): function calculate_psnr (line 24) | def calculate_psnr(videos1, videos2): function main (line 77) | def main(): FILE: Open-Sora/eval/vae/cal_ssim.py function ssim (line 7) | def ssim(img1, img2): function calculate_ssim_function (line 26) | def calculate_ssim_function(img1, img2): function trans (line 45) | def trans(x): function calculate_ssim (line 49) | def calculate_ssim(videos1, videos2): function main (line 103) | def main(): FILE: Open-Sora/eval/vae/eval_common_metric.py function tqdm (line 54) | def tqdm(x): class VideoDataset (line 58) | class VideoDataset(Dataset): method __init__ (line 59) | def __init__( method __len__ (line 76) | def __len__(self): method __getitem__ (line 79) | def __getitem__(self, index): method _load_video (line 89) | def _load_video(self, video_path): method _combine_without_prefix (line 116) | def _combine_without_prefix(self, folder_path, prefix="."): function _preprocess (line 128) | def _preprocess(video_data, short_size=128, crop_size=None): function calculate_common_metric (line 141) | def calculate_common_metric(args, dataloader, device): function main (line 170) | def main(): FILE: Open-Sora/eval/vae/flolpips/correlation/correlation.py function cupy_kernel (line 236) | def cupy_kernel(strFunction, objVariables): function cupy_launch (line 285) | def cupy_launch(strFunction, strKernel): class _FunctionCorrelation (line 292) | class _FunctionCorrelation(torch.autograd.Function): method forward (line 294) | def forward(self, first, second): method backward (line 349) | def backward(self, gradOutput): function FunctionCorrelation (line 442) | def FunctionCorrelation(tenFirst, tenSecond): class ModuleCorrelation (line 449) | class ModuleCorrelation(torch.nn.Module): method __init__ (line 450) | def __init__(self): method forward (line 455) | def forward(self, tenFirst, tenSecond): FILE: Open-Sora/eval/vae/flolpips/flolpips.py function spatial_average (line 25) | def spatial_average(in_tens, keepdim=True): function mw_spatial_average (line 29) | def mw_spatial_average(in_tens, flow, keepdim=True): function mtw_spatial_average (line 37) | def mtw_spatial_average(in_tens, flow, texture, keepdim=True): function m2w_spatial_average (line 49) | def m2w_spatial_average(in_tens, flow, keepdim=True): function upsample (line 57) | def upsample(in_tens, out_HW=(64, 64)): # assumes scale factor is same ... function md5_hash (line 62) | def md5_hash(path): function download (line 68) | def download(url, local_path, chunk_size=1024): function get_ckpt_path (line 80) | def get_ckpt_path(name, root, check=False): class LPIPS (line 92) | class LPIPS(nn.Module): method __init__ (line 93) | def __init__( method load_from_pretrained (line 159) | def load_from_pretrained(self, version, net): method forward (line 163) | def forward(self, in0, in1, retPerLayer=False, normalize=False): class ScalingLayer (line 211) | class ScalingLayer(nn.Module): method __init__ (line 212) | def __init__(self): method forward (line 217) | def forward(self, inp): class NetLinLayer (line 221) | class NetLinLayer(nn.Module): method __init__ (line 224) | def __init__(self, chn_in, chn_out=1, use_dropout=False): method forward (line 239) | def forward(self, x): class Dist2LogitLayer (line 243) | class Dist2LogitLayer(nn.Module): method __init__ (line 246) | def __init__(self, chn_mid=32, use_sigmoid=True): method forward (line 270) | def forward(self, d0, d1, eps=0.1): class BCERankingLoss (line 274) | class BCERankingLoss(nn.Module): method __init__ (line 275) | def __init__(self, chn_mid=32): method forward (line 281) | def forward(self, d0, d1, judge): class FakeNet (line 288) | class FakeNet(nn.Module): method __init__ (line 289) | def __init__(self, use_gpu=True, colorspace="Lab"): class L2 (line 295) | class L2(FakeNet): method forward (line 296) | def forward(self, in0, in1, retPerLayer=None): class DSSIM (line 317) | class DSSIM(FakeNet): method forward (line 318) | def forward(self, in0, in1, retPerLayer=None): function print_network (line 335) | def print_network(net): class FloLPIPS (line 343) | class FloLPIPS(LPIPS): method __init__ (line 344) | def __init__( method forward (line 362) | def forward(self, in0, in1, flow, retPerLayer=False, normalize=False): class Flolpips (line 382) | class Flolpips(nn.Module): method __init__ (line 383) | def __init__(self): method forward (line 389) | def forward(self, I0, I1, frame_dis, frame_ref): FILE: Open-Sora/eval/vae/flolpips/pretrained_networks.py class squeezenet (line 7) | class squeezenet(torch.nn.Module): method __init__ (line 8) | def __init__(self, requires_grad=False, pretrained=True): method forward (line 37) | def forward(self, X): class alexnet (line 58) | class alexnet(torch.nn.Module): method __init__ (line 59) | def __init__(self, requires_grad=False, pretrained=True): method forward (line 82) | def forward(self, X): class vgg16 (line 99) | class vgg16(torch.nn.Module): method __init__ (line 100) | def __init__(self, requires_grad=False, pretrained=True): method forward (line 123) | def forward(self, X): class resnet (line 140) | class resnet(torch.nn.Module): method __init__ (line 141) | def __init__(self, requires_grad=False, pretrained=True, num=18): method forward (line 164) | def forward(self, X): FILE: Open-Sora/eval/vae/flolpips/pwcnet.py function backwarp (line 39) | def backwarp(tenInput, tenFlow): class Network (line 92) | class Network(torch.nn.Module): method __init__ (line 93) | def __init__(self): method forward (line 361) | def forward(self, tenFirst, tenSecond): function estimate (line 403) | def estimate(tenFirst, tenSecond): FILE: Open-Sora/eval/vae/flolpips/utils.py function normalize_tensor (line 6) | def normalize_tensor(in_feat, eps=1e-10): function l2 (line 11) | def l2(p0, p1, range=255.0): function dssim (line 15) | def dssim(p0, p1, range=255.0): function tensor2im (line 21) | def tensor2im(image_tensor, imtype=np.uint8, cent=1.0, factor=255.0 / 2.0): function tensor2np (line 27) | def tensor2np(tensor_obj): function np2tensor (line 32) | def np2tensor(np_obj): function tensor2tensorlab (line 37) | def tensor2tensorlab(image_tensor, to_norm=True, mc_only=False): function read_frame_yuv2rgb (line 52) | def read_frame_yuv2rgb(stream, width, height, iFrame, bit_depth, pix_fmt... FILE: Open-Sora/eval/vbench/calc_vbench.py function parse_args (line 37) | def parse_args(): FILE: Open-Sora/eval/vbench/tabulate_vbench_scores.py function parse_args (line 91) | def parse_args(): FILE: Open-Sora/eval/vbench_i2v/calc_vbench_i2v.py function str2bool (line 22) | def str2bool(v): function parse_args (line 33) | def parse_args(): FILE: Open-Sora/gradio/app.py function install_dependencies (line 33) | def install_dependencies(enable_optimization=False): function read_config (line 76) | def read_config(config_path): function build_models (line 85) | def build_models(model_type, config, enable_optimization=False): function parse_args (line 125) | def parse_args(): function run_inference (line 200) | def run_inference( function run_image_inference (line 396) | def run_image_inference( function run_video_inference (line 436) | def run_video_inference( function generate_random_prompt (line 479) | def generate_random_prompt(): function main (line 488) | def main(): FILE: Open-Sora/opensora/acceleration/checkpoint.py function set_grad_checkpoint (line 7) | def set_grad_checkpoint(model, use_fp32_attention=False, gc_step=1): function auto_grad_checkpoint (line 18) | def auto_grad_checkpoint(module, *args, **kwargs): FILE: Open-Sora/opensora/acceleration/communications.py function _all_to_all (line 8) | def _all_to_all( class _AllToAll (line 21) | class _AllToAll(torch.autograd.Function): method forward (line 32) | def forward(ctx, input_, process_group, scatter_dim, gather_dim): method backward (line 41) | def backward(ctx, grad_output): function all_to_all (line 57) | def all_to_all( function _gather (line 66) | def _gather( function _split (line 83) | def _split(input_, pg: dist.ProcessGroup, dim=-1): function _gather (line 103) | def _gather(input_, pg: dist.ProcessGroup, dim=-1): class _GatherForwardSplitBackward (line 123) | class _GatherForwardSplitBackward(torch.autograd.Function): method symbolic (line 133) | def symbolic(graph, input_): method forward (line 137) | def forward(ctx, input_, process_group, dim, grad_scale): method backward (line 144) | def backward(ctx, grad_output): class _SplitForwardGatherBackward (line 153) | class _SplitForwardGatherBackward(torch.autograd.Function): method symbolic (line 164) | def symbolic(graph, input_): method forward (line 168) | def forward(ctx, input_, process_group, dim, grad_scale): method backward (line 175) | def backward(ctx, grad_output): function split_forward_gather_backward (line 183) | def split_forward_gather_backward(input_, process_group, dim, grad_scale... function gather_forward_split_backward (line 187) | def gather_forward_split_backward(input_, process_group, dim, grad_scale... FILE: Open-Sora/opensora/acceleration/parallel_states.py function set_data_parallel_group (line 6) | def set_data_parallel_group(group: dist.ProcessGroup): function get_data_parallel_group (line 10) | def get_data_parallel_group(): function set_sequence_parallel_group (line 14) | def set_sequence_parallel_group(group: dist.ProcessGroup): function get_sequence_parallel_group (line 18) | def get_sequence_parallel_group(): FILE: Open-Sora/opensora/acceleration/plugin.py class ZeroSeqParallelPlugin (line 14) | class ZeroSeqParallelPlugin(LowLevelZeroPlugin): method __init__ (line 15) | def __init__( method __del__ (line 64) | def __del__(self): method prepare_dataloader (line 68) | def prepare_dataloader( FILE: Open-Sora/opensora/acceleration/shardformer/modeling/t5.py class T5LayerNorm (line 5) | class T5LayerNorm(nn.Module): method __init__ (line 6) | def __init__(self, hidden_size, eps=1e-6): method forward (line 14) | def forward(self, hidden_states): method from_native_module (line 30) | def from_native_module(module, *args, **kwargs): FILE: Open-Sora/opensora/acceleration/shardformer/policy/t5_encoder.py class T5EncoderPolicy (line 6) | class T5EncoderPolicy(Policy): method config_sanity_check (line 7) | def config_sanity_check(self): method preprocess (line 11) | def preprocess(self): method module_policy (line 14) | def module_policy(self): method postprocess (line 66) | def postprocess(self): FILE: Open-Sora/opensora/datasets/aspect.py function get_h_w (line 5) | def get_h_w(a, ts, eps=1e-4): function get_aspect_ratios_dict (line 15) | def get_aspect_ratios_dict(ars, ts=360 * 640): function get_ar (line 20) | def get_ar(ratio): function get_closest_ratio (line 440) | def get_closest_ratio(height: float, width: float, ratios: dict): function get_num_pixels (line 463) | def get_num_pixels(name): function get_image_size (line 467) | def get_image_size(resolution, ar_ratio): function get_num_frames (line 491) | def get_num_frames(num_frames): FILE: Open-Sora/opensora/datasets/bucket.py function find_approximate_hw (line 10) | def find_approximate_hw(hw, hw_dict, approx=0.8): function find_closet_smaller_bucket (line 17) | def find_closet_smaller_bucket(t, t_dict, frame_interval): class Bucket (line 31) | class Bucket: method __init__ (line 32) | def __init__(self, bucket_config): method get_bucket_id (line 74) | def get_bucket_id(self, T, H, W, frame_interval=1, seed=None): method get_thw (line 122) | def get_thw(self, bucket_id): method get_prob (line 128) | def get_prob(self, bucket_id): method get_batch_size (line 131) | def get_batch_size(self, bucket_id): method __len__ (line 134) | def __len__(self): function closet_smaller_bucket (line 138) | def closet_smaller_bucket(value, bucket): FILE: Open-Sora/opensora/datasets/dataloader.py function get_seed_worker (line 16) | def get_seed_worker(seed): function prepare_dataloader (line 26) | def prepare_dataloader( function collate_fn_default (line 113) | def collate_fn_default(batch): function collate_fn_batch (line 134) | def collate_fn_batch(batch): FILE: Open-Sora/opensora/datasets/datasets.py class VideoTextDataset (line 19) | class VideoTextDataset(torch.utils.data.Dataset): method __init__ (line 28) | def __init__( method _print_data_number (line 47) | def _print_data_number(self): method get_type (line 57) | def get_type(self, path): method getitem (line 65) | def getitem(self, index): method __getitem__ (line 101) | def __getitem__(self, index): method __len__ (line 111) | def __len__(self): class VariableVideoTextDataset (line 116) | class VariableVideoTextDataset(VideoTextDataset): method __init__ (line 117) | def __init__( method get_data_info (line 131) | def get_data_info(self, index): method getitem (line 137) | def getitem(self, index): method __getitem__ (line 192) | def __getitem__(self, index): class BatchFeatureDataset (line 200) | class BatchFeatureDataset(torch.utils.data.Dataset): method __init__ (line 209) | def __init__(self, data_path=None): method num_buffers (line 220) | def num_buffers(self): method len_buffer (line 224) | def len_buffer(self): method _load_buffer (line 227) | def _load_buffer(self, idx): method __len__ (line 233) | def __len__(self): method __getitem__ (line 236) | def __getitem__(self, idx): FILE: Open-Sora/opensora/datasets/read_video.py function read_video_av (line 19) | def read_video_av( function _read_from_stream (line 119) | def _read_from_stream( function read_video_cv2 (line 213) | def read_video_cv2(video_path): function read_video (line 250) | def read_video(video_path, backend="av"): FILE: Open-Sora/opensora/datasets/sampler.py function apply (line 19) | def apply(data, method=None, frame_interval=None, seed=None, num_bucket=... class StatefulDistributedSampler (line 29) | class StatefulDistributedSampler(DistributedSampler): method __init__ (line 30) | def __init__( method __iter__ (line 42) | def __iter__(self) -> Iterator: method __len__ (line 48) | def __len__(self) -> int: method reset (line 51) | def reset(self) -> None: method state_dict (line 54) | def state_dict(self, step) -> dict: method load_state_dict (line 57) | def load_state_dict(self, state_dict: dict) -> None: class VariableVideoBatchSampler (line 61) | class VariableVideoBatchSampler(DistributedSampler): method __init__ (line 62) | def __init__( method __iter__ (line 86) | def __iter__(self) -> Iterator[List[int]]: method __len__ (line 190) | def __len__(self) -> int: method group_by_bucket (line 193) | def group_by_bucket(self) -> dict: method get_num_batch (line 220) | def get_num_batch(self) -> int: method _print_bucket_info (line 229) | def _print_bucket_info(self, bucket_sample_dict: dict) -> None: method reset (line 275) | def reset(self): method state_dict (line 278) | def state_dict(self, num_steps: int) -> dict: method load_state_dict (line 285) | def load_state_dict(self, state_dict: dict) -> None: class BatchDistributedSampler (line 289) | class BatchDistributedSampler(DistributedSampler): method __init__ (line 300) | def __init__(self, dataset: Dataset, **kwargs): method __iter__ (line 304) | def __iter__(self): method reset (line 315) | def reset(self): method state_dict (line 318) | def state_dict(self, step) -> dict: method load_state_dict (line 321) | def load_state_dict(self, state_dict: dict): FILE: Open-Sora/opensora/datasets/utils.py function is_img (line 30) | def is_img(path): function is_vid (line 35) | def is_vid(path): function is_url (line 40) | def is_url(url): function read_file (line 44) | def read_file(input_path): function download_url (line 53) | def download_url(input_path): function temporal_random_crop (line 65) | def temporal_random_crop(vframes, num_frames, frame_interval): function get_transforms_video (line 77) | def get_transforms_video(name="center", image_size=(256, 256)): function get_transforms_image (line 103) | def get_transforms_image(name="center", image_size=(256, 256)): function read_image_from_path (line 129) | def read_image_from_path(path, transform=None, transform_name="center", ... function read_video_from_path (line 139) | def read_video_from_path(path, transform=None, transform_name="center", ... function read_from_path (line 148) | def read_from_path(path, image_size, transform_name="center"): function save_sample (line 159) | def save_sample(x, save_path=None, fps=8, normalize=True, value_range=(-... function center_crop_arr (line 184) | def center_crop_arr(pil_image, image_size): function resize_crop_to_fill (line 201) | def resize_crop_to_fill(pil_image, image_size): FILE: Open-Sora/opensora/datasets/video_transforms.py function _is_tensor_video_clip (line 25) | def _is_tensor_video_clip(clip): function crop (line 35) | def crop(clip, i, j, h, w): function resize (line 45) | def resize(clip, target_size, interpolation_mode): function resize_scale (line 51) | def resize_scale(clip, target_size, interpolation_mode): function resized_crop (line 59) | def resized_crop(clip, i, j, h, w, size, interpolation_mode="bilinear"): function center_crop (line 79) | def center_crop(clip, crop_size): function center_crop_using_short_edge (line 92) | def center_crop_using_short_edge(clip): function resize_crop_to_fill (line 107) | def resize_crop_to_fill(clip, target_size): function random_shift_crop (line 127) | def random_shift_crop(clip): function to_tensor (line 147) | def to_tensor(clip): function normalize (line 163) | def normalize(clip, mean, std, inplace=False): function hflip (line 183) | def hflip(clip): class ResizeCrop (line 195) | class ResizeCrop: method __init__ (line 196) | def __init__(self, size): method __call__ (line 202) | def __call__(self, clip): method __repr__ (line 206) | def __repr__(self) -> str: class RandomCropVideo (line 210) | class RandomCropVideo: method __init__ (line 211) | def __init__(self, size): method __call__ (line 217) | def __call__(self, clip): method get_params (line 228) | def get_params(self, clip): method __repr__ (line 243) | def __repr__(self) -> str: class CenterCropResizeVideo (line 247) | class CenterCropResizeVideo: method __init__ (line 253) | def __init__( method __call__ (line 267) | def __call__(self, clip): method __repr__ (line 281) | def __repr__(self) -> str: class UCFCenterCropVideo (line 285) | class UCFCenterCropVideo: method __init__ (line 291) | def __init__( method __call__ (line 305) | def __call__(self, clip): method __repr__ (line 317) | def __repr__(self) -> str: class KineticsRandomCropResizeVideo (line 321) | class KineticsRandomCropResizeVideo: method __init__ (line 326) | def __init__( method __call__ (line 340) | def __call__(self, clip): class CenterCropVideo (line 346) | class CenterCropVideo: method __init__ (line 347) | def __init__( method __call__ (line 361) | def __call__(self, clip): method __repr__ (line 372) | def __repr__(self) -> str: class NormalizeVideo (line 376) | class NormalizeVideo: method __init__ (line 385) | def __init__(self, mean, std, inplace=False): method __call__ (line 390) | def __call__(self, clip): method __repr__ (line 397) | def __repr__(self) -> str: class ToTensorVideo (line 401) | class ToTensorVideo: method __init__ (line 407) | def __init__(self): method __call__ (line 410) | def __call__(self, clip): method __repr__ (line 419) | def __repr__(self) -> str: class RandomHorizontalFlipVideo (line 423) | class RandomHorizontalFlipVideo: method __init__ (line 430) | def __init__(self, p=0.5): method __call__ (line 433) | def __call__(self, clip): method __repr__ (line 444) | def __repr__(self) -> str: class TemporalRandomCrop (line 451) | class TemporalRandomCrop(object): method __init__ (line 458) | def __init__(self, size): method __call__ (line 461) | def __call__(self, total_frames): FILE: Open-Sora/opensora/models/cache_functions/attention.py function cached_attention_forward (line 8) | def cached_attention_forward( FILE: Open-Sora/opensora/models/cache_functions/cache_cutfresh.py function cache_cutfresh (line 5) | def cache_cutfresh(cache_dic, tokens, current): function local_selection_with_space_time_bonus (line 51) | def local_selection_with_space_time_bonus(cache_dic, score, bonus_ratio,... FILE: Open-Sora/opensora/models/cache_functions/cache_init.py function cache_init (line 1) | def cache_init(model_kwargs, num_steps): FILE: Open-Sora/opensora/models/cache_functions/force_init.py function force_init (line 3) | def force_init(cache_dic, current, tokens): FILE: Open-Sora/opensora/models/cache_functions/force_scheduler.py function force_scheduler (line 2) | def force_scheduler(cache_dic, current): FILE: Open-Sora/opensora/models/cache_functions/fresh_ratio_scheduler.py function fresh_ratio_scheduler (line 2) | def fresh_ratio_scheduler(cache_dic, current): FILE: Open-Sora/opensora/models/cache_functions/global_force_fresh.py function global_force_fresh (line 2) | def global_force_fresh(cache_dic, current): FILE: Open-Sora/opensora/models/cache_functions/score_evaluate.py function score_evaluate (line 4) | def score_evaluate(cache_dic, tokens, current) -> torch.Tensor: FILE: Open-Sora/opensora/models/cache_functions/scores.py function attn_score (line 5) | def attn_score(cache_dic, current): function similarity_score (line 24) | def similarity_score(cache_dic, current, tokens): function norm_score (line 29) | def norm_score(cache_dic, current, tokens): FILE: Open-Sora/opensora/models/cache_functions/token_merge.py function token_merge (line 2) | def token_merge(cache_dic, tokens, current, fresh_indices, stale_indices): FILE: Open-Sora/opensora/models/cache_functions/update_cache.py function update_cache (line 2) | def update_cache(fresh_indices, fresh_tokens, cache_dic, current, fresh_... FILE: Open-Sora/opensora/models/dit/dit.py class DiTBlock (line 37) | class DiTBlock(nn.Module): method __init__ (line 42) | def __init__( method forward (line 67) | def forward(self, x, c): class DiT (line 75) | class DiT(nn.Module): method __init__ (line 80) | def __init__( method get_spatial_pos_embed (line 158) | def get_spatial_pos_embed(self): method get_temporal_pos_embed (line 166) | def get_temporal_pos_embed(self): method unpatchify (line 174) | def unpatchify(self, x): method forward (line 184) | def forward(self, x, t, y): method initialize_weights (line 226) | def initialize_weights(self): function DiT_XL_2 (line 264) | def DiT_XL_2(from_pretrained=None, **kwargs): function DiT_XL_2x2 (line 278) | def DiT_XL_2x2(from_pretrained=None, **kwargs): FILE: Open-Sora/opensora/models/latte/latte.py class Latte (line 33) | class Latte(DiT): method forward (line 34) | def forward(self, x, t, y): function Latte_XL_2 (line 88) | def Latte_XL_2(from_pretrained=None, **kwargs): function Latte_XL_2x2 (line 102) | def Latte_XL_2x2(from_pretrained=None, **kwargs): FILE: Open-Sora/opensora/models/layers/blocks.py class LlamaRMSNorm (line 34) | class LlamaRMSNorm(nn.Module): method __init__ (line 35) | def __init__(self, hidden_size, eps=1e-6): method forward (line 43) | def forward(self, hidden_states): function get_layernorm (line 51) | def get_layernorm(hidden_size: torch.Tensor, eps: float, affine: bool, u... function modulate (line 63) | def modulate(norm_func, x, shift, scale): function t2i_modulate (line 72) | def t2i_modulate(x, shift, scale): class PatchEmbed3D (line 81) | class PatchEmbed3D(nn.Module): method __init__ (line 91) | def __init__( method forward (line 112) | def forward(self, x): class Attention (line 134) | class Attention(nn.Module): method __init__ (line 135) | def __init__( method forward (line 171) | def forward(self, x: torch.Tensor) -> torch.Tensor: class KVCompressAttention (line 232) | class KVCompressAttention(nn.Module): method __init__ (line 233) | def __init__( method downsample_2d (line 276) | def downsample_2d(self, tensor, H, W, scale_factor, sampling=None): method forward (line 300) | def forward(self, x: torch.Tensor, mask=None, HW=None, block_id=None, ... class SeqParallelAttention (line 362) | class SeqParallelAttention(Attention): method __init__ (line 363) | def __init__( method forward (line 387) | def forward(self, x: torch.Tensor) -> torch.Tensor: class MultiHeadCrossAttention (line 455) | class MultiHeadCrossAttention(nn.Module): method __init__ (line 456) | def __init__(self, d_model, num_heads, attn_drop=0.0, proj_drop=0.0): method forward (line 470) | def forward(self, x, cond, mask=None): class SeqParallelMultiHeadCrossAttention (line 496) | class SeqParallelMultiHeadCrossAttention(MultiHeadCrossAttention): method __init__ (line 497) | def __init__( method forward (line 511) | def forward(self, x, cond, mask=None): class FinalLayer (line 549) | class FinalLayer(nn.Module): method __init__ (line 554) | def __init__(self, hidden_size, num_patch, out_channels): method forward (line 560) | def forward(self, x, c): class T2IFinalLayer (line 567) | class T2IFinalLayer(nn.Module): method __init__ (line 572) | def __init__(self, hidden_size, num_patch, out_channels, d_t=None, d_s... method t_mask_select (line 581) | def t_mask_select(self, x_mask, x, masked_x, T, S): method forward (line 591) | def forward(self, x, t, x_mask=None, t0=None, T=None, S=None): class TimestepEmbedder (line 611) | class TimestepEmbedder(nn.Module): method __init__ (line 616) | def __init__(self, hidden_size, frequency_embedding_size=256): method timestep_embedding (line 626) | def timestep_embedding(t, dim, max_period=10000): method forward (line 645) | def forward(self, t, dtype): class LabelEmbedder (line 653) | class LabelEmbedder(nn.Module): method __init__ (line 658) | def __init__(self, num_classes, hidden_size, dropout_prob): method token_drop (line 665) | def token_drop(self, labels, force_drop_ids=None): method forward (line 676) | def forward(self, labels, train, force_drop_ids=None): class SizeEmbedder (line 683) | class SizeEmbedder(TimestepEmbedder): method __init__ (line 688) | def __init__(self, hidden_size, frequency_embedding_size=256): method forward (line 698) | def forward(self, s, bs): method dtype (line 713) | def dtype(self): class CaptionEmbedder (line 717) | class CaptionEmbedder(nn.Module): method __init__ (line 722) | def __init__( method token_drop (line 744) | def token_drop(self, caption, force_drop_ids=None): method forward (line 755) | def forward(self, caption, train, force_drop_ids=None): class PositionEmbedding2D (line 765) | class PositionEmbedding2D(nn.Module): method __init__ (line 766) | def __init__(self, dim: int) -> None: method _get_sin_cos_emb (line 774) | def _get_sin_cos_emb(self, t: torch.Tensor): method _get_cached_emb (line 781) | def _get_cached_emb( method forward (line 806) | def forward( function get_2d_sincos_pos_embed (line 823) | def get_2d_sincos_pos_embed(embed_dim, grid_size, cls_token=False, extra... function get_2d_sincos_pos_embed_from_grid (line 847) | def get_2d_sincos_pos_embed_from_grid(embed_dim, grid): function get_1d_sincos_pos_embed (line 858) | def get_1d_sincos_pos_embed(embed_dim, length, scale=1.0): function get_1d_sincos_pos_embed_from_grid (line 863) | def get_1d_sincos_pos_embed_from_grid(embed_dim, pos): FILE: Open-Sora/opensora/models/pixart/pixart.py class PixArtBlock (line 53) | class PixArtBlock(nn.Module): method __init__ (line 58) | def __init__( method forward (line 95) | def forward(self, x, y, t, mask=None): class PixArt (line 109) | class PixArt(nn.Module): method __init__ (line 114) | def __init__( method forward (line 200) | def forward(self, x, timestep, y, mask=None, **kwargs): method unpatchify (line 249) | def unpatchify(self, x): method get_spatial_pos_embed (line 259) | def get_spatial_pos_embed(self, grid_size=None): method get_temporal_pos_embed (line 271) | def get_temporal_pos_embed(self): method freeze_text (line 280) | def freeze_text(self): method initialize_weights (line 285) | def initialize_weights(self): class PixArtMS (line 319) | class PixArtMS(PixArt): method __init__ (line 320) | def __init__(self, *args, **kwargs): method forward (line 327) | def forward(self, x, timestep, y, mask=None, data_info=None): function PixArt_XL_2 (line 385) | def PixArt_XL_2(from_pretrained=None, **kwargs): function PixArt_1B_2 (line 393) | def PixArt_1B_2(from_pretrained=None, **kwargs): function PixArtMS_XL_2 (line 401) | def PixArtMS_XL_2(from_pretrained=None, **kwargs): FILE: Open-Sora/opensora/models/stdit/stdit.py class STDiTBlock (line 31) | class STDiTBlock(nn.Module): method __init__ (line 32) | def __init__( method t_mask_select (line 88) | def t_mask_select(self, x, masked_x, x_mask): method forward (line 98) | def forward(self, x, y, t, mask=None, tpe=None, x_mask=None, t0=None): class STDiT (line 157) | class STDiT(nn.Module): method __init__ (line 158) | def __init__( method forward (line 258) | def forward(self, x, timestep, y, mask=None, x_mask=None, **kwargs): method unpatchify (line 331) | def unpatchify(self, x): method unpatchify_old (line 355) | def unpatchify_old(self, x): method get_spatial_pos_embed (line 365) | def get_spatial_pos_embed(self, grid_size=None): method get_temporal_pos_embed (line 376) | def get_temporal_pos_embed(self): method freeze_not_temporal (line 385) | def freeze_not_temporal(self): method freeze_text (line 390) | def freeze_text(self): method initialize_temporal (line 395) | def initialize_temporal(self): method initialize_weights (line 400) | def initialize_weights(self): function STDiT_XL_2 (line 434) | def STDiT_XL_2(from_pretrained=None, **kwargs): FILE: Open-Sora/opensora/models/stdit/stdit2.py class STDiT2Block (line 31) | class STDiT2Block(nn.Module): method __init__ (line 32) | def __init__( method t_mask_select (line 85) | def t_mask_select(self, x_mask, x, masked_x, T, S): method forward (line 95) | def forward(self, x, y, t, t_tmp, mask=None, x_mask=None, t0=None, t0_... class STDiT2Config (line 170) | class STDiT2Config(PretrainedConfig): method __init__ (line 173) | def __init__( class STDiT2 (line 219) | class STDiT2(PreTrainedModel): method __init__ (line 222) | def __init__(self, config): method get_dynamic_size (line 292) | def get_dynamic_size(self, x): method forward (line 305) | def forward( method unpatchify (line 413) | def unpatchify(self, x, N_t, N_h, N_w, R_t, R_h, R_w): method unpatchify_old (line 439) | def unpatchify_old(self, x): method get_spatial_pos_embed (line 449) | def get_spatial_pos_embed(self, H, W, scale=1.0, base_size=None): method freeze_not_temporal (line 459) | def freeze_not_temporal(self): method freeze_text (line 464) | def freeze_text(self): method initialize_temporal (line 469) | def initialize_temporal(self): method initialize_weights (line 474) | def initialize_weights(self): function STDiT2_XL_2 (line 509) | def STDiT2_XL_2(from_pretrained=None, **kwargs): FILE: Open-Sora/opensora/models/stdit/stdit3.py class STDiT3Block (line 37) | class STDiT3Block(nn.Module): method __init__ (line 38) | def __init__( method t_mask_select (line 81) | def t_mask_select(self, x_mask, x, masked_x, T, S): method forward (line 91) | def forward( class STDiT3Config (line 208) | class STDiT3Config(PretrainedConfig): method __init__ (line 211) | def __init__( class STDiT3 (line 258) | class STDiT3(PreTrainedModel): method __init__ (line 261) | def __init__(self, config): method initialize_weights (line 355) | def initialize_weights(self): method get_dynamic_size (line 377) | def get_dynamic_size(self, x): method encode_text (line 390) | def encode_text(self, y, mask=None): method forward (line 403) | def forward(self, x, timestep, y, mask=None, x_mask=None, fps=None, he... method unpatchify (line 491) | def unpatchify(self, x, N_t, N_h, N_w, R_t, R_h, R_w): function STDiT3_XL_2 (line 519) | def STDiT3_XL_2(from_pretrained=None, **kwargs): function STDiT3_3B_2 (line 532) | def STDiT3_3B_2(from_pretrained=None, **kwargs): FILE: Open-Sora/opensora/models/text_encoder/classes.py class ClassEncoder (line 7) | class ClassEncoder: method __init__ (line 8) | def __init__(self, num_classes, model_max_length=None, device="cuda", ... method encode (line 16) | def encode(self, text): method null (line 19) | def null(self, n): FILE: Open-Sora/opensora/models/text_encoder/clip.py class AbstractEncoder (line 36) | class AbstractEncoder(nn.Module): method __init__ (line 37) | def __init__(self): method encode (line 40) | def encode(self, *args, **kwargs): class FrozenCLIPEmbedder (line 44) | class FrozenCLIPEmbedder(AbstractEncoder): method __init__ (line 47) | def __init__(self, path="openai/clip-vit-huge-patch14", device="cuda",... method _freeze (line 55) | def _freeze(self): method forward (line 60) | def forward(self, text): method encode (line 77) | def encode(self, text): class ClipEncoder (line 82) | class ClipEncoder: method __init__ (line 87) | def __init__( method encode (line 103) | def encode(self, text): method null (line 108) | def null(self, n): method to (line 112) | def to(self, dtype): FILE: Open-Sora/opensora/models/text_encoder/t5.py class T5Embedder (line 34) | class T5Embedder: method __init__ (line 35) | def __init__( method get_text_embeddings (line 113) | def get_text_embeddings(self, texts): class T5Encoder (line 135) | class T5Encoder: method __init__ (line 136) | def __init__( method shardformer_t5 (line 166) | def shardformer_t5(self): method encode (line 189) | def encode(self, text): method null (line 194) | def null(self, n): function basic_clean (line 199) | def basic_clean(text): function clean_caption (line 210) | def clean_caption(caption): function text_preprocessing (line 328) | def text_preprocessing(text, use_text_preprocessing: bool = True): FILE: Open-Sora/opensora/models/vae/discriminator.py function cast_tuple (line 13) | def cast_tuple(t, length=1): function xavier_uniform_weight_init (line 17) | def xavier_uniform_weight_init(m): function n_layer_disc_weights_init (line 26) | def n_layer_disc_weights_init(m): class BlurPool3D (line 36) | class BlurPool3D(nn.Module): method __init__ (line 37) | def __init__( method forward (line 90) | def forward(self, inp): class ResBlockDown (line 100) | class ResBlockDown(nn.Module): method __init__ (line 103) | def __init__( method forward (line 135) | def forward(self, x): class NLayerDiscriminator (line 153) | class NLayerDiscriminator(nn.Module): method __init__ (line 158) | def __init__(self, input_nc=3, ndf=64, n_layers=3, use_actnorm=False, ... method forward (line 205) | def forward(self, input): class NLayerDiscriminator3D (line 210) | class NLayerDiscriminator3D(nn.Module): method __init__ (line 213) | def __init__(self, input_nc=1, ndf=64, n_layers=3, use_actnorm=False): method forward (line 269) | def forward(self, input): class StyleGANDiscriminatorBlur (line 274) | class StyleGANDiscriminatorBlur(nn.Module): method __init__ (line 282) | def __init__( method forward (line 343) | def forward(self, x): function load_checkpoint_with_inflation (line 368) | def load_checkpoint_with_inflation(model, ckpt_path): function DISCRIMINATOR_3D (line 391) | def DISCRIMINATOR_3D(from_pretrained=None, inflate_from_2d=False, use_pr... function DISCRIMINATOR_3D_N_Layer (line 407) | def DISCRIMINATOR_3D_N_Layer(from_pretrained=None, inflate_from_2d=False... FILE: Open-Sora/opensora/models/vae/losses.py function hinge_d_loss (line 9) | def hinge_d_loss(logits_real, logits_fake): function vanilla_d_loss (line 16) | def vanilla_d_loss(logits_real, logits_fake): function sigmoid_cross_entropy_with_logits (line 24) | def sigmoid_cross_entropy_with_logits(labels, logits): function lecam_reg (line 33) | def lecam_reg(real_pred, fake_pred, ema_real_pred, ema_fake_pred): function gradient_penalty_fn (line 40) | def gradient_penalty_fn(images, output): class VAELoss (line 54) | class VAELoss(nn.Module): method __init__ (line 55) | def __init__( method forward (line 80) | def forward( function adopt_weight (line 127) | def adopt_weight(weight, global_step, threshold=0, value=0.0): class AdversarialLoss (line 133) | class AdversarialLoss(nn.Module): method __init__ (line 134) | def __init__( method calculate_adaptive_weight (line 147) | def calculate_adaptive_weight(self, nll_loss, g_loss, last_layer): method forward (line 155) | def forward( class LeCamEMA (line 190) | class LeCamEMA: method __init__ (line 191) | def __init__(self, ema_real=0.0, ema_fake=0.0, decay=0.999, dtype=torc... method update (line 196) | def update(self, ema_real, ema_fake): method get (line 200) | def get(self): class DiscriminatorLoss (line 204) | class DiscriminatorLoss(nn.Module): method __init__ (line 205) | def __init__( method forward (line 222) | def forward( FILE: Open-Sora/opensora/models/vae/lpips.py function md5_hash (line 18) | def md5_hash(path): function download (line 24) | def download(url, local_path, chunk_size=1024): function get_ckpt_path (line 36) | def get_ckpt_path(name, root, check=False): class LPIPS (line 47) | class LPIPS(nn.Module): method __init__ (line 49) | def __init__(self, use_dropout=True): method load_from_pretrained (line 63) | def load_from_pretrained(self, name="vgg_lpips"): method from_pretrained (line 69) | def from_pretrained(cls, name="vgg_lpips"): method forward (line 77) | def forward(self, input, target): class ScalingLayer (line 93) | class ScalingLayer(nn.Module): method __init__ (line 94) | def __init__(self): method forward (line 99) | def forward(self, inp): class NetLinLayer (line 103) | class NetLinLayer(nn.Module): method __init__ (line 106) | def __init__(self, chn_in, chn_out=1, use_dropout=False): class vgg16 (line 121) | class vgg16(torch.nn.Module): method __init__ (line 122) | def __init__(self, requires_grad=False, pretrained=True): method forward (line 145) | def forward(self, X): function normalize_tensor (line 161) | def normalize_tensor(x, eps=1e-10): function spatial_average (line 166) | def spatial_average(x, keepdim=True): FILE: Open-Sora/opensora/models/vae/utils.py class DiagonalGaussianDistribution (line 7) | class DiagonalGaussianDistribution(object): method __init__ (line 8) | def __init__( method sample (line 22) | def sample(self): method kl (line 27) | def kl(self, other=None): method nll (line 43) | def nll(self, sample, dims=[1, 2, 3, 4]): method mode (line 49) | def mode(self): FILE: Open-Sora/opensora/models/vae/vae.py class VideoAutoencoderKL (line 14) | class VideoAutoencoderKL(nn.Module): method __init__ (line 15) | def __init__( method encode (line 36) | def encode(self, x): method decode (line 55) | def decode(self, x, **kwargs): method get_latent_size (line 73) | def get_latent_size(self, input_size): method device (line 83) | def device(self): method dtype (line 87) | def dtype(self): class VideoAutoencoderKLTemporalDecoder (line 92) | class VideoAutoencoderKLTemporalDecoder(nn.Module): method __init__ (line 93) | def __init__(self, from_pretrained=None, cache_dir=None, local_files_o... method encode (line 101) | def encode(self, x): method decode (line 104) | def decode(self, x, **kwargs): method get_latent_size (line 111) | def get_latent_size(self, input_size): method device (line 121) | def device(self): method dtype (line 125) | def dtype(self): class VideoAutoencoderPipelineConfig (line 129) | class VideoAutoencoderPipelineConfig(PretrainedConfig): method __init__ (line 132) | def __init__( class VideoAutoencoderPipeline (line 155) | class VideoAutoencoderPipeline(PreTrainedModel): method __init__ (line 158) | def __init__(self, config: VideoAutoencoderPipelineConfig): method encode (line 182) | def encode(self, x): method decode (line 201) | def decode(self, z, num_frames=None): method forward (line 223) | def forward(self, x): method get_latent_size (line 229) | def get_latent_size(self, input_size): method get_temporal_last_layer (line 242) | def get_temporal_last_layer(self): method device (line 246) | def device(self): method dtype (line 250) | def dtype(self): function OpenSoraVAE_V1_2 (line 255) | def OpenSoraVAE_V1_2( FILE: Open-Sora/opensora/models/vae/vae_temporal.py function cast_tuple (line 13) | def cast_tuple(t, length=1): function divisible_by (line 17) | def divisible_by(num, den): function is_odd (line 21) | def is_odd(n): function pad_at_dim (line 25) | def pad_at_dim(t, pad, dim=-1): function exists (line 31) | def exists(v): class CausalConv3d (line 35) | class CausalConv3d(nn.Module): method __init__ (line 36) | def __init__( method forward (line 67) | def forward(self, x): class ResBlock (line 73) | class ResBlock(nn.Module): method __init__ (line 74) | def __init__( method forward (line 100) | def forward(self, x): function get_activation_fn (line 113) | def get_activation_fn(activation): class Encoder (line 123) | class Encoder(nn.Module): method __init__ (line 126) | def __init__( method forward (line 204) | def forward(self, x): class Decoder (line 221) | class Decoder(nn.Module): method __init__ (line 224) | def __init__( method forward (line 301) | def forward(self, x): class VAE_Temporal (line 326) | class VAE_Temporal(nn.Module): method __init__ (line 327) | def __init__( method get_latent_size (line 371) | def get_latent_size(self, input_size): method encode (line 388) | def encode(self, x): method decode (line 400) | def decode(self, z, num_frames=None): method forward (line 411) | def forward(self, x, sample_posterior=True): function VAE_Temporal_SD (line 422) | def VAE_Temporal_SD(from_pretrained=None, **kwargs): FILE: Open-Sora/opensora/models/vae/video_sdxl/blocks.py function video_to_image (line 15) | def video_to_image(func): class VideoConv2d (line 36) | class VideoConv2d(nn.Conv2d): method __init__ (line 37) | def __init__(self, *args, micro_batch_size=None, **kwargs): method forward (line 42) | def forward(self, x): class ResnetBlock2D (line 46) | class ResnetBlock2D(nn.Module): method __init__ (line 53) | def __init__( method forward (line 89) | def forward(self, x): class ResnetBlock3D (line 105) | class ResnetBlock3D(nn.Module): method __init__ (line 111) | def __init__( method forward (line 144) | def forward(self, x): class SpatialDownsample2x (line 160) | class SpatialDownsample2x(nn.Module): method __init__ (line 166) | def __init__( method forward (line 185) | def forward(self, x): class SpatialUpsample2x (line 194) | class SpatialUpsample2x(nn.Module): method __init__ (line 200) | def __init__( method forward (line 217) | def forward(self, x): method forward_BCHW (line 234) | def forward_BCHW(self, x): class TemporalDownsample2x (line 249) | class TemporalDownsample2x(nn.Module): method __init__ (line 254) | def __init__( method forward (line 270) | def forward(self, x): class TemporalUpsample2x (line 275) | class TemporalUpsample2x(nn.Module): method __init__ (line 281) | def __init__( method forward (line 289) | def forward(self, x): class UNetMidBlock2D (line 297) | class UNetMidBlock2D(nn.Module): method __init__ (line 302) | def __init__( method forward (line 363) | def forward(self, x): class Encoder (line 380) | class Encoder(nn.Module): method __init__ (line 385) | def __init__( method forward (line 541) | def forward(self, x): class Decoder (line 553) | class Decoder(nn.Module): method __init__ (line 558) | def __init__( method forward (line 682) | def forward(self, x): FILE: Open-Sora/opensora/registry.py function build_module (line 7) | def build_module(module, builder, **kwargs): FILE: Open-Sora/opensora/schedulers/dpms/__init__.py class DPM_SOLVER (line 11) | class DPM_SOLVER: method __init__ (line 12) | def __init__(self, num_sampling_steps=None, cfg_scale=4.0): method sample (line 16) | def sample( function forward_with_dpmsolver (line 54) | def forward_with_dpmsolver(self, x, timestep, y, **kwargs): FILE: Open-Sora/opensora/schedulers/dpms/dpm_solver.py function _warmup_beta (line 30) | def _warmup_beta(beta_start, beta_end, num_diffusion_timesteps, warmup_f... function get_beta_schedule (line 37) | def get_beta_schedule(beta_schedule, *, beta_start, beta_end, num_diffus... function get_named_beta_schedule (line 68) | def get_named_beta_schedule(schedule_name, num_diffusion_timesteps): function betas_for_alpha_bar (line 95) | def betas_for_alpha_bar(num_diffusion_timesteps, alpha_bar, max_beta=0.9... class NoiseScheduleVP (line 114) | class NoiseScheduleVP: method __init__ (line 115) | def __init__( method numerical_clip_alpha (line 231) | def numerical_clip_alpha(self, log_alphas, clipped_lambda=-5.1): method marginal_log_mean_coeff (line 244) | def marginal_log_mean_coeff(self, t): method marginal_alpha (line 255) | def marginal_alpha(self, t): method marginal_std (line 261) | def marginal_std(self, t): method marginal_lambda (line 267) | def marginal_lambda(self, t): method inverse_lambda (line 275) | def inverse_lambda(self, lamb): function model_wrapper (line 293) | def model_wrapper( class DPM_Solver (line 459) | class DPM_Solver: method __init__ (line 460) | def __init__( method dynamic_thresholding_fn (line 538) | def dynamic_thresholding_fn(self, x0, t): method noise_prediction_fn (line 549) | def noise_prediction_fn(self, x, t): method data_prediction_fn (line 555) | def data_prediction_fn(self, x, t): method model_fn (line 566) | def model_fn(self, x, t): method get_time_steps (line 575) | def get_time_steps(self, skip_type, t_T, t_0, N, device): method get_orders_and_timesteps_for_singlestep_solver (line 605) | def get_orders_and_timesteps_for_singlestep_solver(self, steps, order,... method denoise_to_zero_fn (line 694) | def denoise_to_zero_fn(self, x, s): method dpm_solver_first_update (line 700) | def dpm_solver_first_update(self, x, s, t, model_s=None, return_interm... method singlestep_dpm_solver_second_update (line 734) | def singlestep_dpm_solver_second_update( method singlestep_dpm_solver_third_update (line 815) | def singlestep_dpm_solver_third_update( method multistep_dpm_solver_second_update (line 951) | def multistep_dpm_solver_second_update(self, x, model_prev_list, t_pre... method multistep_dpm_solver_third_update (line 1009) | def multistep_dpm_solver_third_update(self, x, model_prev_list, t_prev... method singlestep_dpm_solver_update (line 1065) | def singlestep_dpm_solver_update( method multistep_dpm_solver_update (line 1097) | def multistep_dpm_solver_update(self, x, model_prev_list, t_prev_list,... method dpm_solver_adaptive (line 1121) | def dpm_solver_adaptive( method add_noise (line 1185) | def add_noise(self, x, t, noise=None): method inverse (line 1202) | def inverse( method sample (line 1243) | def sample( function interpolate_fn (line 1482) | def interpolate_fn(x, xp, yp): function expand_dims (line 1527) | def expand_dims(v, dims): function DPMS (line 1540) | def DPMS( FILE: Open-Sora/opensora/schedulers/iddpm/__init__.py class IDDPM (line 13) | class IDDPM(SpacedDiffusion): method __init__ (line 14) | def __init__( method sample (line 55) | def sample( function forward_with_cfg (line 88) | def forward_with_cfg(model, x, timestep, y, cfg_scale, cfg_channel=None,... FILE: Open-Sora/opensora/schedulers/iddpm/diffusion_utils.py function normal_kl (line 18) | def normal_kl(mean1, logvar1, mean2, logvar2): function approx_standard_normal_cdf (line 40) | def approx_standard_normal_cdf(x): function continuous_gaussian_log_likelihood (line 48) | def continuous_gaussian_log_likelihood(x, *, means, log_scales): function discretized_gaussian_log_likelihood (line 63) | def discretized_gaussian_log_likelihood(x, *, means, log_scales): FILE: Open-Sora/opensora/schedulers/iddpm/gaussian_diffusion.py function mean_flat (line 23) | def mean_flat(tensor: torch.Tensor, mask=None): class ModelMeanType (line 38) | class ModelMeanType(enum.Enum): class ModelVarType (line 48) | class ModelVarType(enum.Enum): class LossType (line 61) | class LossType(enum.Enum): method is_vb (line 67) | def is_vb(self): function _warmup_beta (line 71) | def _warmup_beta(beta_start: float, beta_end: float, num_diffusion_times... function get_beta_schedule (line 78) | def get_beta_schedule( function betas_for_alpha_bar (line 111) | def betas_for_alpha_bar(num_diffusion_timesteps: int, alpha_bar: Callabl... function get_named_beta_schedule (line 130) | def get_named_beta_schedule(schedule_name, num_diffusion_timesteps): class GaussianDiffusion (line 157) | class GaussianDiffusion: method __init__ (line 166) | def __init__( method q_mean_variance (line 218) | def q_mean_variance(self, x_start, t): method q_sample (line 230) | def q_sample(self, x_start, t, noise=None): method q_posterior_mean_variance (line 247) | def q_posterior_mean_variance(self, x_start, x_t, t): method p_mean_variance (line 267) | def p_mean_variance(self, model, x, t, clip_denoised=True, denoised_fn... method _predict_xstart_from_eps (line 345) | def _predict_xstart_from_eps(self, x_t, t, eps): method _predict_eps_from_xstart (line 352) | def _predict_eps_from_xstart(self, x_t, t, pred_xstart): method condition_mean (line 357) | def condition_mean(self, cond_fn, p_mean_var, x, t, model_kwargs=None): method condition_score (line 369) | def condition_score(self, cond_fn, p_mean_var, x, t, model_kwargs=None): method p_sample (line 387) | def p_sample( method p_sample_loop (line 456) | def p_sample_loop( method p_sample_loop_progressive (line 503) | def p_sample_loop_progressive( method ddim_sample (line 554) | def ddim_sample( method ddim_reverse_sample (line 594) | def ddim_reverse_sample( method ddim_sample_loop (line 631) | def ddim_sample_loop( method ddim_sample_loop_progressive (line 664) | def ddim_sample_loop_progressive( method _vb_terms_bpd (line 713) | def _vb_terms_bpd(self, model, x_start, x_t, t, clip_denoised=True, mo... method training_losses (line 738) | def training_losses(self, model, x_start, model_kwargs=None, noise=Non... method _prior_bpd (line 822) | def _prior_bpd(self, x_start): method calc_bpd_loop (line 836) | def calc_bpd_loop(self, model, x_start, clip_denoised=True, model_kwar... function _extract_into_tensor (line 892) | def _extract_into_tensor(arr: torch.Tensor, timesteps: torch.Tensor, bro... FILE: Open-Sora/opensora/schedulers/iddpm/respace.py function space_timesteps (line 20) | def space_timesteps(num_timesteps, section_counts): class SpacedDiffusion (line 69) | class SpacedDiffusion(GaussianDiffusion): method __init__ (line 77) | def __init__(self, use_timesteps, **kwargs): method p_mean_variance (line 94) | def p_mean_variance(self, model, *args, **kwargs): # pylint: disable=... method training_losses (line 97) | def training_losses(self, model, *args, **kwargs): # pylint: disable=... method condition_mean (line 100) | def condition_mean(self, cond_fn, *args, **kwargs): method condition_score (line 103) | def condition_score(self, cond_fn, *args, **kwargs): method _wrap_model (line 106) | def _wrap_model(self, model): method _scale_timesteps (line 111) | def _scale_timesteps(self, t): class _WrappedModel (line 116) | class _WrappedModel: method __init__ (line 117) | def __init__(self, model, map_tensor, original_num_steps): method __call__ (line 123) | def __call__(self, x, ts, **kwargs): FILE: Open-Sora/opensora/schedulers/iddpm/speed.py class SpeeDiffusion (line 12) | class SpeeDiffusion(SpacedDiffusion): method __init__ (line 13) | def __init__( method t_sample (line 64) | def t_sample(self, n, device): method training_losses (line 70) | def training_losses(self, model, x, *args, **kwargs): # pylint: disab... method sample (line 74) | def sample(self, *args, **kwargs): FILE: Open-Sora/opensora/schedulers/iddpm/timestep_sampler.py function create_named_schedule_sampler (line 20) | def create_named_schedule_sampler(name, diffusion): class ScheduleSampler (line 34) | class ScheduleSampler(ABC): method weights (line 45) | def weights(self): method sample (line 51) | def sample(self, batch_size, device): class UniformSampler (line 69) | class UniformSampler(ScheduleSampler): method __init__ (line 70) | def __init__(self, diffusion): method weights (line 74) | def weights(self): class LossAwareSampler (line 78) | class LossAwareSampler(ScheduleSampler): method update_with_local_losses (line 79) | def update_with_local_losses(self, local_ts, local_losses): method update_with_all_losses (line 108) | def update_with_all_losses(self, ts, losses): class LossSecondMomentResampler (line 122) | class LossSecondMomentResampler(LossAwareSampler): method __init__ (line 123) | def __init__(self, diffusion, history_per_term=10, uniform_prob=0.001): method weights (line 130) | def weights(self): method update_with_all_losses (line 139) | def update_with_all_losses(self, ts, losses): method _warmed_up (line 149) | def _warmed_up(self): FILE: Open-Sora/opensora/schedulers/rf/__init__.py class RFLOW (line 11) | class RFLOW: method __init__ (line 12) | def __init__( method sample (line 35) | def sample( method training_losses (line 133) | def training_losses(self, model, x_start, model_kwargs=None, noise=Non... FILE: Open-Sora/opensora/schedulers/rf/rectified_flow.py function timestep_transform (line 10) | def timestep_transform( class RFlowScheduler (line 41) | class RFlowScheduler: method __init__ (line 42) | def __init__( method training_losses (line 71) | def training_losses(self, model, x_start, model_kwargs=None, noise=Non... method add_noise (line 112) | def add_noise( FILE: Open-Sora/opensora/utils/ckpt_utils.py function reparameter (line 43) | def reparameter(ckpt, name=None, model=None): function find_model (line 113) | def find_model(model_name, model=None): function download_model (line 127) | def download_model(model_name=None, local_path=None, url=None): function load_from_sharded_state_dict (line 148) | def load_from_sharded_state_dict(model, ckpt_path, model_name="model.saf... function model_sharding (line 153) | def model_sharding(model: torch.nn.Module): function model_gathering (line 167) | def model_gathering(model: torch.nn.Module, model_shape_dict: dict): function remove_padding (line 179) | def remove_padding(tensor: torch.Tensor, original_shape: Tuple) -> torch... function record_model_param_shape (line 183) | def record_model_param_shape(model: torch.nn.Module) -> dict: function load_checkpoint (line 190) | def load_checkpoint(model, ckpt_path, save_as_pt=False, model_name="mode... function load_json (line 213) | def load_json(file_path: str): function save_json (line 218) | def save_json(data, file_path: str): function save (line 226) | def save( function load (line 267) | def load( FILE: Open-Sora/opensora/utils/config_utils.py function parse_args (line 9) | def parse_args(training=False): function merge_args (line 87) | def merge_args(cfg, args, training=False): function read_config (line 123) | def read_config(config_path): function parse_configs (line 128) | def parse_configs(training=False): function define_experiment_workspace (line 135) | def define_experiment_workspace(cfg, get_last_workspace=False): function save_training_config (line 158) | def save_training_config(cfg, experiment_dir): function str2bool (line 163) | def str2bool(v): FILE: Open-Sora/opensora/utils/inference_utils.py function prepare_multi_resolution_info (line 11) | def prepare_multi_resolution_info(info_type, batch_size, image_size, num... function load_prompts (line 30) | def load_prompts(prompt_path, start_idx=None, end_idx=None): function get_save_path_name (line 37) | def get_save_path_name( function append_score_to_prompts (line 55) | def append_score_to_prompts(prompts, aes=None, flow=None, camera_motion=... function extract_json_from_prompts (line 69) | def extract_json_from_prompts(prompts, reference, mask_strategy): function collect_references_batch (line 86) | def collect_references_batch(reference_paths, vae, image_size): function extract_prompts_loop (line 103) | def extract_prompts_loop(prompts, num_loop): function split_prompt (line 119) | def split_prompt(prompt_text): function merge_prompt (line 137) | def merge_prompt(text_list, loop_idx_list=None): function parse_mask_strategy (line 150) | def parse_mask_strategy(mask_strategy): function find_nearest_point (line 168) | def find_nearest_point(value, point, max_value): function apply_mask_strategy (line 175) | def apply_mask_strategy(z, refs_x, mask_strategys, loop_i, align=None): function append_generated (line 207) | def append_generated(vae, generated_video, refs_x, mask_strategy, loop_i... function dframe_to_frame (line 224) | def dframe_to_frame(num): function get_openai_response (line 247) | def get_openai_response(sys_prompt, usr_prompt, model="gpt-4o"): function get_random_prompt_by_openai (line 271) | def get_random_prompt_by_openai(): function refine_prompt_by_openai (line 281) | def refine_prompt_by_openai(prompt): function has_openai_key (line 291) | def has_openai_key(): function refine_prompts_by_openai (line 295) | def refine_prompts_by_openai(prompts): function add_watermark (line 312) | def add_watermark( FILE: Open-Sora/opensora/utils/lr_scheduler.py class LinearWarmupLR (line 4) | class LinearWarmupLR(_LRScheduler): method __init__ (line 14) | def __init__(self, optimizer, warmup_steps: int = 0, last_epoch: int =... method get_lr (line 18) | def get_lr(self): FILE: Open-Sora/opensora/utils/misc.py function is_distributed (line 21) | def is_distributed(): function is_main_process (line 25) | def is_main_process(): function get_world_size (line 29) | def get_world_size(): function create_logger (line 36) | def create_logger(logging_dir=None): function get_logger (line 60) | def get_logger(): function print_rank (line 64) | def print_rank(var_name, var_value, rank=0): function print_0 (line 69) | def print_0(*args, **kwargs): function create_tensorboard_writer (line 74) | def create_tensorboard_writer(exp_dir): function format_numel_str (line 88) | def format_numel_str(numel: int) -> str: function get_timestamp (line 102) | def get_timestamp(): function format_time (line 107) | def format_time(seconds): class BColors (line 140) | class BColors: function requires_grad (line 157) | def requires_grad(model: torch.nn.Module, flag: bool = True) -> None: function all_reduce_mean (line 165) | def all_reduce_mean(tensor: torch.Tensor) -> torch.Tensor: function get_model_numel (line 171) | def get_model_numel(model: torch.nn.Module) -> Tuple[int, int]: function count_params (line 181) | def count_params(model): function to_tensor (line 185) | def to_tensor(data): function to_ndarray (line 210) | def to_ndarray(data): function to_torch_dtype (line 225) | def to_torch_dtype(dtype): function _ntuple (line 246) | def _ntuple(n): function convert_SyncBN_to_BN2d (line 262) | def convert_SyncBN_to_BN2d(model_cfg): function get_topk (line 271) | def get_topk(x, dim=4, k=5): function param_sigmoid (line 277) | def param_sigmoid(x, alpha): function inverse_param_sigmoid (line 282) | def inverse_param_sigmoid(x, alpha, eps=1e-5): function inverse_sigmoid (line 289) | def inverse_sigmoid(x, eps=1e-5): function count_columns (line 313) | def count_columns(df, columns): function try_import (line 326) | def try_import(name): function transpose (line 342) | def transpose(x): function all_exists (line 352) | def all_exists(paths): class Timer (line 361) | class Timer: method __init__ (line 362) | def __init__(self, name, log=False, coordinator: Optional[DistCoordina... method elapsed_time (line 370) | def elapsed_time(self): method __enter__ (line 373) | def __enter__(self): method __exit__ (line 378) | def __exit__(self, exc_type, exc_val, exc_tb): function get_tensor_memory (line 387) | def get_tensor_memory(tensor, human_readable=True): class FeatureSaver (line 394) | class FeatureSaver: method __init__ (line 395) | def __init__(self, save_dir, bin_size=10, start_bin=0): method update (line 403) | def update(self, data): method save (line 410) | def save(self): FILE: Open-Sora/opensora/utils/train_utils.py function create_colossalai_plugin (line 15) | def create_colossalai_plugin(plugin, dtype, grad_clip, sp_size, reduce_b... function update_ema (line 44) | def update_ema( class MaskGenerator (line 71) | class MaskGenerator: method __init__ (line 72) | def __init__(self, mask_ratios): method get_mask (line 104) | def get_mask(self, x): method get_masks (line 162) | def get_masks(self, x): FILE: Open-Sora/scripts/inference.py function main (line 37) | def main(): FILE: Open-Sora/scripts/inference_vae.py function main (line 18) | def main(): FILE: Open-Sora/scripts/misc/extract_feat.py function main (line 16) | def main(): FILE: Open-Sora/setup.py function fetch_requirements (line 6) | def fetch_requirements(paths) -> List[str]: function fetch_readme (line 25) | def fetch_readme() -> str: FILE: Open-Sora/tests/test_attn.py function run_attn (line 14) | def run_attn(enable_flash_attn: bool): FILE: Open-Sora/tests/test_lr_scheduler.py function test_lr_scheduler (line 9) | def test_lr_scheduler(): FILE: Open-Sora/tools/caption/acceleration/llava/policies/llama.py class LlavaLlamaPolicy (line 10) | class LlavaLlamaPolicy(Policy): method config_sanity_check (line 11) | def config_sanity_check(self): method preprocess (line 14) | def preprocess(self): method module_policy (line 26) | def module_policy(self) -> Dict[Union[str, nn.Module], ModulePolicyDes... method postprocess (line 77) | def postprocess(self): class LlavaLlamaForCausalLMPolicy (line 81) | class LlavaLlamaForCausalLMPolicy(LlavaLlamaPolicy): method module_policy (line 82) | def module_policy(self): FILE: Open-Sora/tools/caption/acceleration/llava/policies/mistral.py class LlavaMistralPolicy (line 11) | class LlavaMistralPolicy(Policy): method config_sanity_check (line 12) | def config_sanity_check(self): method preprocess (line 15) | def preprocess(self): method module_policy (line 27) | def module_policy(self) -> Dict[Union[str, nn.Module], ModulePolicyDes... method postprocess (line 91) | def postprocess(self): class LlavaMistralForCausalLMPolicy (line 95) | class LlavaMistralForCausalLMPolicy(LlavaMistralPolicy): method module_policy (line 96) | def module_policy(self): FILE: Open-Sora/tools/caption/camera_motion/camera_motion.py function transform (line 10) | def transform(vector): class CameraPredict (line 16) | class CameraPredict: method __init__ (line 17) | def __init__(self, device, submodules_list, factor=0.25): method infer (line 30) | def infer(self, video_path, save_video=False, save_dir="./saved_videos"): method transform_class (line 46) | def transform_class(self, vector, min_reso): # 768*0.05 method get_edge_point (line 62) | def get_edge_point(self, track): method get_edge_direction (line 71) | def get_edge_direction(self, track1, track2): method classify_top_down (line 84) | def classify_top_down(self, top, down): method classify_left_right (line 100) | def classify_left_right(self, left, right): method camera_classify (line 115) | def camera_classify(self, track1, track2): method predict (line 130) | def predict(self, video_path): function compute_camera_motion (line 138) | def compute_camera_motion(device, submodules_dict, video_paths, factor): FILE: Open-Sora/tools/caption/camera_motion/detect.py function process (line 11) | def process(paths: List[str], threshold: float) -> List[str]: function main (line 18) | def main(args): FILE: Open-Sora/tools/caption/camera_motion/utils.py function get_frame_indices (line 7) | def get_frame_indices(num_frames, vlen, sample="rand", fix_start=None, i... function load_video (line 48) | def load_video(video_path, data_transform=None, num_frames=None, return_... FILE: Open-Sora/tools/caption/camera_motion/visualizer.py function read_video_from_path (line 17) | def read_video_from_path(path): function draw_circle (line 29) | def draw_circle(rgb, coord, radius, color=(255, 0, 0), visible=True): function draw_line (line 44) | def draw_line(rgb, coord_y, coord_x, color, linewidth): function add_weighted (line 54) | def add_weighted(rgb, alpha, original, beta, gamma): class Visualizer (line 58) | class Visualizer: method __init__ (line 59) | def __init__( method visualize (line 83) | def visualize( method save_video (line 133) | def save_video(self, video, filename, writer=None, step=0): method draw_tracks_on_video (line 160) | def draw_tracks_on_video( method _draw_pred_tracks (line 277) | def _draw_pred_tracks( method _draw_gt_tracks (line 306) | def _draw_gt_tracks( FILE: Open-Sora/tools/caption/camera_motion_detect.py function apply (line 13) | def apply(df, func, **kwargs): function make_empty (line 28) | def make_empty(new_w, new_h): function get_type (line 40) | def get_type(mag, ang, zoom_in, tau_static=1.0, tau_zoom=(0.4, 0.6)): function get_video_type (line 58) | def get_video_type(frame_types): function process (line 79) | def process(path: str, frame_interval=15) -> str: function main (line 117) | def main(args): FILE: Open-Sora/tools/caption/caption_gpt4.py function to_base64 (line 13) | def to_base64(image): function get_caption (line 19) | def get_caption(frame, prompt, api_key): function main (line 45) | def main(args): FILE: Open-Sora/tools/caption/caption_llama3.py class CSVTextDataset (line 22) | class CSVTextDataset(Dataset): method __init__ (line 23) | def __init__(self, csv_path): method __len__ (line 28) | def __len__(self): method __getitem__ (line 31) | def __getitem__(self, idx): method set_rank_and_world_size (line 36) | def set_rank_and_world_size(self, rank, world_size): method write_to_csv (line 44) | def write_to_csv(self, output_file, data, new_key): function pad_left (line 56) | def pad_left(sequences, padding_value=0): function main (line 75) | def main(args): FILE: Open-Sora/tools/caption/caption_llava.py class NoPaddingDistributedSampler (line 27) | class NoPaddingDistributedSampler(DistributedSampler): method __init__ (line 28) | def __init__(self, dataset, num_replicas=None, rank=None, shuffle=True... method __iter__ (line 41) | def __iter__(self): function main (line 60) | def main(args): FILE: Open-Sora/tools/caption/pllava_dir/caption_pllava.py function pllava_answer (line 49) | def pllava_answer( function get_index (line 105) | def get_index(num_frames, num_segments): function load_video (line 131) | def load_video(video_path, num_frames, return_msg=False, resolution=336): function collate_fn (line 159) | def collate_fn(batch): class CSVDataset (line 163) | class CSVDataset(Dataset): method __init__ (line 164) | def __init__(self, csv_path, num_frames): method __len__ (line 169) | def __len__(self): method __getitem__ (line 172) | def __getitem__(self, idx): method set_rank_and_world_size (line 181) | def set_rank_and_world_size(self, rank, world_size): function parse_args (line 190) | def parse_args(): function load_model_and_dataset (line 245) | def load_model_and_dataset( function infer (line 276) | def infer( function run (line 302) | def run(rank, args, world_size, output_queue): function main (line 366) | def main(): FILE: Open-Sora/tools/caption/utils.py function read_file (line 59) | def read_file(input_path): class VideoTextDataset (line 68) | class VideoTextDataset(torch.utils.data.Dataset): method __init__ (line 69) | def __init__(self, csv_path, transform=None, num_frames=3, get_text_in... method getitem (line 81) | def getitem(self, index): method __len__ (line 114) | def __len__(self): method __getitem__ (line 117) | def __getitem__(self, index): function collate_fn (line 121) | def collate_fn(batch): class Timer (line 130) | class Timer: method __init__ (line 131) | def __init__(self): method __enter__ (line 136) | def __enter__(self): method __exit__ (line 140) | def __exit__(self, exc_type, exc_value, exc_tb): FILE: Open-Sora/tools/datasets/analyze.py function read_file (line 8) | def read_file(input_path): function parse_args (line 17) | def parse_args(): function plot_data (line 24) | def plot_data(data, column, bins, name): function plot_categorical_data (line 32) | def plot_categorical_data(data, column, name): function main (line 51) | def main(args): FILE: Open-Sora/tools/datasets/convert.py function scan_recursively (line 12) | def scan_recursively(root): function get_filelist (line 24) | def get_filelist(file_path, exts=None): function split_by_capital (line 48) | def split_by_capital(name): function process_imagenet (line 58) | def process_imagenet(root, split): function process_ucf101 (line 69) | def process_ucf101(root, split): function process_vidprom (line 82) | def process_vidprom(root, info): function process_general_images (line 95) | def process_general_images(root, output): function process_general_videos (line 108) | def process_general_videos(root, output): FILE: Open-Sora/tools/datasets/datautil.py function apply (line 30) | def apply(df, func, **kwargs): function get_video_length (line 43) | def get_video_length(cap, method="header"): function get_info_old (line 53) | def get_info_old(path): function get_info (line 77) | def get_info(path): function get_image_info (line 88) | def get_image_info(path, backend="pillow"): function get_video_info (line 117) | def get_video_info(path, backend="torchvision"): function remove_caption_prefix (line 174) | def remove_caption_prefix(caption): function merge_cmotion (line 215) | def merge_cmotion(caption, cmotion): function build_lang_detector (line 228) | def build_lang_detector(lang_to_detect): function basic_clean (line 251) | def basic_clean(text): function clean_caption (line 264) | def clean_caption(caption): function text_preprocessing (line 382) | def text_preprocessing(text, use_text_preprocessing: bool = True): function load_caption (line 397) | def load_caption(path, ext): function score_to_text (line 416) | def score_to_text(data): function read_file (line 440) | def read_file(input_path): function save_file (line 449) | def save_file(data, output_path): function read_data (line 461) | def read_data(input_paths): function main (line 490) | def main(args): function parse_args (line 685) | def parse_args(): function get_output_path (line 769) | def get_output_path(args, input_name): FILE: Open-Sora/tools/datasets/filter_panda10m.py function apply (line 22) | def apply(df, func, **kwargs): function basic_clean (line 28) | def basic_clean(text): function clean_caption (line 41) | def clean_caption(caption): function get_10m_set (line 159) | def get_10m_set(): function filter_panda10m_text (line 191) | def filter_panda10m_text(meta_path, text_set): function filter_panda10m_timestamp (line 212) | def filter_panda10m_timestamp(meta_path): function parse_args (line 248) | def parse_args(): FILE: Open-Sora/tools/datasets/split.py function split_by_bucket (line 10) | def split_by_bucket( FILE: Open-Sora/tools/datasets/transform.py function apply (line 23) | def apply(df, func, **kwargs): function get_new_path (line 29) | def get_new_path(path, input_dir, output): function resize (line 35) | def resize(path, length, input_dir, output): function rand_crop (line 56) | def rand_crop(path, input_dir, output): function main (line 79) | def main(args): function parse_args (line 104) | def parse_args(): FILE: Open-Sora/tools/datasets/utils.py function is_video (line 11) | def is_video(filename): function extract_frames (line 16) | def extract_frames( FILE: Open-Sora/tools/frame_interpolation/interpolation.py function init (line 29) | def init(): function get_input_video_from_path (line 50) | def get_input_video_from_path(input_path): function load_model (line 93) | def load_model(ckpt): function interpolater (line 105) | def interpolater(model, inputs, scale, padder, iters=1): function write (line 136) | def write(outputs, input_path, output_path, fps=30): function process (line 162) | def process( function parse_args (line 174) | def parse_args(): FILE: Open-Sora/tools/frame_interpolation/networks/amt_g.py class Model (line 10) | class Model(nn.Module): method __init__ (line 11) | def __init__(self, corr_radius=3, corr_lvls=4, num_flows=5, channels=[... method _get_updateblock (line 37) | def _get_updateblock(self, cdim, scale_factor=None): method _corr_scale_lookup (line 50) | def _corr_scale_lookup(self, corr_fn, coord, flow0, flow1, embt, downs... method forward (line 65) | def forward(self, img0, img1, embt, scale_factor=1.0, eval=False, **kw... FILE: Open-Sora/tools/frame_interpolation/networks/blocks/feat_enc.py class BottleneckBlock (line 5) | class BottleneckBlock(nn.Module): method __init__ (line 6) | def __init__(self, in_planes, planes, norm_fn="group", stride=1): method forward (line 50) | def forward(self, x): class ResidualBlock (line 62) | class ResidualBlock(nn.Module): method __init__ (line 63) | def __init__(self, in_planes, planes, norm_fn="group", stride=1): method forward (line 102) | def forward(self, x): class SmallEncoder (line 113) | class SmallEncoder(nn.Module): method __init__ (line 114) | def __init__(self, output_dim=128, norm_fn="batch", dropout=0.0): method _make_layer (line 153) | def _make_layer(self, dim, stride=1): method forward (line 161) | def forward(self, x): class BasicEncoder (line 186) | class BasicEncoder(nn.Module): method __init__ (line 187) | def __init__(self, output_dim=128, norm_fn="batch", dropout=0.0): method _make_layer (line 227) | def _make_layer(self, dim, stride=1): method forward (line 235) | def forward(self, x): class LargeEncoder (line 261) | class LargeEncoder(nn.Module): method __init__ (line 262) | def __init__(self, output_dim=128, norm_fn="batch", dropout=0.0): method _make_layer (line 303) | def _make_layer(self, dim, stride=1): method forward (line 311) | def forward(self, x): FILE: Open-Sora/tools/frame_interpolation/networks/blocks/ifrnet.py function resize (line 8) | def resize(x, scale_factor): function convrelu (line 12) | def convrelu(in_channels, out_channels, kernel_size=3, stride=1, padding... class ResBlock (line 19) | class ResBlock(nn.Module): method __init__ (line 20) | def __init__(self, in_channels, side_channels, bias=True): method forward (line 40) | def forward(self, x): class Encoder (line 57) | class Encoder(nn.Module): method __init__ (line 58) | def __init__(self, channels, large=False): method forward (line 70) | def forward(self, in_x): class InitDecoder (line 79) | class InitDecoder(nn.Module): method __init__ (line 80) | def __init__(self, in_ch, out_ch, skip_ch) -> None: method forward (line 88) | def forward(self, f0, f1, embt): class IntermediateDecoder (line 97) | class IntermediateDecoder(nn.Module): method __init__ (line 98) | def __init__(self, in_ch, out_ch, skip_ch) -> None: method forward (line 106) | def forward(self, ft_, f0, f1, flow0_in, flow1_in): FILE: Open-Sora/tools/frame_interpolation/networks/blocks/multi_flow.py function multi_flow_combine (line 9) | def multi_flow_combine(comb_block, img0, img1, flow0, flow1, mask=None, ... class MultiFlowDecoder (line 41) | class MultiFlowDecoder(nn.Module): method __init__ (line 42) | def __init__(self, in_ch, skip_ch, num_flows=3): method forward (line 51) | def forward(self, ft_, f0, f1, flow0, flow1): FILE: Open-Sora/tools/frame_interpolation/networks/blocks/raft.py function resize (line 6) | def resize(x, scale_factor): function bilinear_sampler (line 10) | def bilinear_sampler(img, coords, mask=False): function coords_grid (line 27) | def coords_grid(batch, ht, wd, device): class SmallUpdateBlock (line 33) | class SmallUpdateBlock(nn.Module): method __init__ (line 34) | def __init__(self, cdim, hidden_dim, flow_dim, corr_dim, fc_dim, corr_... method forward (line 64) | def forward(self, net, flow, corr): class BasicUpdateBlock (line 84) | class BasicUpdateBlock(nn.Module): method __init__ (line 85) | def __init__( method forward (line 128) | def forward(self, net, flow, corr): class BidirCorrBlock (line 148) | class BidirCorrBlock: method __init__ (line 149) | def __init__(self, fmap1, fmap2, num_levels=4, radius=4): method __call__ (line 171) | def __call__(self, coords0, coords1): method corr (line 206) | def corr(fmap1, fmap2): FILE: Open-Sora/tools/frame_interpolation/utils/dist_utils.py function get_world_size (line 6) | def get_world_size(): function get_global_rank (line 18) | def get_global_rank(): function get_local_rank (line 30) | def get_local_rank(): function get_master_ip (line 42) | def get_master_ip(): FILE: Open-Sora/tools/frame_interpolation/utils/flow_utils.py function warp (line 9) | def warp(img, flow): function make_colorwheel (line 20) | def make_colorwheel(): function flow_uv_to_colors (line 68) | def flow_uv_to_colors(u, v, convert_to_bgr=False): function flow_to_image (line 104) | def flow_to_image(flow_uv, clip_flow=None, convert_to_bgr=False): FILE: Open-Sora/tools/frame_interpolation/utils/utils.py class AverageMeter (line 14) | class AverageMeter: method __init__ (line 15) | def __init__(self): method reset (line 18) | def reset(self): method update (line 24) | def update(self, val, n=1): class AverageMeterGroups (line 31) | class AverageMeterGroups: method __init__ (line 32) | def __init__(self) -> None: method update (line 35) | def update(self, dict, n=1): method reset (line 41) | def reset(self, name=None): method avg (line 50) | def avg(self, name): class InputPadder (line 56) | class InputPadder: method __init__ (line 59) | def __init__(self, dims, divisor=16): method pad (line 65) | def pad(self, *inputs): method unpad (line 71) | def unpad(self, *inputs): method _unpad (line 77) | def _unpad(self, x): function img2tensor (line 83) | def img2tensor(img): function tensor2img (line 89) | def tensor2img(img_t): function seed_all (line 93) | def seed_all(seed): function read (line 100) | def read(file): function write (line 119) | def write(file, data): function readPFM (line 138) | def readPFM(file): function writePFM (line 176) | def writePFM(file, image, scale=1): function readFlow (line 206) | def readFlow(name): function readImage (line 224) | def readImage(name): function writeImage (line 234) | def writeImage(name, data): function writeFlow (line 240) | def writeFlow(name, flow): function readFloat (line 248) | def readFloat(name): function writeFloat (line 273) | def writeFloat(name, data): function check_dim_and_resize (line 299) | def check_dim_and_resize(tensor_list): FILE: Open-Sora/tools/scene_cut/convert_id_to_path.py function is_intact_video (line 17) | def is_intact_video(video_path, mode="moviepy", verbose=False, logger=No... function has_downloaded_success (line 50) | def has_downloaded_success(json_path): function parse_args (line 65) | def parse_args(): function main (line 76) | def main(): FILE: Open-Sora/tools/scene_cut/cut.py function print_log (line 17) | def print_log(s, logger=None): function process_single_row (line 24) | def process_single_row(row, args): function split_video (line 71) | def split_video( function parse_args (line 157) | def parse_args(): function main (line 178) | def main(): FILE: Open-Sora/tools/scene_cut/scene_detect.py function process_single_row (line 13) | def process_single_row(row): function parse_args (line 34) | def parse_args(): function main (line 43) | def main(): FILE: Open-Sora/tools/scoring/aesthetic/inference.py function merge_scores (line 30) | def merge_scores(gathered_list: list, meta: pd.DataFrame, column): class VideoTextDataset (line 53) | class VideoTextDataset(torch.utils.data.Dataset): method __init__ (line 54) | def __init__(self, meta_path, transform=None, num_frames=3): method __getitem__ (line 60) | def __getitem__(self, index): method __len__ (line 80) | def __len__(self): class MLP (line 84) | class MLP(nn.Module): method __init__ (line 85) | def __init__(self, input_size): method forward (line 99) | def forward(self, x): class AestheticScorer (line 103) | class AestheticScorer(nn.Module): method __init__ (line 104) | def __init__(self, input_size, device): method forward (line 112) | def forward(self, x): function parse_args (line 118) | def parse_args(): function main (line 131) | def main(): FILE: Open-Sora/tools/scoring/matching/inference.py function merge_scores (line 18) | def merge_scores(gathered_list: list, meta: pd.DataFrame, column): class VideoTextDataset (line 38) | class VideoTextDataset(torch.utils.data.Dataset): method __init__ (line 39) | def __init__(self, meta_path, transform): method __getitem__ (line 44) | def __getitem__(self, index): method __len__ (line 60) | def __len__(self): function parse_args (line 64) | def parse_args(): function main (line 74) | def main(): FILE: Open-Sora/tools/scoring/ocr/inference.py function merge_scores (line 22) | def merge_scores(gathered_list: list, meta: pd.DataFrame): class VideoTextDataset (line 39) | class VideoTextDataset(torch.utils.data.Dataset): method __init__ (line 40) | def __init__(self, meta_path, transform): method __getitem__ (line 52) | def __getitem__(self, index): method __len__ (line 74) | def __len__(self): function parse_args (line 78) | def parse_args(): function main (line 89) | def main(): FILE: Open-Sora/tools/scoring/optical_flow/inference.py function merge_scores (line 24) | def merge_scores(gathered_list: list, meta: pd.DataFrame, column): class VideoTextDataset (line 47) | class VideoTextDataset(torch.utils.data.Dataset): method __init__ (line 48) | def __init__(self, meta_path, frame_inds=[0, 10, 20, 30]): method __getitem__ (line 53) | def __getitem__(self, index): method __len__ (line 74) | def __len__(self): function parse_args (line 78) | def parse_args(): function main (line 88) | def main(): FILE: Open-Sora/tools/scoring/optical_flow/unimatch/attention.py function single_head_full_attention (line 8) | def single_head_full_attention(q, k, v): function single_head_full_attention_1d (line 19) | def single_head_full_attention_1d( function single_head_split_window_attention (line 48) | def single_head_split_window_attention( function single_head_split_window_attention_1d (line 115) | def single_head_split_window_attention_1d( class SelfAttnPropagation (line 178) | class SelfAttnPropagation(nn.Module): method __init__ (line 184) | def __init__( method forward (line 198) | def forward( method forward_local_window_attn (line 233) | def forward_local_window_attn( FILE: Open-Sora/tools/scoring/optical_flow/unimatch/backbone.py class ResidualBlock (line 6) | class ResidualBlock(nn.Module): method __init__ (line 7) | def __init__( method forward (line 33) | def forward(self, x): class CNNEncoder (line 44) | class CNNEncoder(nn.Module): method __init__ (line 45) | def __init__( method _make_layer (line 103) | def _make_layer(self, dim, stride=1, dilation=1, norm_layer=nn.Instanc... method forward (line 112) | def forward(self, x): FILE: Open-Sora/tools/scoring/optical_flow/unimatch/geometry.py function coords_grid (line 5) | def coords_grid(b, h, w, homogeneous=False, device=None): function generate_window_grid (line 24) | def generate_window_grid(h_min, h_max, w_min, w_max, len_h, len_w, devic... function normalize_coords (line 35) | def normalize_coords(coords, h, w): function bilinear_sample (line 41) | def bilinear_sample(img, sample_coords, mode="bilinear", padding_mode="z... function flow_warp (line 65) | def flow_warp(feature, flow, mask=False, padding_mode="zeros"): function forward_backward_consistency_check (line 74) | def forward_backward_consistency_check(fwd_flow, bwd_flow, alpha=0.01, b... function back_project (line 95) | def back_project(depth, intrinsics): function camera_transform (line 109) | def camera_transform(points_ref, extrinsics_ref=None, extrinsics_tgt=Non... function reproject (line 129) | def reproject(points_tgt, intrinsics, return_mask=False): function reproject_coords (line 158) | def reproject_coords( function compute_flow_with_depth_pose (line 175) | def compute_flow_with_depth_pose( FILE: Open-Sora/tools/scoring/optical_flow/unimatch/matching.py function global_correlation_softmax (line 7) | def global_correlation_softmax( function local_correlation_softmax (line 41) | def local_correlation_softmax( function local_correlation_with_flow (line 92) | def local_correlation_with_flow( function global_correlation_softmax_stereo (line 133) | def global_correlation_softmax_stereo( function local_correlation_softmax_stereo (line 163) | def local_correlation_softmax_stereo( function correlation_softmax_depth (line 219) | def correlation_softmax_depth( function warp_with_pose_depth_candidates (line 260) | def warp_with_pose_depth_candidates( FILE: Open-Sora/tools/scoring/optical_flow/unimatch/position.py class PositionEmbeddingSine (line 10) | class PositionEmbeddingSine(nn.Module): method __init__ (line 16) | def __init__(self, num_pos_feats=64, temperature=10000, normalize=True... method forward (line 27) | def forward(self, x): FILE: Open-Sora/tools/scoring/optical_flow/unimatch/reg_refine.py class FlowHead (line 6) | class FlowHead(nn.Module): method __init__ (line 7) | def __init__( method forward (line 19) | def forward(self, x): class SepConvGRU (line 25) | class SepConvGRU(nn.Module): method __init__ (line 26) | def __init__( method forward (line 43) | def forward(self, h, x): class BasicMotionEncoder (line 61) | class BasicMotionEncoder(nn.Module): method __init__ (line 62) | def __init__( method forward (line 75) | def forward(self, flow, corr): class BasicUpdateBlock (line 86) | class BasicUpdateBlock(nn.Module): method __init__ (line 87) | def __init__( method forward (line 120) | def forward(self, net, inp, corr, flow): FILE: Open-Sora/tools/scoring/optical_flow/unimatch/transformer.py class TransformerLayer (line 13) | class TransformerLayer(nn.Module): method __init__ (line 14) | def __init__( method forward (line 47) | def forward( class TransformerBlock (line 173) | class TransformerBlock(nn.Module): method __init__ (line 176) | def __init__( method forward (line 197) | def forward( class FeatureTransformer (line 239) | class FeatureTransformer(nn.Module): method __init__ (line 240) | def __init__( method forward (line 267) | def forward( FILE: Open-Sora/tools/scoring/optical_flow/unimatch/trident_conv.py class MultiScaleTridentConv (line 10) | class MultiScaleTridentConv(nn.Module): method __init__ (line 11) | def __init__( method forward (line 62) | def forward(self, inputs): FILE: Open-Sora/tools/scoring/optical_flow/unimatch/unimatch.py class UniMatch (line 21) | class UniMatch(nn.Module): method __init__ (line 22) | def __init__( method extract_feature (line 74) | def extract_feature(self, img0, img1): method upsample_flow (line 91) | def upsample_flow(self, flow, feature, bilinear=False, upsample_factor... method forward (line 104) | def forward( FILE: Open-Sora/tools/scoring/optical_flow/unimatch/utils.py function generate_window_grid (line 7) | def generate_window_grid(h_min, h_max, w_min, w_max, len_h, len_w, devic... function normalize_coords (line 18) | def normalize_coords(coords, h, w): function normalize_img (line 24) | def normalize_img(img0, img1): function split_feature (line 35) | def split_feature( function merge_splits (line 70) | def merge_splits( function generate_shift_window_attn_mask (line 95) | def generate_shift_window_attn_mask( function feature_add_position (line 119) | def feature_add_position(feature0, feature1, attn_splits, feature_channe... function upsample_flow_with_mask (line 142) | def upsample_flow_with_mask(flow, up_mask, upsample_factor, is_depth=Fal... function split_feature_1d (line 161) | def split_feature_1d( function merge_splits_1d (line 177) | def merge_splits_1d( function window_partition_1d (line 191) | def window_partition_1d(x, window_size_w): function generate_shift_window_attn_mask_1d (line 205) | def generate_shift_window_attn_mask_1d(input_w, window_size_w, shift_siz... FILE: PixArt-alpha-ToCa-tools/clip_score.py function load_prompts (line 10) | def load_prompts(txt_file): function find_image_file (line 17) | def find_image_file(image_folder, prompt): function load_images (line 32) | def load_images(image_folder, prompts_batch): function process_batch (line 57) | def process_batch(prompts_batch, image_folder, model_path, device): function chunked (line 79) | def chunked(iterable, batch_size): function main_worker (line 85) | def main_worker(rank, prompts, image_folder, model_path, device, batch_s... function main (line 99) | def main(prompt_file="prompts.txt", image_folder="images", batch_size=64... FILE: PixArt-alpha-ToCa/app/app.py function apply_style (line 100) | def apply_style(style_name: str, positive: str, negative: str = "") -> T... function save_image (line 132) | def save_image(img): function randomize_seed_fn (line 141) | def randomize_seed_fn(seed: int, randomize_seed: bool) -> int: function generate (line 147) | def generate( FILE: PixArt-alpha-ToCa/app/app_512.py function apply_style (line 102) | def apply_style(style_name: str, positive: str, negative: str = "") -> T... function prepare_prompt_hw (line 135) | def prepare_prompt_hw(height, width, ratios): function save_image (line 142) | def save_image(img): function randomize_seed_fn (line 151) | def randomize_seed_fn(seed: int, randomize_seed: bool) -> int: function classify_height_width_bin (line 157) | def classify_height_width_bin(height: int, width: int, ratios: dict): function generate (line 164) | def generate( FILE: PixArt-alpha-ToCa/app/app_controlnet.py function ndarr_image (line 57) | def ndarr_image(tensor: Union[torch.Tensor, List[torch.Tensor]], **kwarg... function apply_style (line 125) | def apply_style(style_name: str, positive: str, negative: str = "") -> T... function save_image (line 132) | def save_image(img): function randomize_seed_fn (line 141) | def randomize_seed_fn(seed: int, randomize_seed: bool) -> int: function generate (line 148) | def generate( function get_args (line 255) | def get_args(): FILE: PixArt-alpha-ToCa/app/app_lcm.py function apply_style (line 98) | def apply_style(style_name: str, positive: str, negative: str = "") -> T... function get_args (line 105) | def get_args(): function save_image (line 147) | def save_image(img): function randomize_seed_fn (line 156) | def randomize_seed_fn(seed: int, randomize_seed: bool) -> int: function generate (line 162) | def generate( FILE: PixArt-alpha-ToCa/diffusion/data/builder.py function set_data_root (line 15) | def set_data_root(data_root): function get_data_path (line 20) | def get_data_path(data_dir): function build_dataset (line 27) | def build_dataset(cfg, resolution=224, **kwargs): function build_dataloader (line 40) | def build_dataloader(dataset, batch_size=256, num_workers=4, shuffle=Tru... FILE: PixArt-alpha-ToCa/diffusion/data/datasets/Dreambooth.py class DreamBooth (line 18) | class DreamBooth(Dataset): method __init__ (line 19) | def __init__(self, method __getitem__ (line 53) | def __getitem__(self, index): method vae_feat_loader (line 57) | def vae_feat_loader(path): method load_ori_img (line 63) | def load_ori_img(self, img_path): method __len__ (line 72) | def __len__(self): method __getattr__ (line 75) | def __getattr__(self, name): method get_data_info (line 80) | def get_data_info(self, idx): FILE: PixArt-alpha-ToCa/diffusion/data/datasets/InternalData.py class InternalData (line 17) | class InternalData(Dataset): method __init__ (line 18) | def __init__(self, method getdata (line 71) | def getdata(self, index): method __getitem__ (line 97) | def __getitem__(self, idx): method get_data_info (line 106) | def get_data_info(self, idx): method vae_feat_loader (line 111) | def vae_feat_loader(path): method load_ori_img (line 117) | def load_ori_img(self, img_path): method load_json (line 126) | def load_json(self, file_path): method sample_subset (line 132) | def sample_subset(self, ratio): method __len__ (line 136) | def __len__(self): method __getattr__ (line 139) | def __getattr__(self, name): FILE: PixArt-alpha-ToCa/diffusion/data/datasets/InternalData_ms.py function get_closest_ratio (line 13) | def get_closest_ratio(height: float, width: float, ratios: dict): class InternalDataMS (line 20) | class InternalDataMS(InternalData): method __init__ (line 21) | def __init__(self, method getdata (line 90) | def getdata(self, index): method __getitem__ (line 144) | def __getitem__(self, idx): FILE: PixArt-alpha-ToCa/diffusion/data/datasets/SA.py class SAM (line 15) | class SAM(Dataset): method __init__ (line 16) | def __init__(self, method getdata (line 65) | def getdata(self, idx): method __getitem__ (line 86) | def __getitem__(self, idx): method vae_feat_loader (line 96) | def vae_feat_loader(path): method sample_subset (line 103) | def sample_subset(self, ratio): method __len__ (line 108) | def __len__(self): FILE: PixArt-alpha-ToCa/diffusion/data/datasets/pixart_control.py class InternalDataHed (line 16) | class InternalDataHed(Dataset): method __init__ (line 17) | def __init__(self, method getdata (line 84) | def getdata(self, index): method __getitem__ (line 111) | def __getitem__(self, idx): method get_data_info (line 121) | def get_data_info(self, idx): method vae_feat_loader (line 126) | def vae_feat_loader(path): method vae_feat_loader_npz (line 133) | def vae_feat_loader_npz(path): method load_json (line 139) | def load_json(self, file_path): method sample_subset (line 145) | def sample_subset(self, ratio): method __len__ (line 149) | def __len__(self): method __getattr__ (line 152) | def __getattr__(self, name): FILE: PixArt-alpha-ToCa/diffusion/data/datasets/utils.py function get_chunks (line 82) | def get_chunks(lst, n): FILE: PixArt-alpha-ToCa/diffusion/data/transforms.py function register_transform (line 6) | def register_transform(transform): function get_transform (line 13) | def get_transform(type, resolution): function default_train (line 21) | def default_train(n_px): FILE: PixArt-alpha-ToCa/diffusion/dpm_solver.py function DPMS (line 6) | def DPMS(model, condition, uncondition, cfg_scale, model_type='noise', n... FILE: PixArt-alpha-ToCa/diffusion/iddpm.py function IDDPM (line 9) | def IDDPM( FILE: PixArt-alpha-ToCa/diffusion/lcm_scheduler.py class LCMSchedulerOutput (line 32) | class LCMSchedulerOutput(BaseOutput): function betas_for_alpha_bar (line 49) | def betas_for_alpha_bar( function rescale_zero_terminal_snr (line 89) | def rescale_zero_terminal_snr(betas): class LCMScheduler (line 122) | class LCMScheduler(SchedulerMixin, ConfigMixin): method __init__ (line 176) | def __init__( method scale_model_input (line 229) | def scale_model_input(self, sample: torch.FloatTensor, timestep: Optio... method _get_variance (line 244) | def _get_variance(self, timestep, prev_timestep): method _threshold_sample (line 253) | def _threshold_sample(self, sample: torch.FloatTensor) -> torch.FloatT... method set_timesteps (line 286) | def set_timesteps(self, num_inference_steps: int, lcm_origin_steps: in... method get_scalings_for_boundary_condition_discrete (line 311) | def get_scalings_for_boundary_condition_discrete(self, t): method step (line 319) | def step( method add_noise (line 411) | def add_noise( method get_velocity (line 434) | def get_velocity( method __len__ (line 453) | def __len__(self): FILE: PixArt-alpha-ToCa/diffusion/model/builder.py function build_model (line 8) | def build_model(cfg, use_grad_checkpoint=False, use_fp32_attention=False... FILE: PixArt-alpha-ToCa/diffusion/model/cache_functions/attention.py function cached_attention_forward (line 8) | def cached_attention_forward( FILE: PixArt-alpha-ToCa/diffusion/model/cache_functions/cache_cutfresh.py function cache_cutfresh (line 5) | def cache_cutfresh(cache_dic, tokens, current): function local_selection_with_bonus (line 46) | def local_selection_with_bonus(score, bonus_ratio, grid_size=2): FILE: PixArt-alpha-ToCa/diffusion/model/cache_functions/cache_init.py function cache_init (line 1) | def cache_init(model_kwargs, num_steps): FILE: PixArt-alpha-ToCa/diffusion/model/cache_functions/force_init.py function force_init (line 3) | def force_init(cache_dic, current, tokens): FILE: PixArt-alpha-ToCa/diffusion/model/cache_functions/force_scheduler.py function force_scheduler (line 2) | def force_scheduler(cache_dic, current): FILE: PixArt-alpha-ToCa/diffusion/model/cache_functions/fresh_ratio_scheduler.py function fresh_ratio_scheduler (line 2) | def fresh_ratio_scheduler(cache_dic, current): FILE: PixArt-alpha-ToCa/diffusion/model/cache_functions/global_force_fresh.py function global_force_fresh (line 2) | def global_force_fresh(cache_dic, current): FILE: PixArt-alpha-ToCa/diffusion/model/cache_functions/score_evaluate.py function score_evaluate (line 4) | def score_evaluate(cache_dic, tokens, current) -> torch.Tensor: FILE: PixArt-alpha-ToCa/diffusion/model/cache_functions/scores.py function attn_score (line 5) | def attn_score(cache_dic, current): function similarity_score (line 32) | def similarity_score(cache_dic, current, tokens): function norm_score (line 37) | def norm_score(cache_dic, current, tokens): FILE: PixArt-alpha-ToCa/diffusion/model/cache_functions/token_merge.py function token_merge (line 2) | def token_merge(cache_dic, tokens, current, fresh_indices, stale_indices): FILE: PixArt-alpha-ToCa/diffusion/model/cache_functions/update_cache.py function update_cache (line 2) | def update_cache(fresh_indices, fresh_tokens, cache_dic, current, fresh_... FILE: PixArt-alpha-ToCa/diffusion/model/diffusion_utils.py function normal_kl (line 10) | def normal_kl(mean1, logvar1, mean2, logvar2): function approx_standard_normal_cdf (line 42) | def approx_standard_normal_cdf(x): function continuous_gaussian_log_likelihood (line 50) | def continuous_gaussian_log_likelihood(x, *, means, log_scales): function discretized_gaussian_log_likelihood (line 66) | def discretized_gaussian_log_likelihood(x, *, means, log_scales): FILE: PixArt-alpha-ToCa/diffusion/model/dpm_solver.py class NoiseScheduleVP (line 5) | class NoiseScheduleVP: method __init__ (line 6) | def __init__( method numerical_clip_alpha (line 115) | def numerical_clip_alpha(self, log_alphas, clipped_lambda=-5.1): method marginal_log_mean_coeff (line 128) | def marginal_log_mean_coeff(self, t): method marginal_alpha (line 138) | def marginal_alpha(self, t): method marginal_std (line 144) | def marginal_std(self, t): method marginal_lambda (line 150) | def marginal_lambda(self, t): method inverse_lambda (line 158) | def inverse_lambda(self, lamb): function model_wrapper (line 173) | def model_wrapper( class DPM_Solver (line 340) | class DPM_Solver: method __init__ (line 341) | def __init__( method dynamic_thresholding_fn (line 419) | def dynamic_thresholding_fn(self, x0, t): method noise_prediction_fn (line 430) | def noise_prediction_fn(self, x, t, current, cache_dic): method data_prediction_fn (line 436) | def data_prediction_fn(self, x, t, current, cache_dic): method model_fn (line 447) | def model_fn(self, x, t, current, cache_dic): method get_time_steps (line 456) | def get_time_steps(self, skip_type, t_T, t_0, N, device): method get_orders_and_timesteps_for_singlestep_solver (line 492) | def get_orders_and_timesteps_for_singlestep_solver(self, steps, order,... method denoise_to_zero_fn (line 552) | def denoise_to_zero_fn(self, x, s): method dpm_solver_first_update (line 558) | def dpm_solver_first_update(self, x, s, t, current, cache_dic, model_s... method singlestep_dpm_solver_second_update (line 598) | def singlestep_dpm_solver_second_update(self, x, s, t, current, cache_... method singlestep_dpm_solver_third_update (line 683) | def singlestep_dpm_solver_third_update(self, x, s, t, current, cache_d... method multistep_dpm_solver_second_update (line 809) | def multistep_dpm_solver_second_update(self, x, model_prev_list, t_pre... method multistep_dpm_solver_third_update (line 870) | def multistep_dpm_solver_third_update(self, x, model_prev_list, t_prev... method singlestep_dpm_solver_update (line 922) | def singlestep_dpm_solver_update(self, x, s, t, current, cache_dic, or... method multistep_dpm_solver_update (line 951) | def multistep_dpm_solver_update(self, x, model_prev_list, t_prev_list,... method dpm_solver_adaptive (line 975) | def dpm_solver_adaptive(self, x, order, t_T, t_0, h_init=0.05, atol=0.... method add_noise (line 1040) | def add_noise(self, x, t, noise=None): method inverse (line 1057) | def inverse(self, x, steps=20, t_start=None, t_end=None, order=2, skip... method sample (line 1073) | def sample(self, x, steps=20, t_start=None, t_end=None, order=2, skip_... function interpolate_fn (line 1292) | def interpolate_fn(x, xp, yp): function expand_dims (line 1333) | def expand_dims(v, dims): FILE: PixArt-alpha-ToCa/diffusion/model/edm_sample.py function edm_sampler (line 11) | def edm_sampler( function ablation_sampler (line 54) | def ablation_sampler( FILE: PixArt-alpha-ToCa/diffusion/model/gaussian_diffusion.py function mean_flat (line 17) | def mean_flat(tensor): class ModelMeanType (line 24) | class ModelMeanType(enum.Enum): class ModelVarType (line 34) | class ModelVarType(enum.Enum): class LossType (line 47) | class LossType(enum.Enum): method is_vb (line 55) | def is_vb(self): function _warmup_beta (line 59) | def _warmup_beta(beta_start, beta_end, num_diffusion_timesteps, warmup_f... function get_beta_schedule (line 66) | def get_beta_schedule(beta_schedule, *, beta_start, beta_end, num_diffus... function get_named_beta_schedule (line 99) | def get_named_beta_schedule(schedule_name, num_diffusion_timesteps): function betas_for_alpha_bar (line 126) | def betas_for_alpha_bar(num_diffusion_timesteps, alpha_bar, max_beta=0.9... class GaussianDiffusion (line 145) | class GaussianDiffusion: method __init__ (line 154) | def __init__( method q_mean_variance (line 208) | def q_mean_variance(self, x_start, t): method q_sample (line 220) | def q_sample(self, x_start, t, noise=None): method q_posterior_mean_variance (line 237) | def q_posterior_mean_variance(self, x_start, x_t, t): method p_mean_variance (line 259) | def p_mean_variance(self, model, x, t, current, cache_dic, clip_denois... method _predict_xstart_from_eps (line 340) | def _predict_xstart_from_eps(self, x_t, t, eps): method _predict_eps_from_xstart (line 347) | def _predict_eps_from_xstart(self, x_t, t, pred_xstart): method condition_mean (line 352) | def condition_mean(self, cond_fn, p_mean_var, x, t, model_kwargs=None): method condition_score (line 363) | def condition_score(self, cond_fn, p_mean_var, x, t, model_kwargs=None): method p_sample (line 381) | def p_sample( method p_sample_loop (line 428) | def p_sample_loop( method p_sample_loop_progressive (line 473) | def p_sample_loop_progressive( method ddim_sample (line 524) | def ddim_sample( method ddim_reverse_sample (line 573) | def ddim_reverse_sample( method ddim_sample_loop (line 611) | def ddim_sample_loop( method ddim_sample_loop_progressive (line 644) | def ddim_sample_loop_progressive( method _vb_terms_bpd (line 690) | def _vb_terms_bpd( method training_losses (line 723) | def training_losses(self, model, x_start, timestep, model_kwargs=None,... method training_losses_diffusers (line 831) | def training_losses_diffusers(self, model, x_start, timestep, model_kw... method _extracted_from_training_losses_diffusers (line 925) | def _extracted_from_training_losses_diffusers(self, x_t, output, t): method _prior_bpd (line 931) | def _prior_bpd(self, x_start): method calc_bpd_loop (line 947) | def calc_bpd_loop(self, model, x_start, clip_denoised=True, model_kwar... function _extract_into_tensor (line 1003) | def _extract_into_tensor(arr, timesteps, broadcast_shape): FILE: PixArt-alpha-ToCa/diffusion/model/hed.py class DoubleConvBlock (line 27) | class DoubleConvBlock(nn.Module): method __init__ (line 28) | def __init__(self, input_channel, output_channel, layer_number): method forward (line 36) | def forward(self, x, down_sampling=False): class ControlNetHED_Apache2 (line 46) | class ControlNetHED_Apache2(nn.Module): method __init__ (line 47) | def __init__(self): method forward (line 56) | def forward(self, x): class InternData (line 66) | class InternData(Dataset): method __init__ (line 67) | def __init__(self): method __len__ (line 78) | def __len__(self): method getdata (line 81) | def getdata(self, idx): method __getitem__ (line 88) | def __getitem__(self, idx): class HEDdetector (line 98) | class HEDdetector(nn.Module): method __init__ (line 99) | def __init__(self, feature=True, vae=None): method forward (line 115) | def forward(self, input_image): function main (line 130) | def main(): FILE: PixArt-alpha-ToCa/diffusion/model/llava/llava_mpt.py class LlavaMPTConfig (line 39) | class LlavaMPTConfig(MPTConfig): class LlavaMPTModel (line 43) | class LlavaMPTModel(MPTModel): method __init__ (line 46) | def __init__(self, config: MPTConfig, mm_vision_tower=None, mm_hidden_... method initialize_vision_modules (line 57) | def initialize_vision_modules(self, vision_tower, mm_vision_select_layer, method forward (line 91) | def forward(self, input_ids: torch.LongTensor, past_key_values: Option... class LlavaMPTForCausalLM (line 169) | class LlavaMPTForCausalLM(MPTForCausalLM): method __init__ (line 173) | def __init__(self, config): method get_model (line 189) | def get_model(self): method _set_gradient_checkpointing (line 192) | def _set_gradient_checkpointing(self, module, value=False): method forward (line 196) | def forward(self, input_ids: torch.LongTensor, past_key_values: Option... method prepare_inputs_for_generation (line 212) | def prepare_inputs_for_generation(self, input_ids, past_key_values=Non... method initialize_vision_tokenizer (line 232) | def initialize_vision_tokenizer(self, mm_use_im_start_end, tokenizer, ... method _extracted_from_initialize_vision_tokenizer_14 (line 271) | def _extracted_from_initialize_vision_tokenizer_14(self, num_new_tokens): FILE: PixArt-alpha-ToCa/diffusion/model/llava/mpt/attention.py function _reset_is_causal (line 11) | def _reset_is_causal(num_query_tokens: int, num_key_tokens: int, origina... function scaled_multihead_dot_product_attention (line 19) | def scaled_multihead_dot_product_attention(query, key, value, n_heads, s... function check_valid_inputs (line 55) | def check_valid_inputs(*tensors, valid_dtypes=None): function flash_attn_fn (line 64) | def flash_attn_fn(query, key, value, n_heads, softmax_scale=None, attn_b... function triton_flash_attn_fn (line 91) | def triton_flash_attn_fn(query, key, value, n_heads, softmax_scale=None,... class MultiheadAttention (line 118) | class MultiheadAttention(nn.Module): method __init__ (line 125) | def __init__(self, d_model: int, n_heads: int, attn_impl: str='triton'... method forward (line 157) | def forward(self, x, past_key_value=None, attn_bias=None, attention_ma... class MultiQueryAttention (line 177) | class MultiQueryAttention(nn.Module): method __init__ (line 184) | def __init__(self, d_model: int, n_heads: int, attn_impl: str='triton'... method forward (line 217) | def forward(self, x, past_key_value=None, attn_bias=None, attention_ma... function attn_bias_shape (line 237) | def attn_bias_shape(attn_impl, n_heads, seq_len, alibi, prefix_lm, causa... function build_attn_bias (line 251) | def build_attn_bias(attn_impl, attn_bias, n_heads, seq_len, causal=False... function gen_slopes (line 262) | def gen_slopes(n_heads, alibi_bias_max=8, device=None): function build_alibi_bias (line 271) | def build_alibi_bias(n_heads, seq_len, full=False, alibi_bias_max=8, dev... FILE: PixArt-alpha-ToCa/diffusion/model/llava/mpt/blocks.py class MPTMLP (line 8) | class MPTMLP(nn.Module): method __init__ (line 10) | def __init__(self, d_model: int, expansion_ratio: int, device: Optiona... method forward (line 17) | def forward(self, x): class MPTBlock (line 20) | class MPTBlock(nn.Module): method __init__ (line 22) | def __init__(self, d_model: int, n_heads: int, expansion_ratio: int, a... method forward (line 47) | def forward(self, x: torch.Tensor, past_key_value: Optional[Tuple[torc... FILE: PixArt-alpha-ToCa/diffusion/model/llava/mpt/configuration_mpt.py class MPTConfig (line 7) | class MPTConfig(PretrainedConfig): method __init__ (line 10) | def __init__(self, d_model: int=2048, n_heads: int=16, n_layers: int=2... method _set_config_defaults (line 90) | def _set_config_defaults(self, config, config_defaults): method _validate_config (line 96) | def _validate_config(self): FILE: PixArt-alpha-ToCa/diffusion/model/llava/mpt/modeling_mpt.py class MPTPreTrainedModel (line 23) | class MPTPreTrainedModel(PreTrainedModel): class MPTModel (line 27) | class MPTModel(MPTPreTrainedModel): method __init__ (line 29) | def __init__(self, config: MPTConfig): method get_input_embeddings (line 69) | def get_input_embeddings(self): method set_input_embeddings (line 72) | def set_input_embeddings(self, value): method _attn_bias (line 76) | def _attn_bias(self, device, dtype, attention_mask: Optional[torch.Byt... method _apply_prefix_mask (line 106) | def _apply_prefix_mask(self, attn_bias: torch.Tensor, prefix_mask: tor... method _apply_sequence_id (line 122) | def _apply_sequence_id(self, attn_bias: torch.Tensor, sequence_id: tor... method _extracted_from__apply_sequence_id_15 (line 131) | def _extracted_from__apply_sequence_id_15(self, attn_bias, cannot_atte... method forward (line 136) | def forward(self, input_ids: torch.LongTensor, past_key_values: Option... method param_init_fn (line 213) | def param_init_fn(self, module): method fsdp_wrap_fn (line 217) | def fsdp_wrap_fn(self, module): method activation_checkpointing_fn (line 220) | def activation_checkpointing_fn(self, module): class MPTForCausalLM (line 223) | class MPTForCausalLM(MPTPreTrainedModel): method __init__ (line 225) | def __init__(self, config: MPTConfig): method get_input_embeddings (line 240) | def get_input_embeddings(self): method set_input_embeddings (line 243) | def set_input_embeddings(self, value): method get_output_embeddings (line 246) | def get_output_embeddings(self): method set_output_embeddings (line 249) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 252) | def set_decoder(self, decoder): method get_decoder (line 255) | def get_decoder(self): method forward (line 258) | def forward(self, input_ids: torch.LongTensor, past_key_values: Option... method param_init_fn (line 274) | def param_init_fn(self, module): method fsdp_wrap_fn (line 278) | def fsdp_wrap_fn(self, module): method activation_checkpointing_fn (line 281) | def activation_checkpointing_fn(self, module): method prepare_inputs_for_generation (line 284) | def prepare_inputs_for_generation(self, input_ids, past_key_values=Non... method _reorder_cache (line 305) | def _reorder_cache(past_key_values, beam_idx): FILE: PixArt-alpha-ToCa/diffusion/model/llava/mpt/norm.py function _cast_if_autocast_enabled (line 3) | def _cast_if_autocast_enabled(tensor): class LPLayerNorm (line 14) | class LPLayerNorm(torch.nn.LayerNorm): method __init__ (line 16) | def __init__(self, normalized_shape, eps=1e-05, elementwise_affine=Tru... method forward (line 19) | def forward(self, x): function rms_norm (line 27) | def rms_norm(x, weight=None, eps=1e-05): class RMSNorm (line 31) | class RMSNorm(torch.nn.Module): method __init__ (line 33) | def __init__(self, normalized_shape, eps=1e-05, weight=True, dtype=Non... method forward (line 41) | def forward(self, x): class LPRMSNorm (line 44) | class LPRMSNorm(RMSNorm): method __init__ (line 46) | def __init__(self, normalized_shape, eps=1e-05, weight=True, dtype=Non... method forward (line 49) | def forward(self, x): FILE: PixArt-alpha-ToCa/diffusion/model/llava/mpt/param_init_fns.py function torch_default_param_init_fn_ (line 10) | def torch_default_param_init_fn_(module: nn.Module, verbose: int=0, **kw... function fused_init_helper_ (line 17) | def fused_init_helper_(module: nn.Module, init_fn_): function generic_param_init_fn_ (line 28) | def generic_param_init_fn_(module: nn.Module, init_fn_, n_layers: int, d... function _extracted_from_generic_param_init_fn__69 (line 120) | def _extracted_from_generic_param_init_fn__69(module, d_model, init_fn_): function _normal_init_ (line 129) | def _normal_init_(std, mean=0.0): function _normal_param_init_fn_ (line 132) | def _normal_param_init_fn_(module: nn.Module, std: float, n_layers: int,... function baseline_param_init_fn_ (line 139) | def baseline_param_init_fn_(module: nn.Module, init_std: float, n_layers... function small_param_init_fn_ (line 145) | def small_param_init_fn_(module: nn.Module, n_layers: int, d_model: int,... function neox_param_init_fn_ (line 150) | def neox_param_init_fn_(module: nn.Module, n_layers: int, d_model: int, ... function kaiming_uniform_param_init_fn_ (line 163) | def kaiming_uniform_param_init_fn_(module: nn.Module, n_layers: int, d_m... function kaiming_normal_param_init_fn_ (line 172) | def kaiming_normal_param_init_fn_(module: nn.Module, n_layers: int, d_mo... function xavier_uniform_param_init_fn_ (line 181) | def xavier_uniform_param_init_fn_(module: nn.Module, n_layers: int, d_mo... function xavier_normal_param_init_fn_ (line 190) | def xavier_normal_param_init_fn_(module: nn.Module, n_layers: int, d_mod... FILE: PixArt-alpha-ToCa/diffusion/model/nets/PixArt.py class PixArtBlock (line 26) | class PixArtBlock(nn.Module): method __init__ (line 31) | def __init__(self, hidden_size, num_heads, mlp_ratio=4.0, drop_path=0.... method forward (line 47) | def forward(self, x, y, t, current, cache_dic, mask=None, **kwargs): class PixArt (line 100) | class PixArt(nn.Module): method __init__ (line 105) | def __init__(self, input_size=32, patch_size=2, in_channels=4, hidden_... method forward (line 147) | def forward(self, x, timestep, current, cache_dic, y, mask=None, data_... method forward_with_dpmsolver (line 179) | def forward_with_dpmsolver(self, x, timestep, current, cache_dic, y, m... method forward_with_cfg (line 187) | def forward_with_cfg(self, x, timestep, current, cache_dic, y, cfg_sca... method unpatchify (line 202) | def unpatchify(self, x): method initialize_weights (line 216) | def initialize_weights(self): method dtype (line 253) | def dtype(self): function get_2d_sincos_pos_embed (line 257) | def get_2d_sincos_pos_embed(embed_dim, grid_size, cls_token=False, extra... function get_2d_sincos_pos_embed_from_grid (line 277) | def get_2d_sincos_pos_embed_from_grid(embed_dim, grid): function get_1d_sincos_pos_embed_from_grid (line 287) | def get_1d_sincos_pos_embed_from_grid(embed_dim, pos): function PixArt_XL_2 (line 311) | def PixArt_XL_2(**kwargs): FILE: PixArt-alpha-ToCa/diffusion/model/nets/PixArtMS.py class PatchEmbed (line 22) | class PatchEmbed(nn.Module): method __init__ (line 25) | def __init__( method forward (line 41) | def forward(self, x): class PixArtMSBlock (line 49) | class PixArtMSBlock(nn.Module): method __init__ (line 54) | def __init__(self, hidden_size, num_heads, mlp_ratio=4.0, drop_path=0.... method forward (line 70) | def forward(self, x, y, t, mask=None, **kwargs): class PixArtMS (line 85) | class PixArtMS(PixArt): method __init__ (line 90) | def __init__(self, input_size=32, patch_size=2, in_channels=4, hidden_... method forward (line 135) | def forward(self, x, timestep, y, mask=None, data_info=None, **kwargs): method forward_with_dpmsolver (line 171) | def forward_with_dpmsolver(self, x, timestep, y, data_info, **kwargs): method forward_with_cfg (line 179) | def forward_with_cfg(self, x, timestep, y, cfg_scale, data_info, **kwa... method unpatchify (line 193) | def unpatchify(self, x): method initialize (line 206) | def initialize(self): function PixArtMS_XL_2 (line 247) | def PixArtMS_XL_2(**kwargs): FILE: PixArt-alpha-ToCa/diffusion/model/nets/PixArt_blocks.py function modulate (line 22) | def modulate(x, shift, scale): function t2i_modulate (line 26) | def t2i_modulate(x, shift, scale): class MultiHeadCrossAttention (line 30) | class MultiHeadCrossAttention(nn.Module): method __init__ (line 31) | def __init__(self, d_model, num_heads, attn_drop=0., proj_drop=0., **b... method forward (line 45) | def forward(self, x, cond, mask=None): class WindowAttention (line 80) | class WindowAttention(Attention_): method __init__ (line 83) | def __init__( method forward (line 115) | def forward(self, x, mask=None): class Attention (line 142) | class Attention(Attention_): method forward (line 143) | def forward(self, x): class FinalLayer (line 162) | class FinalLayer(nn.Module): method __init__ (line 167) | def __init__(self, hidden_size, patch_size, out_channels): method forward (line 176) | def forward(self, x, c): class T2IFinalLayer (line 183) | class T2IFinalLayer(nn.Module): method __init__ (line 188) | def __init__(self, hidden_size, patch_size, out_channels): method forward (line 195) | def forward(self, x, t): class MaskFinalLayer (line 202) | class MaskFinalLayer(nn.Module): method __init__ (line 207) | def __init__(self, final_hidden_size, c_emb_size, patch_size, out_chan... method forward (line 215) | def forward(self, x, t): class DecoderLayer (line 222) | class DecoderLayer(nn.Module): method __init__ (line 227) | def __init__(self, hidden_size, decoder_hidden_size): method forward (line 235) | def forward(self, x, t): class TimestepEmbedder (line 245) | class TimestepEmbedder(nn.Module): method __init__ (line 250) | def __init__(self, hidden_size, frequency_embedding_size=256): method timestep_embedding (line 260) | def timestep_embedding(t, dim, max_period=10000): method forward (line 279) | def forward(self, t): method dtype (line 284) | def dtype(self): class SizeEmbedder (line 289) | class SizeEmbedder(TimestepEmbedder): method __init__ (line 294) | def __init__(self, hidden_size, frequency_embedding_size=256): method forward (line 304) | def forward(self, s, bs): method dtype (line 319) | def dtype(self): class LabelEmbedder (line 324) | class LabelEmbedder(nn.Module): method __init__ (line 329) | def __init__(self, num_classes, hidden_size, dropout_prob): method token_drop (line 336) | def token_drop(self, labels, force_drop_ids=None): method forward (line 347) | def forward(self, labels, train, force_drop_ids=None): class CaptionEmbedder (line 354) | class CaptionEmbedder(nn.Module): method __init__ (line 359) | def __init__(self, in_channels, hidden_size, uncond_prob, act_layer=nn... method token_drop (line 365) | def token_drop(self, caption, force_drop_ids=None): method forward (line 376) | def forward(self, caption, train, force_drop_ids=None): class CaptionEmbedderDoubleBr (line 386) | class CaptionEmbedderDoubleBr(nn.Module): method __init__ (line 391) | def __init__(self, in_channels, hidden_size, uncond_prob, act_layer=nn... method token_drop (line 398) | def token_drop(self, global_caption, caption, force_drop_ids=None): method forward (line 410) | def forward(self, caption, train, force_drop_ids=None): FILE: PixArt-alpha-ToCa/diffusion/model/nets/pixart_controlnet.py class ControlT2IDitBlockHalf (line 17) | class ControlT2IDitBlockHalf(Module): method __init__ (line 18) | def __init__(self, base_block: PixArtMSBlock, block_index: 0) -> None: method forward (line 38) | def forward(self, x, y, t, mask=None, c=None): class ControlPixArtHalf (line 54) | class ControlPixArtHalf(Module): method __init__ (line 56) | def __init__(self, base_model: PixArt, copy_blocks_num: int = 13) -> N... method __getattr__ (line 70) | def __getattr__(self, name: str) -> Tensor or Module: method forward_c (line 78) | def forward_c(self, c): method forward (line 85) | def forward(self, x, timestep, y, mask=None, data_info=None, c=None, *... method forward_with_dpmsolver (line 135) | def forward_with_dpmsolver(self, x, t, y, data_info, c, **kwargs): method forward_with_cfg (line 142) | def forward_with_cfg(self, x, t, y, cfg_scale, data_info, c, **kwargs): method load_state_dict (line 145) | def load_state_dict(self, state_dict: Mapping[str, Any], strict: bool ... method unpatchify (line 159) | def unpatchify(self, x): method dtype (line 174) | def dtype(self): class ControlPixArtMSHalf (line 180) | class ControlPixArtMSHalf(ControlPixArtHalf): method __init__ (line 182) | def __init__(self, base_model: PixArtMS, copy_blocks_num: int = 13) ->... method forward (line 185) | def forward(self, x, timestep, y, mask=None, data_info=None, c=None, *... FILE: PixArt-alpha-ToCa/diffusion/model/respace.py function space_timesteps (line 12) | def space_timesteps(num_timesteps, section_counts): class SpacedDiffusion (line 62) | class SpacedDiffusion(GaussianDiffusion): method __init__ (line 70) | def __init__(self, use_timesteps, **kwargs): method p_mean_variance (line 86) | def p_mean_variance( method training_losses (line 91) | def training_losses( method training_losses_diffusers (line 96) | def training_losses_diffusers( method condition_mean (line 101) | def condition_mean(self, cond_fn, *args, **kwargs): method condition_score (line 104) | def condition_score(self, cond_fn, *args, **kwargs): method _wrap_model (line 107) | def _wrap_model(self, model): method _scale_timesteps (line 114) | def _scale_timesteps(self, t): class _WrappedModel (line 119) | class _WrappedModel: method __init__ (line 120) | def __init__(self, model, timestep_map, original_num_steps): method __call__ (line 126) | def __call__(self, x, timestep, **kwargs): FILE: PixArt-alpha-ToCa/diffusion/model/sa_solver.py class NoiseScheduleVP (line 7) | class NoiseScheduleVP: method __init__ (line 8) | def __init__( method marginal_log_mean_coeff (line 103) | def marginal_log_mean_coeff(self, t): method marginal_alpha (line 116) | def marginal_alpha(self, t): method marginal_std (line 122) | def marginal_std(self, t): method marginal_lambda (line 128) | def marginal_lambda(self, t): method inverse_lambda (line 136) | def inverse_lambda(self, lamb): method edm_sigma (line 155) | def edm_sigma(self, t): method edm_inverse_sigma (line 158) | def edm_inverse_sigma(self, edmsigma): function model_wrapper (line 165) | def model_wrapper( class SASolver (line 316) | class SASolver: method __init__ (line 317) | def __init__( method dynamic_thresholding_fn (line 351) | def dynamic_thresholding_fn(self, x0, t=None): method noise_prediction_fn (line 362) | def noise_prediction_fn(self, x, t): method data_prediction_fn (line 368) | def data_prediction_fn(self, x, t): method model_fn (line 379) | def model_fn(self, x, t): method get_time_steps (line 389) | def get_time_steps(self, skip_type, t_T, t_0, N, order, device): method denoise_to_zero_fn (line 412) | def denoise_to_zero_fn(self, x, s): method get_coefficients_exponential_negative (line 418) | def get_coefficients_exponential_negative(self, order, interval_start,... method get_coefficients_exponential_positive (line 441) | def get_coefficients_exponential_positive(self, order, interval_start,... method lagrange_polynomial_coefficient (line 470) | def lagrange_polynomial_coefficient(self, order, lambda_list): method get_coefficients_fn (line 533) | def get_coefficients_fn(self, order, interval_start, interval_end, lam... method adams_bashforth_update (line 558) | def adams_bashforth_update(self, order, x, tau, model_prev_list, t_pre... method adams_moulton_update (line 596) | def adams_moulton_update(self, order, x, tau, model_prev_list, t_prev_... method adams_bashforth_update_few_steps (line 636) | def adams_bashforth_update_few_steps(self, order, x, tau, model_prev_l... method adams_moulton_update_few_steps (line 690) | def adams_moulton_update_few_steps(self, order, x, tau, model_prev_lis... method sample_few_steps (line 743) | def sample_few_steps(self, x, tau, steps=5, t_start=None, t_end=None, ... method sample_more_steps (line 891) | def sample_more_steps(self, x, tau, steps=20, t_start=None, t_end=None... method sample (line 1044) | def sample(self, mode, x, tau, steps, t_start=None, t_end=None, skip_t... function interpolate_fn (line 1077) | def interpolate_fn(x, xp, yp): function expand_dims (line 1118) | def expand_dims(v, dims): FILE: PixArt-alpha-ToCa/diffusion/model/t5.py class T5Embedder (line 13) | class T5Embedder: method __init__ (line 18) | def __init__(self, device, dir_or_name='t5-v1_1-xxl', *, local_cache=F... method get_text_embeddings (line 90) | def get_text_embeddings(self, texts): method text_preprocessing (line 113) | def text_preprocessing(self, text): method basic_clean (line 123) | def basic_clean(text): method clean_caption (line 128) | def clean_caption(self, caption): FILE: PixArt-alpha-ToCa/diffusion/model/timestep_sampler.py function create_named_schedule_sampler (line 13) | def create_named_schedule_sampler(name, diffusion): class ScheduleSampler (line 27) | class ScheduleSampler(ABC): method weights (line 38) | def weights(self): method sample (line 44) | def sample(self, batch_size, device): class UniformSampler (line 62) | class UniformSampler(ScheduleSampler): method __init__ (line 63) | def __init__(self, diffusion): method weights (line 67) | def weights(self): class LossAwareSampler (line 71) | class LossAwareSampler(ScheduleSampler): method update_with_local_losses (line 72) | def update_with_local_losses(self, local_ts, local_losses): method update_with_all_losses (line 106) | def update_with_all_losses(self, ts, losses): class LossSecondMomentResampler (line 120) | class LossSecondMomentResampler(LossAwareSampler): method __init__ (line 121) | def __init__(self, diffusion, history_per_term=10, uniform_prob=0.001): method weights (line 130) | def weights(self): method update_with_all_losses (line 139) | def update_with_all_losses(self, ts, losses): method _warmed_up (line 149) | def _warmed_up(self): FILE: PixArt-alpha-ToCa/diffusion/model/utils.py function _ntuple (line 17) | def _ntuple(n): function set_grad_checkpoint (line 28) | def set_grad_checkpoint(model, use_fp32_attention=False, gc_step=1): function auto_grad_checkpoint (line 38) | def auto_grad_checkpoint(module, *args, **kwargs): function checkpoint_sequential (line 47) | def checkpoint_sequential(functions, step, input, *args, **kwargs): function window_partition (line 73) | def window_partition(x, window_size): function window_unpartition (line 97) | def window_unpartition(windows, window_size, pad_hw, hw): function get_rel_pos (line 120) | def get_rel_pos(q_size, k_size, rel_pos): function add_decomposed_rel_pos (line 153) | def add_decomposed_rel_pos(attn, q, rel_pos_h, rel_pos_w, q_size, k_size): function mean_flat (line 184) | def mean_flat(tensor): function get_mask (line 191) | def get_mask(batch, length, mask_ratio, device, mask_type=None, data_inf... function mask_out_token (line 256) | def mask_out_token(x, ids_keep, ids_removed=None): function mask_tokens (line 274) | def mask_tokens(x, mask_ratio): function unmask_tokens (line 301) | def unmask_tokens(x, ids_restore, mask_token): function parse_float_none (line 310) | def parse_float_none(s): function parse_int_list (line 319) | def parse_int_list(s): function init_processes (line 331) | def init_processes(fn, args): function mprint (line 344) | def mprint(*args, **kwargs): function cleanup (line 352) | def cleanup(): class Logger (line 364) | class Logger(object): method __init__ (line 370) | def __init__(self, file_name=None, file_mode="w", should_flush=True): method __enter__ (line 383) | def __enter__(self): method __exit__ (line 386) | def __exit__(self, exc_type, exc_value, traceback): method write (line 389) | def write(self, text): method flush (line 402) | def flush(self): method close (line 409) | def close(self): class StackedRandomGenerator (line 423) | class StackedRandomGenerator: method __init__ (line 424) | def __init__(self, device, seeds): method randn (line 428) | def randn(self, size, **kwargs): method randn_like (line 432) | def randn_like(self, input): method randint (line 435) | def randint(self, *args, size, **kwargs): function prepare_prompt_ar (line 440) | def prepare_prompt_ar(prompt, ratios, device='cpu', show=True): function resize_and_crop_tensor (line 466) | def resize_and_crop_tensor(samples: torch.Tensor, new_width: int, new_he... function resize_and_crop_img (line 484) | def resize_and_crop_img(img: Image, new_width, new_height): function mask_feature (line 504) | def mask_feature(emb, mask): FILE: PixArt-alpha-ToCa/diffusion/sa_sampler.py class SASolverSampler (line 10) | class SASolverSampler(object): method __init__ (line 11) | def __init__(self, model, method register_buffer (line 24) | def register_buffer(self, name, attr): method sample (line 30) | def sample(self, S, batch_size, shape, conditioning=None, callback=Non... FILE: PixArt-alpha-ToCa/diffusion/sa_solver_diffusers.py function betas_for_alpha_bar (line 28) | def betas_for_alpha_bar( class SASolverScheduler (line 72) | class SASolverScheduler(SchedulerMixin, ConfigMixin): method __init__ (line 139) | def __init__( method set_timesteps (line 202) | def set_timesteps(self, num_inference_steps: int = None, device: Union... method _threshold_sample (line 265) | def _threshold_sample(self, sample: torch.FloatTensor) -> torch.FloatT... method _sigma_to_t (line 300) | def _sigma_to_t(self, sigma, log_sigmas): method _convert_to_karras (line 324) | def _convert_to_karras(self, in_sigmas: torch.FloatTensor, num_inferen... method convert_model_output (line 336) | def convert_model_output( method get_coefficients_exponential_negative (line 416) | def get_coefficients_exponential_negative(self, order, interval_start,... method get_coefficients_exponential_positive (line 436) | def get_coefficients_exponential_positive(self, order, interval_start,... method lagrange_polynomial_coefficient (line 462) | def lagrange_polynomial_coefficient(self, order, lambda_list): method get_coefficients_fn (line 525) | def get_coefficients_fn(self, order, interval_start, interval_end, lam... method stochastic_adams_bashforth_update (line 547) | def stochastic_adams_bashforth_update( method stochastic_adams_moulton_update (line 619) | def stochastic_adams_moulton_update( method step (line 694) | def step( method scale_model_input (line 801) | def scale_model_input(self, sample: torch.FloatTensor, *args, **kwargs... method add_noise (line 817) | def add_noise( method __len__ (line 839) | def __len__(self): FILE: PixArt-alpha-ToCa/diffusion/utils/checkpoint.py function save_checkpoint (line 8) | def save_checkpoint(work_dir, function load_checkpoint (line 40) | def load_checkpoint(checkpoint, FILE: PixArt-alpha-ToCa/diffusion/utils/data_sampler.py class AspectRatioBatchSampler (line 10) | class AspectRatioBatchSampler(BatchSampler): method __init__ (line 22) | def __init__(self, method __iter__ (line 51) | def __iter__(self) -> Sequence[int]: class BalancedAspectRatioBatchSampler (line 79) | class BalancedAspectRatioBatchSampler(AspectRatioBatchSampler): method __init__ (line 80) | def __init__(self, *args, **kwargs): method __iter__ (line 98) | def __iter__(self) -> Sequence[int]: FILE: PixArt-alpha-ToCa/diffusion/utils/dist_utils.py function is_distributed (line 16) | def is_distributed(): function get_world_size (line 20) | def get_world_size(): function get_rank (line 26) | def get_rank(): function get_local_rank (line 32) | def get_local_rank(): function is_master (line 38) | def is_master(): function is_local_master (line 42) | def is_local_master(): function get_local_proc_group (line 46) | def get_local_proc_group(group_size=8): function synchronize (line 62) | def synchronize(): function all_gather (line 77) | def all_gather(data): function reduce_dict (line 120) | def reduce_dict(input_dict, average=True): function _extracted_from_reduce_dict_14 (line 138) | def _extracted_from_reduce_dict_14(input_dict, average, world_size): function broadcast (line 154) | def broadcast(data, **kwargs): function all_gather_cpu (line 162) | def all_gather_cpu(result_part, tmpdir=None, collect_by_master=True): function all_gather_tensor (line 186) | def all_gather_tensor(tensor, group_size=None, group=None): function gather_difflen_tensor (line 197) | def gather_difflen_tensor(feat, num_samples_list, concat=True, group=Non... class GatherLayer (line 214) | class GatherLayer(torch.autograd.Function): method forward (line 219) | def forward(ctx, input): method backward (line 227) | def backward(ctx, *grads): # tuple(output)'s grad class GatherLayerWithGroup (line 240) | class GatherLayerWithGroup(torch.autograd.Function): method forward (line 245) | def forward(ctx, input, group, group_size): method backward (line 252) | def backward(ctx, *grads): # tuple(output)'s grad function gather_layer_with_group (line 262) | def gather_layer_with_group(data, group=None, group_size=None): function clip_grad_norm_ (line 272) | def clip_grad_norm_( function flush (line 301) | def flush(): FILE: PixArt-alpha-ToCa/diffusion/utils/logger.py function get_root_logger (line 9) | def get_root_logger(log_file=None, log_level=logging.INFO, name='PixArt'): function get_logger (line 25) | def get_logger(name, log_file=None, log_level=logging.INFO): function rename_file_with_creation_time (line 81) | def rename_file_with_creation_time(file_path): FILE: PixArt-alpha-ToCa/diffusion/utils/lr_scheduler.py function build_lr_scheduler (line 9) | def build_lr_scheduler(config, optimizer, train_dataloader, lr_scale_rat... function get_cosine_decay_to_constant_with_warmup (line 43) | def get_cosine_decay_to_constant_with_warmup(optimizer: Optimizer, FILE: PixArt-alpha-ToCa/diffusion/utils/misc.py function read_config (line 20) | def read_config(file): function init_random_seed (line 32) | def init_random_seed(seed=None, device='cuda'): function set_random_seed (line 65) | def set_random_seed(seed, deterministic=False): class SimpleTimer (line 83) | class SimpleTimer: method __init__ (line 84) | def __init__(self, num_tasks, log_interval=1, desc="Process"): method log (line 92) | def log(self): class DebugUnderflowOverflow (line 105) | class DebugUnderflowOverflow: method __init__ (line 191) | def __init__(self, model, max_frames_to_save=21, trace_batch_nums=None... method save_frame (line 210) | def save_frame(self, frame=None): method expand_frame (line 216) | def expand_frame(self, line): method trace_frames (line 219) | def trace_frames(self): method reset_saved_frames (line 223) | def reset_saved_frames(self): method dump_saved_frames (line 226) | def dump_saved_frames(self): method analyse_model (line 234) | def analyse_model(self): method analyse_variable (line 242) | def analyse_variable(self, var, ctx): method batch_start_frame (line 252) | def batch_start_frame(self): method batch_end_frame (line 256) | def batch_end_frame(self): method create_frame (line 259) | def create_frame(self, module, input, output): method register_forward_hook (line 287) | def register_forward_hook(self): method _register_forward_hook (line 290) | def _register_forward_hook(self, module): method forward_hook (line 293) | def forward_hook(self, module, input, output): method get_abs_min_max (line 340) | def get_abs_min_max(var, ctx): method detect_overflow (line 345) | def detect_overflow(var, ctx): FILE: PixArt-alpha-ToCa/diffusion/utils/optimizer.py function auto_scale_lr (line 17) | def auto_scale_lr(effective_bs, optimizer_cfg, rule='linear', base_batch... class MyOptimizerConstructor (line 31) | class MyOptimizerConstructor(DefaultOptimizerConstructor): method add_params (line 33) | def add_params(self, params, module, prefix='', is_dcn_module=None): function build_optimizer (line 125) | def build_optimizer(model, optimizer_cfg): class Lion (line 173) | class Lion(Optimizer): method __init__ (line 174) | def __init__( method update_fn (line 189) | def update_fn(p, grad, exp_avg, lr, wd, beta1, beta2): method exists (line 201) | def exists(val): method step (line 205) | def step( FILE: PixArt-alpha-ToCa/scripts/infer_pixart_8_bits.py function flush (line 10) | def flush(): function bytes_to_giga_bytes (line 14) | def bytes_to_giga_bytes(bytes): FILE: PixArt-alpha-ToCa/scripts/inference.py function get_args (line 25) | def get_args(): function set_env (line 51) | def set_env(seed=0): function visualize (line 59) | def visualize(items, bs, sample_steps, cfg_scale): FILE: PixArt-alpha-ToCa/scripts/inference_ddp.py function get_args (line 26) | def get_args(): function setup_ddp (line 49) | def setup_ddp(): function cleanup_ddp (line 56) | def cleanup_ddp(): function set_env (line 60) | def set_env(seed=0, local_rank=None): function visualize (line 71) | def visualize(items, bs, sample_steps, cfg_scale, device): FILE: PixArt-alpha-ToCa/scripts/inference_lcm.py function get_args (line 26) | def get_args(): function set_env (line 44) | def set_env(seed=0): function visualize (line 51) | def visualize(items, bs, sample_steps, cfg_scale): FILE: PixArt-alpha-ToCa/scripts/interface.py function get_args (line 29) | def get_args(): function ndarr_image (line 42) | def ndarr_image(tensor: Union[torch.Tensor, List[torch.Tensor]], **kwarg... function set_env (line 50) | def set_env(seed=0): function randomize_seed_fn (line 57) | def randomize_seed_fn(seed: int, randomize_seed: bool) -> int: function generate_img (line 64) | def generate_img(prompt, sampler, sample_steps, scale, seed=0, randomize... FILE: PixArt-alpha-ToCa/scripts/interface_controlnet.py function get_args (line 38) | def get_args(): function ndarr_image (line 58) | def ndarr_image(tensor: Union[torch.Tensor, List[torch.Tensor]], **kwarg... function set_env (line 66) | def set_env(): function generate_img (line 72) | def generate_img(prompt, given_image, seed): FILE: PixArt-alpha-ToCa/scripts/pipeline_pixart_inpaint.py function retrieve_timesteps (line 142) | def retrieve_timesteps( function retrieve_latents (line 187) | def retrieve_latents( class PixArtAlphaInpaintPipeline (line 200) | class PixArtAlphaInpaintPipeline(DiffusionPipeline): method __init__ (line 242) | def __init__( method mask_text_embeddings (line 263) | def mask_text_embeddings(self, emb, mask): method encode_prompt (line 272) | def encode_prompt( method prepare_extra_step_kwargs (line 413) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 430) | def check_inputs( method _text_preprocessing (line 498) | def _text_preprocessing(self, text, clean_caption=False): method _clean_caption (line 523) | def _clean_caption(self, caption): method prepare_latents (line 641) | def prepare_latents( method _encode_vae_image (line 692) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene... method prepare_mask_latents (line 706) | def prepare_mask_latents( method get_timesteps (line 731) | def get_timesteps(self, num_inference_steps, strength, device): method __call__ (line 742) | def __call__( FILE: PixArt-alpha-ToCa/scripts/pipeline_pixart_reference.py function retrieve_timesteps (line 153) | def retrieve_timesteps( function retrieve_latents (line 198) | def retrieve_latents( class PixArtAlphaReferencePipeline (line 211) | class PixArtAlphaReferencePipeline(DiffusionPipeline): method __init__ (line 253) | def __init__( method mask_text_embeddings (line 274) | def mask_text_embeddings(self, emb, mask): method encode_prompt (line 283) | def encode_prompt( method prepare_extra_step_kwargs (line 424) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 441) | def check_inputs( method _text_preprocessing (line 515) | def _text_preprocessing(self, text, clean_caption=False): method _clean_caption (line 540) | def _clean_caption(self, caption): method prepare_latents (line 658) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method classify_height_width_bin (line 701) | def classify_height_width_bin(height: int, width: int, ratios: dict) -... method resize_and_crop_tensor (line 709) | def resize_and_crop_tensor(samples: torch.Tensor, new_width: int, new_... method _encode_vae_image (line 732) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene... method prepare_mask_latents (line 746) | def prepare_mask_latents( method get_timesteps (line 771) | def get_timesteps(self, num_inference_steps, strength, device): method __call__ (line 782) | def __call__( FILE: PixArt-alpha-ToCa/tools/VLM_caption_lightning.py function expand2square (line 23) | def expand2square(pil_img, background_color=(122, 116, 104)): function pad2square (line 37) | def pad2square(image): function load_model (line 52) | def load_model(model_path): class SanitizedLaion (line 86) | class SanitizedLaion(Dataset): method __init__ (line 87) | def __init__(self, root_dir, index_file, prompt, config, img_extension... method __len__ (line 104) | def __len__(self): method __getitem__ (line 107) | def __getitem__(self, idx): function caption (line 117) | def caption(tokenizer, model, context_len, images, prompt, prefix): FILE: PixArt-alpha-ToCa/tools/convert_pixart_alpha_to_diffusers.py function main (line 15) | def main(args): FILE: PixArt-alpha-ToCa/tools/download.py function find_model (line 29) | def find_model(model_name): function download_model (line 39) | def download_model(model_name): function download_other (line 52) | def download_other(model_name, model_zoo, output_dir): FILE: PixArt-alpha-ToCa/tools/extract_features.py function get_closest_ratio (line 30) | def get_closest_ratio(height: float, width: float, ratios: dict): class DatasetMS (line 37) | class DatasetMS(InternalData): method __init__ (line 38) | def __init__(self, root, image_list_json=None, transform=None, resolut... method __getitem__ (line 80) | def __getitem__(self, idx): method get_data_info (line 111) | def get_data_info(self, idx): function extract_caption_t5_do (line 116) | def extract_caption_t5_do(q): function extract_caption_t5_job (line 123) | def extract_caption_t5_job(item): function extract_caption_t5 (line 149) | def extract_caption_t5(): function extract_img_vae_do (line 174) | def extract_img_vae_do(q): function extract_img_vae_job (line 181) | def extract_img_vae_job(item): function extract_img_vae (line 185) | def extract_img_vae(): function save_results (line 235) | def save_results(results, paths, signature, work_dir): function inference (line 255) | def inference(vae, dataloader, signature, work_dir): function extract_img_vae_multiscale (line 268) | def extract_img_vae_multiscale(bs=1): function get_args (line 296) | def get_args(): FILE: PixArt-alpha-ToCa/train_latents.py function set_fsdp_env (line 35) | def set_fsdp_env(): function ema_update (line 42) | def ema_update(model_dest: nn.Module, model_src: nn.Module, rate): function train (line 53) | def train(): function parse_args (line 261) | def parse_args(): FILE: PixArt-alpha-ToCa/train_scripts/train.py function set_fsdp_env (line 36) | def set_fsdp_env(): function ema_update (line 43) | def ema_update(model_dest: nn.Module, model_src: nn.Module, rate): function train (line 50) | def train(): function parse_args (line 153) | def parse_args(): FILE: PixArt-alpha-ToCa/train_scripts/train_controlnet.py function set_fsdp_env (line 34) | def set_fsdp_env(): function train (line 41) | def train(): function parse_args (line 139) | def parse_args(): FILE: PixArt-alpha-ToCa/train_scripts/train_diffusers.py function set_fsdp_env (line 39) | def set_fsdp_env(): function ema_update (line 46) | def ema_update(model_dest: nn.Module, model_src: nn.Module, rate): function token_drop (line 54) | def token_drop(y, y_mask, force_drop_ids=None): function get_null_embed (line 67) | def get_null_embed(npz_file, max_length=120): function prepare_vis (line 89) | def prepare_vis(): function log_validation (line 118) | def log_validation(model, accelerator, weight_dtype, step): function train (line 203) | def train(model): function parse_args (line 307) | def parse_args(): function save_model_hook (line 446) | def save_model_hook(models, weights, output_dir): function load_model_hook (line 456) | def load_model_hook(models, input_dir): FILE: PixArt-alpha-ToCa/train_scripts/train_dreambooth.py function set_fsdp_env (line 34) | def set_fsdp_env(): function ema_update (line 41) | def ema_update(model_dest: nn.Module, model_src: nn.Module, rate): function train (line 48) | def train(): function parse_args (line 149) | def parse_args(): FILE: PixArt-alpha-ToCa/train_scripts/train_pixart_lcm.py function set_fsdp_env (line 38) | def set_fsdp_env(): function ema_update (line 45) | def ema_update(model_dest: nn.Module, model_src: nn.Module, rate): function append_dims (line 53) | def append_dims(x, target_dims): function scalings_for_boundary_conditions (line 62) | def scalings_for_boundary_conditions(timestep, sigma_data=0.5, timestep_... function extract_into_tensor (line 68) | def extract_into_tensor(a, t, x_shape): class DDIMSolver (line 74) | class DDIMSolver: method __init__ (line 75) | def __init__(self, alpha_cumprods, timesteps=1000, ddim_timesteps=50): method to (line 89) | def to(self, device): method ddim_step (line 95) | def ddim_step(self, pred_x0, pred_noise, timestep_index): function log_validation (line 103) | def log_validation(model, step, device): function train (line 133) | def train(): function parse_args (line 299) | def parse_args(): FILE: PixArt-alpha-ToCa/train_scripts/train_pixart_lcm_lora.py function set_fsdp_env (line 35) | def set_fsdp_env(): function filter_keys (line 41) | def filter_keys(key_set): function append_dims (line 48) | def append_dims(x, target_dims): function scalings_for_boundary_conditions (line 57) | def scalings_for_boundary_conditions(timestep, sigma_data=0.5, timestep_... function predicted_origin (line 64) | def predicted_origin(model_output, timesteps, sample, prediction_type, a... function extract_into_tensor (line 79) | def extract_into_tensor(a, t, x_shape): class DDIMSolver (line 85) | class DDIMSolver: method __init__ (line 86) | def __init__(self, alpha_cumprods, timesteps=1000, ddim_timesteps=50): method to (line 100) | def to(self, device): method ddim_step (line 106) | def ddim_step(self, pred_x0, pred_noise, timestep_index): function train (line 113) | def train(model): function parse_args (line 275) | def parse_args(): function save_model_hook (line 417) | def save_model_hook(models, weights, output_dir): function load_model_hook (line 429) | def load_model_hook(models, input_dir): FILE: PixArt-alpha-ToCa/train_scripts/train_pixart_lora_hf.py function text_encoder_lora_state_dict (line 59) | def text_encoder_lora_state_dict(text_encoder): function save_model_card (line 91) | def save_model_card(repo_id: str, images=None, base_model=str, dataset_n... function parse_args (line 119) | def parse_args(): function main (line 435) | def main(): FILE: flux-ToCa/demo_gr.py function get_models (line 20) | def get_models(name: str, device: torch.device, offload: bool, is_schnel... class FluxGenerator (line 29) | class FluxGenerator: method __init__ (line 30) | def __init__(self, model_name: str, device: str, offload: bool): method generate_image (line 43) | def generate_image( function create_demo (line 165) | def create_demo( FILE: flux-ToCa/demo_st.py function get_models (line 32) | def get_models(name: str, device: torch.device, offload: bool, is_schnel... function get_image (line 41) | def get_image() -> torch.Tensor | None: function main (line 58) | def main( function app (line 289) | def app(): FILE: flux-ToCa/demo_st_fill.py function add_border_and_mask (line 24) | def add_border_and_mask(image, zoom_all=1.0, zoom_left=0, zoom_right=0, ... function get_models (line 76) | def get_models(name: str, device: torch.device, offload: bool): function resize (line 85) | def resize(img: Image.Image, min_mp: float = 0.5, max_mp: float = 2.0) -... function clear_canvas_state (line 109) | def clear_canvas_state(): function set_new_image (line 117) | def set_new_image(img: Image.Image): function downscale_image (line 124) | def downscale_image(img: Image.Image, scale_factor: float) -> Image.Image: function main (line 141) | def main( FILE: flux-ToCa/src/flux/api.py class ApiException (line 17) | class ApiException(Exception): method __init__ (line 18) | def __init__(self, status_code: int, detail: str | list[dict] | None =... method __str__ (line 23) | def __str__(self) -> str: method __repr__ (line 26) | def __repr__(self) -> str: class ImageRequest (line 36) | class ImageRequest: method __init__ (line 37) | def __init__( method request (line 132) | def request(self): method retrieve (line 152) | def retrieve(self) -> dict: method bytes (line 181) | def bytes(self) -> bytes: method url (line 194) | def url(self) -> str: method image (line 204) | def image(self) -> Image.Image: method save (line 210) | def save(self, path: str): FILE: flux-ToCa/src/flux/cli.py class SamplingOptions (line 19) | class SamplingOptions: function parse_prompt (line 28) | def parse_prompt(options: SamplingOptions) -> SamplingOptions | None: function main (line 96) | def main( function app (line 234) | def app(): FILE: flux-ToCa/src/flux/cli_control.py class SamplingOptions (line 18) | class SamplingOptions: function parse_prompt (line 29) | def parse_prompt(options: SamplingOptions) -> SamplingOptions | None: function parse_img_cond_path (line 96) | def parse_img_cond_path(options: SamplingOptions | None) -> SamplingOpti... function parse_lora_scale (line 135) | def parse_lora_scale(options: SamplingOptions | None) -> tuple[SamplingO... function main (line 163) | def main( function app (line 343) | def app(): FILE: flux-ToCa/src/flux/cli_fill.py class SamplingOptions (line 18) | class SamplingOptions: function parse_prompt (line 29) | def parse_prompt(options: SamplingOptions) -> SamplingOptions | None: function parse_img_cond_path (line 74) | def parse_img_cond_path(options: SamplingOptions | None) -> SamplingOpti... function parse_img_mask_path (line 120) | def parse_img_mask_path(options: SamplingOptions | None) -> SamplingOpti... function main (line 176) | def main( function app (line 330) | def app(): FILE: flux-ToCa/src/flux/cli_redux.py class SamplingOptions (line 18) | class SamplingOptions: function parse_prompt (line 28) | def parse_prompt(options: SamplingOptions) -> SamplingOptions | None: function parse_img_cond_path (line 93) | def parse_img_cond_path(options: SamplingOptions | None) -> SamplingOpti... function main (line 133) | def main( function app (line 275) | def app(): FILE: flux-ToCa/src/flux/ideas/cache_denoise.py function denoise_cache (line 6) | def denoise_cache( FILE: flux-ToCa/src/flux/math.py function attention (line 6) | def attention(q: Tensor, k: Tensor, v: Tensor, pe: Tensor, **kwargs) -> ... function rope (line 26) | def rope(pos: Tensor, dim: int, theta: int) -> Tensor: function apply_rope (line 36) | def apply_rope(xq: Tensor, xk: Tensor, freqs_cis: Tensor) -> tuple[Tenso... function dot_product_attention (line 47) | def dot_product_attention(query, key, value, attn_mask=None, dropout_p=0.0, FILE: flux-ToCa/src/flux/model.py class FluxParams (line 18) | class FluxParams: class Flux (line 34) | class Flux(nn.Module): method __init__ (line 39) | def __init__(self, params: FluxParams): method forward (line 84) | def forward( class FluxLoraWrapper (line 131) | class FluxLoraWrapper(Flux): method __init__ (line 132) | def __init__( method set_lora_scale (line 149) | def set_lora_scale(self, scale: float) -> None: FILE: flux-ToCa/src/flux/modules/autoencoder.py class AutoEncoderParams (line 9) | class AutoEncoderParams: function swish (line 21) | def swish(x: Tensor) -> Tensor: class AttnBlock (line 25) | class AttnBlock(nn.Module): method __init__ (line 26) | def __init__(self, in_channels: int): method attention (line 37) | def attention(self, h_: Tensor) -> Tensor: method forward (line 51) | def forward(self, x: Tensor) -> Tensor: class ResnetBlock (line 55) | class ResnetBlock(nn.Module): method __init__ (line 56) | def __init__(self, in_channels: int, out_channels: int): method forward (line 69) | def forward(self, x): class Downsample (line 85) | class Downsample(nn.Module): method __init__ (line 86) | def __init__(self, in_channels: int): method forward (line 91) | def forward(self, x: Tensor): class Upsample (line 98) | class Upsample(nn.Module): method __init__ (line 99) | def __init__(self, in_channels: int): method forward (line 103) | def forward(self, x: Tensor): class Encoder (line 109) | class Encoder(nn.Module): method __init__ (line 110) | def __init__( method forward (line 159) | def forward(self, x: Tensor) -> Tensor: class Decoder (line 183) | class Decoder(nn.Module): method __init__ (line 184) | def __init__( method forward (line 237) | def forward(self, z: Tensor) -> Tensor: class DiagonalGaussian (line 262) | class DiagonalGaussian(nn.Module): method __init__ (line 263) | def __init__(self, sample: bool = True, chunk_dim: int = 1): method forward (line 268) | def forward(self, z: Tensor) -> Tensor: class AutoEncoder (line 277) | class AutoEncoder(nn.Module): method __init__ (line 278) | def __init__(self, params: AutoEncoderParams): method encode (line 302) | def encode(self, x: Tensor) -> Tensor: method decode (line 307) | def decode(self, z: Tensor) -> Tensor: method forward (line 311) | def forward(self, x: Tensor) -> Tensor: FILE: flux-ToCa/src/flux/modules/cache_functions/attention.py function cached_attention_forward (line 8) | def cached_attention_forward( FILE: flux-ToCa/src/flux/modules/cache_functions/cache_cutfresh.py function cache_cutfresh (line 6) | def cache_cutfresh(cache_dic, tokens, current): function local_selection_with_bonus (line 48) | def local_selection_with_bonus(score, bonus_ratio, grid_size=2): FILE: flux-ToCa/src/flux/modules/cache_functions/cache_init.py function cache_init (line 1) | def cache_init(timesteps, model_kwargs=None): FILE: flux-ToCa/src/flux/modules/cache_functions/cal_type.py function cal_type (line 3) | def cal_type(cache_dic, current): FILE: flux-ToCa/src/flux/modules/cache_functions/force_init.py function force_init (line 3) | def force_init(cache_dic, current, tokens): FILE: flux-ToCa/src/flux/modules/cache_functions/force_scheduler.py function force_scheduler (line 2) | def force_scheduler(cache_dic, current): FILE: flux-ToCa/src/flux/modules/cache_functions/fresh_ratio_scheduler.py function fresh_ratio_scheduler (line 2) | def fresh_ratio_scheduler(cache_dic, current): FILE: flux-ToCa/src/flux/modules/cache_functions/global_force_fresh.py function global_force_fresh (line 2) | def global_force_fresh(cache_dic, current): FILE: flux-ToCa/src/flux/modules/cache_functions/score_evaluate.py function score_evaluate (line 4) | def score_evaluate(cache_dic, tokens, current) -> torch.Tensor: FILE: flux-ToCa/src/flux/modules/cache_functions/scores.py function attn_score (line 5) | def attn_score(cache_dic, current): function similarity_score (line 34) | def similarity_score(cache_dic, current, tokens): function norm_score (line 39) | def norm_score(cache_dic, current, tokens): function kv_norm_score (line 43) | def kv_norm_score(cache_dic, current): function k_norm_score (line 58) | def k_norm_score(cache_dic, current): function v_norm_score (line 68) | def v_norm_score(cache_dic, current): FILE: flux-ToCa/src/flux/modules/cache_functions/support_set_selection.py function support_set_selection (line 4) | def support_set_selection(x: torch.Tensor, fresh_ratio: float, base_rati... FILE: flux-ToCa/src/flux/modules/cache_functions/token_merge.py function token_merge (line 2) | def token_merge(cache_dic, tokens, current, fresh_indices, stale_indices): FILE: flux-ToCa/src/flux/modules/cache_functions/update_cache.py function update_cache (line 2) | def update_cache(fresh_indices, fresh_tokens, cache_dic, current, fresh_... FILE: flux-ToCa/src/flux/modules/conditioner.py class HFEmbedder (line 5) | class HFEmbedder(nn.Module): method __init__ (line 6) | def __init__(self, version: str, max_length: int, **hf_kwargs): method forward (line 21) | def forward(self, text: list[str]) -> Tensor: FILE: flux-ToCa/src/flux/modules/image_embedders.py class DepthImageEncoder (line 15) | class DepthImageEncoder: method __init__ (line 18) | def __init__(self, device): method __call__ (line 23) | def __call__(self, img: torch.Tensor) -> torch.Tensor: class CannyImageEncoder (line 38) | class CannyImageEncoder: method __init__ (line 39) | def __init__( method __call__ (line 49) | def __call__(self, img: torch.Tensor) -> torch.Tensor: class ReduxImageEncoder (line 66) | class ReduxImageEncoder(nn.Module): method __init__ (line 69) | def __init__( method __call__ (line 96) | def __call__(self, x: Image.Image) -> torch.Tensor: FILE: flux-ToCa/src/flux/modules/layers.py class EmbedND (line 12) | class EmbedND(nn.Module): method __init__ (line 13) | def __init__(self, dim: int, theta: int, axes_dim: list[int]): method forward (line 19) | def forward(self, ids: Tensor) -> Tensor: function timestep_embedding (line 29) | def timestep_embedding(t: Tensor, dim, max_period=10000, time_factor: fl... class MLPEmbedder (line 53) | class MLPEmbedder(nn.Module): method __init__ (line 54) | def __init__(self, in_dim: int, hidden_dim: int): method forward (line 60) | def forward(self, x: Tensor) -> Tensor: class RMSNorm (line 64) | class RMSNorm(torch.nn.Module): method __init__ (line 65) | def __init__(self, dim: int): method forward (line 69) | def forward(self, x: Tensor): class QKNorm (line 76) | class QKNorm(torch.nn.Module): method __init__ (line 77) | def __init__(self, dim: int): method forward (line 82) | def forward(self, q: Tensor, k: Tensor, v: Tensor) -> tuple[Tensor, Te... class SelfAttention (line 88) | class SelfAttention(nn.Module): method __init__ (line 89) | def __init__(self, dim: int, num_heads: int = 8, qkv_bias: bool = False): method forward (line 98) | def forward(self, x: Tensor, pe: Tensor) -> Tensor: class ModulationOut (line 108) | class ModulationOut: class Modulation (line 114) | class Modulation(nn.Module): method __init__ (line 115) | def __init__(self, dim: int, double: bool): method forward (line 121) | def forward(self, vec: Tensor) -> tuple[ModulationOut, ModulationOut |... class DoubleStreamBlock (line 130) | class DoubleStreamBlock(nn.Module): method __init__ (line 131) | def __init__(self, hidden_size: int, num_heads: int, mlp_ratio: float,... method forward (line 159) | def forward(self, img: Tensor, txt: Tensor, vec: Tensor, pe: Tensor, *... class SingleStreamBlock (line 301) | class SingleStreamBlock(nn.Module): method __init__ (line 307) | def __init__( method load_mlp_in_weights (line 336) | def load_mlp_in_weights(self, linear1_weight: torch.Tensor, linear1_bi... method forward (line 355) | def forward(self, x: Tensor, vec: Tensor, pe: Tensor, **kwargs) -> Ten... class LastLayer (line 443) | class LastLayer(nn.Module): method __init__ (line 444) | def __init__(self, hidden_size: int, patch_size: int, out_channels: int): method forward (line 450) | def forward(self, x: Tensor, vec: Tensor) -> Tensor: FILE: flux-ToCa/src/flux/modules/lora.py function replace_linear_with_lora (line 5) | def replace_linear_with_lora( class LinearLora (line 34) | class LinearLora(nn.Linear): method __init__ (line 35) | def __init__( method set_scale (line 84) | def set_scale(self, scale: float) -> None: method forward (line 88) | def forward(self, input: torch.Tensor) -> torch.Tensor: FILE: flux-ToCa/src/flux/sampling.py function get_noise (line 16) | def get_noise( function prepare (line 36) | def prepare(t5: HFEmbedder, clip: HFEmbedder, img: Tensor, prompt: str |... function prepare_control (line 76) | def prepare_control( function prepare_fill (line 113) | def prepare_fill( function prepare_redux (line 166) | def prepare_redux( function time_shift (line 216) | def time_shift(mu: float, sigma: float, t: Tensor): function get_lin_function (line 220) | def get_lin_function( function get_schedule (line 228) | def get_schedule( function denoise (line 247) | def denoise( function unpack (line 285) | def unpack(x: Tensor, height: int, width: int) -> Tensor: function denoise_test_FLOPs (line 299) | def denoise_test_FLOPs( function convert_flops (line 342) | def convert_flops(flops_str): FILE: flux-ToCa/src/flux/util.py function save_image (line 16) | def save_image( class ModelSpec (line 52) | class ModelSpec: function print_load_warning (line 305) | def print_load_warning(missing: list[str], unexpected: list[str]) -> None: function load_flow_model (line 316) | def load_flow_model( function load_t5 (line 356) | def load_t5(device: str | torch.device = "cuda", max_length: int = 512) ... function load_clip (line 361) | def load_clip(device: str | torch.device = "cuda") -> HFEmbedder: function load_ae (line 365) | def load_ae(name: str, device: str | torch.device = "cuda", hf_download:... function optionally_expand_state_dict (line 387) | def optionally_expand_state_dict(model: torch.nn.Module, state_dict: dic... class WatermarkEmbedder (line 406) | class WatermarkEmbedder: method __init__ (line 407) | def __init__(self, watermark): method __call__ (line 413) | def __call__(self, image: torch.Tensor) -> torch.Tensor: FILE: flux-ToCa/src/geneval_flux.py function parse_args (line 35) | def parse_args(): function main (line 124) | def main(args): FILE: flux-ToCa/src/sample.py class SamplingOptions (line 21) | class SamplingOptions: function main (line 37) | def main(opts: SamplingOptions): function read_prompts (line 168) | def read_prompts(prompt_file: str): function app (line 174) | def app():