SYMBOL INDEX (5290 symbols across 781 files) FILE: .dev_scripts/create_ceph_configs.py function update_intervals (line 11) | def update_intervals(config, args): function convert_data_config (line 32) | def convert_data_config(data_cfg): function update_ceph_config (line 138) | def update_ceph_config(filename, args, dry_run=False): FILE: .dev_scripts/doc_link_checker.py function make_parser (line 13) | def make_parser(): function analyze_doc (line 28) | def analyze_doc(home, path): function traverse (line 94) | def traverse(args): FILE: .dev_scripts/download_models.py function additional_download (line 21) | def additional_download(args): function parse_args (line 51) | def parse_args(): function download (line 71) | def download(args): FILE: .dev_scripts/job_watcher.py function show_job_out (line 15) | def show_job_out(name, root, job_name_list): function show_job_status (line 40) | def show_job_status(root, job_name_list, csv_path=None): function save_for_resume (line 80) | def save_for_resume(root, job_name_list): function resume_from_file (line 99) | def resume_from_file(file_path): function start_from_proc (line 113) | def start_from_proc(root, proc): function show_tui (line 135) | def show_tui(root, job_name_list): FILE: .dev_scripts/metric_mapping.py function filter_metric (line 174) | def filter_metric(metric_mapping, summary_data): FILE: .dev_scripts/test_benchmark.py function parse_args (line 23) | def parse_args(): function create_test_job_batch (line 84) | def create_test_job_batch(commands, model_info, args, port, script_name): function test (line 185) | def test(args): function show_summary (line 276) | def show_summary(summary_data, function summary (line 348) | def summary(args): function main (line 420) | def main(): FILE: .dev_scripts/train_benchmark.py function parse_args (line 87) | def parse_args(): function create_train_job_batch (line 178) | def create_train_job_batch(commands, model_info, args, port, script_name): function train (line 282) | def train(args): function show_summary (line 357) | def show_summary(summary_data, models_map, work_dir, save=False): function summary (line 420) | def summary(args): function main (line 482) | def main(): FILE: .dev_scripts/update_config_readme.py function update_md (line 15) | def update_md(md_file): FILE: .dev_scripts/update_model_index.py function parse_md (line 101) | def parse_md(md_file): function update_model_index (line 243) | def update_model_index(): FILE: .dev_scripts/update_ut.py function check_exclude (line 24) | def check_exclude(fn): function update_ut (line 31) | def update_ut(): FILE: .dev_scripts/utils/job_util.py function parse_job_list (line 9) | def parse_job_list(job_list) -> Tuple[list, list]: function parse_job_list_from_file (line 31) | def parse_job_list_from_file(job_list_file: str) -> Tuple[list, list]: function get_info_from_id (line 48) | def get_info_from_id(job_id: str) -> dict: function filter_jobs (line 76) | def filter_jobs(job_id_list: list, FILE: .dev_scripts/utils/modelindex.py function dump_yaml_and_check_difference (line 8) | def dump_yaml_and_check_difference(obj, file): function collate_metrics (line 43) | def collate_metrics(keys): function found_table (line 60) | def found_table(lines, i): function modelindex_to_dict (line 74) | def modelindex_to_dict(model): FILE: demo/download_inference_resources.py function parse_args (line 40) | def parse_args(): function main (line 66) | def main(): FILE: demo/gradio_animatediff.py class AnimateController (line 37) | class AnimateController: method __init__ (line 39) | def __init__(self): method refresh_stable_diffusion (line 67) | def refresh_stable_diffusion(self): method refresh_motion_module (line 70) | def refresh_motion_module(self): method refresh_personalized_model (line 77) | def refresh_personalized_model(self): method update_stable_diffusion (line 84) | def update_stable_diffusion(self, stable_diffusion_dropdown): method update_motion_module (line 89) | def update_motion_module(self, motion_module_dropdown): method update_base_model (line 102) | def update_base_model(self, base_model_dropdown): method update_lora_model (line 116) | def update_lora_model(self, lora_model_dropdown): method animate (line 129) | def animate( function ui (line 196) | def ui(): FILE: demo/gradio_controlnet_animation.py function process (line 9) | def process(video, prompt, a_prompt, negative_prompt, FILE: demo/gradio_draggan.py function get_default_gr_state (line 32) | def get_default_gr_state(device='cuda', function reverse_point_pairs (line 71) | def reverse_point_pairs(points): function clear_state (line 78) | def clear_state(global_state, target=None): function init_images (line 101) | def init_images(global_state, cache_dir='./checkpoints'): function update_image_draw (line 142) | def update_image_draw(image, points, mask, show_mask, global_state=None): function preprocess_mask_info (line 154) | def preprocess_mask_info(global_state, image): function on_change_pretrained_dropdown (line 360) | def on_change_pretrained_dropdown(pretrained_value, global_state): function on_click_reset_image (line 379) | def on_click_reset_image(global_state): function on_change_update_image_seed (line 397) | def on_change_update_image_seed(seed, global_state): function on_click_latent_space (line 416) | def on_click_latent_space(latent_space, global_state): function on_change_lr (line 443) | def on_change_lr(lr, global_state): function on_click_start (line 461) | def on_click_start(global_state, image): function on_click_stop (line 689) | def on_click_stop(global_state): function on_click_remove_point (line 715) | def on_click_remove_point(global_state): function on_click_reset_mask (line 730) | def on_click_reset_mask(global_state): function on_click_enable_draw (line 752) | def on_click_enable_draw(global_state, image): function on_click_remove_draw (line 768) | def on_click_remove_draw(global_state, image): function on_click_add_point (line 792) | def on_click_add_point(global_state, image: dict): function on_click_image (line 816) | def on_click_image(global_state, evt: gr.SelectData): function on_click_clear_points (line 855) | def on_click_clear_points(global_state): function on_click_show_mask (line 877) | def on_click_show_mask(global_state, show_mask): FILE: demo/gradio_fastcomposer.py class ModelWrapper (line 18) | class ModelWrapper: method __init__ (line 20) | def __init__(self, model): method inference (line 27) | def inference( function create_demo (line 84) | def create_demo(): FILE: demo/gradio_inpainting.py class InpaintingGradio (line 20) | class InpaintingGradio: method __init__ (line 37) | def __init__(self, method model_reconfig (line 64) | def model_reconfig(self, method change_text2dict (line 109) | def change_text2dict(input_text: str) -> Union[Dict, None]: method get_package_path (line 120) | def get_package_path() -> str: method get_model_config (line 134) | def get_model_config(self, model_name: str) -> Dict: method init_inference_supported_models_cfg (line 151) | def init_inference_supported_models_cfg() -> None: method _get_inpainting_kwargs (line 167) | def _get_inpainting_kwargs(self, model_name: Optional[str], method send_notification (line 219) | def send_notification(msg: str, color: str, label: str) -> None: method get_inpainting_supported_models (line 223) | def get_inpainting_supported_models() -> List: method infer (line 227) | def infer(self, input_img_arg: Dict) -> np.ndarray: method run (line 233) | def run(self) -> None: FILE: demo/gradio_vico.py function load_base_model (line 19) | def load_base_model(): function train (line 25) | def train(train_data, init_token, placeholder): class DummyModel (line 47) | class DummyModel: method __init__ (line 49) | def __init__(self, model): function infer_fn (line 53) | def infer_fn(checkpoint, img_ref, prompt, negative_prompt, guidance_scale, FILE: demo/mmagic_inference_demo.py function parse_args (line 8) | def parse_args(): function main (line 97) | def main(): FILE: demo/singan_demo.py function parse_args (line 24) | def parse_args(): function _tensor2img (line 52) | def _tensor2img(img): function main (line 60) | def main(): FILE: demo/utils/gradio_utils.py class EasyDict (line 8) | class EasyDict(dict): method __getattr__ (line 12) | def __getattr__(self, name: str): method __setattr__ (line 18) | def __setattr__(self, name: str, value) -> None: method __delattr__ (line 21) | def __delattr__(self, name: str) -> None: class ImageMask (line 25) | class ImageMask(gr.components.Image): method __init__ (line 32) | def __init__(self, **kwargs): method preprocess (line 36) | def preprocess(self, x): function get_valid_mask (line 50) | def get_valid_mask(mask: np.ndarray): function draw_points_on_image (line 60) | def draw_points_on_image(image, function draw_mask_on_image (line 126) | def draw_mask_on_image(image, mask): function on_change_single_global_state (line 142) | def on_change_single_global_state(keys, function get_latest_points_pair (line 163) | def get_latest_points_pair(points_dict): FILE: demo/utils/renderer.py class CapturedException (line 25) | class CapturedException(Exception): method __init__ (line 27) | def __init__(self, msg=None): class CaptureSuccess (line 44) | class CaptureSuccess(Exception): method __init__ (line 46) | def __init__(self, out): function add_watermark_np (line 56) | def add_watermark_np(input_image_array, watermark_text='AI Generated'): class Renderer (line 83) | class Renderer: method __init__ (line 85) | def __init__(self, disable_timing=False): method render (line 101) | def render(self, **args): method get_network (line 150) | def get_network(self, pkl, key, **tweak_kwargs): method _get_pinned_buf (line 196) | def _get_pinned_buf(self, ref): method to_device (line 204) | def to_device(self, buf): method to_cpu (line 207) | def to_cpu(self, buf): method _ignore_timing (line 210) | def _ignore_timing(self): method _apply_cmap (line 213) | def _apply_cmap(self, x, name='viridis'): method init_network (line 225) | def init_network(self, method update_lr (line 299) | def update_lr(self, lr): method _render_drag_impl (line 306) | def _render_drag_impl(self, FILE: docs/en/.dev_scripts/update_dataset_zoo.py function update_dataset_zoo (line 6) | def update_dataset_zoo(): FILE: docs/en/.dev_scripts/update_model_zoo.py function write_file (line 14) | def write_file(file, content): function update_model_zoo (line 20) | def update_model_zoo(): FILE: docs/en/conf.py function builder_inited_handler (line 150) | def builder_inited_handler(app): function skip_member (line 155) | def skip_member(app, what, name, obj, skip, options): function viewcode_follow_imported (line 161) | def viewcode_follow_imported(app, modname, attribute): function setup (line 180) | def setup(app): FILE: docs/zh_cn/.dev_scripts/update_dataset_zoo.py function update_dataset_zoo (line 6) | def update_dataset_zoo(): FILE: docs/zh_cn/.dev_scripts/update_model_zoo.py function anchor (line 18) | def anchor(name): function summarize (line 24) | def summarize(stats, name): function update_model_zoo (line 69) | def update_model_zoo(): FILE: docs/zh_cn/conf.py function builder_inited_handler (line 146) | def builder_inited_handler(app): function skip_member (line 151) | def skip_member(app, what, name, obj, skip, options): function setup (line 157) | def setup(app): FILE: docs/zh_cn/stat.py function anchor (line 12) | def anchor(name): FILE: mmagic/__init__.py function digit_version (line 11) | def digit_version(version_str): FILE: mmagic/apis/inferencers/__init__.py class Inferencers (line 31) | class Inferencers: method __init__ (line 43) | def __init__(self, method __call__ (line 101) | def __call__(self, **kwargs) -> Union[Dict, List[Dict]]: method get_extra_parameters (line 112) | def get_extra_parameters(self) -> List[str]: FILE: mmagic/apis/inferencers/base_mmagic_inferencer.py class BaseMMagicInferencer (line 25) | class BaseMMagicInferencer(BaseInferencer): method __init__ (line 47) | def __init__(self, method _init_model (line 67) | def _init_model(self, cfg: Union[ConfigType, str], ckpt: Optional[str], method _init_pipeline (line 82) | def _init_pipeline(self, cfg: ConfigType) -> Compose: method _init_extra_parameters (line 91) | def _init_extra_parameters(self, extra_parameters: Dict) -> None: method _update_extra_parameters (line 98) | def _update_extra_parameters(self, **kwargs) -> None: method _dispatch_kwargs (line 108) | def _dispatch_kwargs(self, **kwargs) -> Tuple[Dict, Dict, Dict, Dict]: method __call__ (line 124) | def __call__(self, **kwargs) -> Union[Dict, List[Dict]]: method base_call (line 142) | def base_call(self, **kwargs) -> Union[Dict, List[Dict]]: method get_extra_parameters (line 170) | def get_extra_parameters(self) -> List[str]: method postprocess (line 179) | def postprocess( method _pred2dict (line 211) | def _pred2dict(self, pred_tensor: torch.Tensor) -> Dict: method visualize (line 226) | def visualize(self, FILE: mmagic/apis/inferencers/colorization_inferencer.py class ColorizationInferencer (line 17) | class ColorizationInferencer(BaseMMagicInferencer): method preprocess (line 26) | def preprocess(self, img: InputsType) -> Dict: method forward (line 55) | def forward(self, inputs: InputsType) -> PredType: method visualize (line 61) | def visualize(self, FILE: mmagic/apis/inferencers/conditional_inferencer.py class ConditionalInferencer (line 14) | class ConditionalInferencer(BaseMMagicInferencer): method preprocess (line 25) | def preprocess(self, label: InputsType) -> Dict: method forward (line 42) | def forward(self, inputs: InputsType) -> PredType: method visualize (line 46) | def visualize(self, method _pred2dict (line 73) | def _pred2dict(self, data_sample: DataSample) -> Dict: FILE: mmagic/apis/inferencers/controlnet_animation_inferencer.py function load_image (line 23) | def load_image(image: Union[str, PIL.Image.Image]) -> PIL.Image.Image: class ControlnetAnimationInferencer (line 52) | class ControlnetAnimationInferencer(BaseMMagicInferencer): method __init__ (line 72) | def __init__(self, method __call__ (line 93) | def __call__(self, FILE: mmagic/apis/inferencers/diffusers_pipeline_inferencer.py class DiffusersPipelineInferencer (line 13) | class DiffusersPipelineInferencer(BaseMMagicInferencer): method preprocess (line 24) | def preprocess(self, method forward (line 53) | def forward(self, inputs: InputsType) -> PredType: method visualize (line 59) | def visualize(self, FILE: mmagic/apis/inferencers/eg3d_inferencer.py class EG3DInferencer (line 25) | class EG3DInferencer(BaseMMagicInferencer): method preprocess (line 38) | def preprocess(self, inputs: InputsType = None) -> ForwardInputs: method forward (line 86) | def forward(self, method visualize (line 134) | def visualize(self, method preprocess_img (line 271) | def preprocess_img(self, preds: List[dict]) -> torch.Tensor: method preprocess_depth (line 286) | def preprocess_depth(self, preds: List[dict]) -> torch.Tensor: method postprocess (line 312) | def postprocess(self, FILE: mmagic/apis/inferencers/image_super_resolution_inferencer.py class ImageSuperResolutionInferencer (line 15) | class ImageSuperResolutionInferencer(BaseMMagicInferencer): method preprocess (line 24) | def preprocess(self, img: InputsType, ref: InputsType = None) -> Dict: method forward (line 75) | def forward(self, inputs: InputsType) -> PredType: method visualize (line 82) | def visualize(self, FILE: mmagic/apis/inferencers/inference_functions.py function set_random_seed (line 20) | def set_random_seed(seed, deterministic=False, use_rank_shift=True): function delete_cfg (line 38) | def delete_cfg(cfg, key='init_cfg'): function init_model (line 53) | def init_model(config, checkpoint=None, device='cuda:0'): function pad_sequence (line 89) | def pad_sequence(data, window_size): function read_image (line 111) | def read_image(filepath): function read_frames (line 126) | def read_frames(source, start_index, num_frames, from_video, end_index): function calculate_grid_size (line 153) | def calculate_grid_size(num_batches: int = 1, aspect_ratio: int = 1) -> ... FILE: mmagic/apis/inferencers/inpainting_inferencer.py class InpaintingInferencer (line 15) | class InpaintingInferencer(BaseMMagicInferencer): method _init_pipeline (line 24) | def _init_pipeline(self, cfg) -> Compose: method preprocess (line 28) | def preprocess(self, img: InputsType, mask: InputsType) -> Dict: method forward (line 57) | def forward(self, inputs: InputsType) -> PredType: method visualize (line 64) | def visualize(self, FILE: mmagic/apis/inferencers/matting_inferencer.py class MattingInferencer (line 15) | class MattingInferencer(BaseMMagicInferencer): method preprocess (line 24) | def preprocess(self, img: InputsType, trimap: InputsType) -> Dict: method forward (line 58) | def forward(self, inputs: InputsType) -> PredType: method visualize (line 64) | def visualize(self, method _pred2dict (line 89) | def _pred2dict(self, data_sample: DataSample) -> Dict: FILE: mmagic/apis/inferencers/text2image_inferencer.py class Text2ImageInferencer (line 14) | class Text2ImageInferencer(BaseMMagicInferencer): method preprocess (line 25) | def preprocess(self, method forward (line 56) | def forward(self, inputs: InputsType) -> PredType: method visualize (line 62) | def visualize(self, FILE: mmagic/apis/inferencers/translation_inferencer.py class TranslationInferencer (line 16) | class TranslationInferencer(BaseMMagicInferencer): method preprocess (line 25) | def preprocess(self, img: InputsType) -> Dict: method forward (line 57) | def forward(self, inputs: InputsType) -> PredType: method visualize (line 65) | def visualize(self, FILE: mmagic/apis/inferencers/unconditional_inferencer.py class UnconditionalInferencer (line 14) | class UnconditionalInferencer(BaseMMagicInferencer): method preprocess (line 26) | def preprocess(self) -> Dict: method forward (line 45) | def forward(self, inputs: InputsType) -> PredType: method visualize (line 49) | def visualize(self, method _pred2dict (line 79) | def _pred2dict(self, data_sample: DataSample) -> Dict: FILE: mmagic/apis/inferencers/video_interpolation_inferencer.py class VideoInterpolationInferencer (line 22) | class VideoInterpolationInferencer(BaseMMagicInferencer): method preprocess (line 39) | def preprocess(self, video: InputsType) -> Dict: method forward (line 70) | def forward(self, method visualize (line 192) | def visualize(self, method postprocess (line 200) | def postprocess( FILE: mmagic/apis/inferencers/video_restoration_inferencer.py class VideoRestorationInferencer (line 22) | class VideoRestorationInferencer(BaseMMagicInferencer): method preprocess (line 37) | def preprocess(self, video: InputsType) -> Dict: method forward (line 101) | def forward(self, inputs: InputsType) -> PredType: method visualize (line 142) | def visualize(self, method postprocess (line 186) | def postprocess( FILE: mmagic/apis/mmagic_inferencer.py class MMagicInferencer (line 14) | class MMagicInferencer: method __init__ (line 130) | def __init__(self, method _get_inferencer_kwargs (line 150) | def _get_inferencer_kwargs(self, model_name: Optional[str], method print_extra_parameters (line 203) | def print_extra_parameters(self): method infer (line 208) | def infer(self, method get_model_config (line 240) | def get_model_config(self, model_name: str) -> Dict: method init_inference_supported_models_cfg (line 255) | def init_inference_supported_models_cfg() -> None: method get_inference_supported_models (line 280) | def get_inference_supported_models() -> List: method get_inference_supported_tasks (line 285) | def get_inference_supported_tasks() -> List: method get_task_supported_models (line 299) | def get_task_supported_models(task: str) -> List: FILE: mmagic/datasets/basic_conditional_dataset.py class BasicConditionalDataset (line 15) | class BasicConditionalDataset(BaseDataset): method __init__ (line 112) | def __init__(self, method _find_samples (line 146) | def _find_samples(self, file_backend): method load_data_list (line 180) | def load_data_list(self): method is_valid_file (line 212) | def is_valid_file(self, filename: str) -> bool: method img_prefix (line 217) | def img_prefix(self): method CLASSES (line 222) | def CLASSES(self): method class_to_idx (line 227) | def class_to_idx(self): method get_gt_labels (line 236) | def get_gt_labels(self): method get_cat_ids (line 247) | def get_cat_ids(self, idx: int) -> List[int]: method _compat_classes (line 259) | def _compat_classes(self, metainfo, classes): method full_init (line 277) | def full_init(self): method __repr__ (line 290) | def __repr__(self): method extra_repr (line 318) | def extra_repr(self) -> List[str]: FILE: mmagic/datasets/basic_frames_dataset.py class BasicFramesDataset (line 13) | class BasicFramesDataset(BaseDataset): method __init__ (line 129) | def __init__(self, method load_data_list (line 177) | def load_data_list(self) -> List[dict]: method _get_path_list (line 217) | def _get_path_list(self): method _get_path_list_from_ann (line 231) | def _get_path_list_from_ann(self): method _get_path_list_from_folder (line 271) | def _get_path_list_from_folder(self, method _set_seq_lens (line 312) | def _set_seq_lens(self): method _get_frames_list (line 325) | def _get_frames_list(self, key, folder): FILE: mmagic/datasets/basic_image_dataset.py class BasicImageDataset (line 17) | class BasicImageDataset(BaseDataset): method __init__ (line 133) | def __init__(self, method load_data_list (line 175) | def load_data_list(self) -> List[dict]: method _get_path_list (line 200) | def _get_path_list(self): method _get_path_list_from_ann (line 215) | def _get_path_list_from_ann(self): method _get_path_list_from_folder (line 235) | def _get_path_list_from_folder(self): FILE: mmagic/datasets/cifar10_dataset.py class CIFAR10 (line 16) | class CIFAR10(BasicConditionalDataset): method __init__ (line 57) | def __init__(self, method load_data_list (line 74) | def load_data_list(self): method _load_meta (line 140) | def _load_meta(self): method _check_integrity (line 157) | def _check_integrity(self): method extra_repr (line 172) | def extra_repr(self) -> List[str]: FILE: mmagic/datasets/comp1k_dataset.py class AdobeComp1kDataset (line 13) | class AdobeComp1kDataset(BaseDataset): method load_data_list (line 75) | def load_data_list(self) -> List[dict]: method parse_data_info (line 134) | def parse_data_info(self, raw_data_info: dict) -> Union[dict, List[dic... FILE: mmagic/datasets/controlnet_dataset.py class ControlNetDataset (line 12) | class ControlNetDataset(BaseDataset): method __init__ (line 27) | def __init__(self, method load_data_list (line 38) | def load_data_list(self) -> List[dict]: FILE: mmagic/datasets/data_utils.py function infer_io_backend (line 20) | def infer_io_backend(data_root: str) -> str: function calculate_md5 (line 45) | def calculate_md5(fpath: str, function check_md5 (line 70) | def check_md5(fpath, md5, **kwargs) -> bool: function check_integrity (line 83) | def check_integrity(fpath, md5=None) -> bool: function download_url_to_file (line 101) | def download_url_to_file(url, dst, hash_prefix=None, progress=True): function download_url (line 168) | def download_url(url, root, filename=None, md5=None): function _is_tarxz (line 205) | def _is_tarxz(filename): function _is_tar (line 210) | def _is_tar(filename): function _is_targz (line 215) | def _is_targz(filename): function _is_tgz (line 220) | def _is_tgz(filename): function _is_gzip (line 225) | def _is_gzip(filename): function _is_zip (line 230) | def _is_zip(filename): function extract_archive (line 235) | def extract_archive(from_path, to_path=None, remove_finished=False): function download_and_extract_archive (line 265) | def download_and_extract_archive(url, function open_maybe_compressed_file (line 285) | def open_maybe_compressed_file(path: str): function expanduser (line 302) | def expanduser(path): function find_folders (line 313) | def find_folders(root: str, file_backend: BaseStorageBackend function get_samples (line 338) | def get_samples(root: str, folder_to_idx: Dict[str, int], FILE: mmagic/datasets/dreambooth_dataset.py class DreamBoothDataset (line 12) | class DreamBoothDataset(BaseDataset): method __init__ (line 22) | def __init__(self, method load_data_list (line 35) | def load_data_list(self) -> list: FILE: mmagic/datasets/grow_scale_image_dataset.py class GrowScaleImgDataset (line 12) | class GrowScaleImgDataset(BaseDataset): method __init__ (line 62) | def __init__(self, method load_data_list (line 107) | def load_data_list(self): method update_annotations (line 125) | def update_annotations(self, curr_scale): method concat_imgs_list_to (line 151) | def concat_imgs_list_to(self, num): method prepare_train_data (line 166) | def prepare_train_data(self, idx): method prepare_test_data (line 178) | def prepare_test_data(self, idx): method __getitem__ (line 190) | def __getitem__(self, idx): method __repr__ (line 211) | def __repr__(self): FILE: mmagic/datasets/imagenet_dataset.py class ImageNet (line 10) | class ImageNet(BasicConditionalDataset): method __init__ (line 30) | def __init__(self, FILE: mmagic/datasets/mscoco_dataset.py class MSCoCoDataset (line 15) | class MSCoCoDataset(BasicConditionalDataset): method __init__ (line 45) | def __init__(self, method load_data_list (line 81) | def load_data_list(self): FILE: mmagic/datasets/paired_image_dataset.py class PairedImageDataset (line 15) | class PairedImageDataset(BaseDataset): method __init__ (line 32) | def __init__(self, method load_data_list (line 51) | def load_data_list(self): method scan_folder (line 64) | def scan_folder(self, path): FILE: mmagic/datasets/singan_dataset.py function create_real_pyramid (line 11) | def create_real_pyramid(real, min_size, max_size, scale_factor_init): class SinGANDataset (line 63) | class SinGANDataset(BaseDataset): method __init__ (line 80) | def __init__(self, method full_init (line 93) | def full_init(self): method load_data_list (line 99) | def load_data_list(self, min_size, max_size, scale_factor_init): method __getitem__ (line 119) | def __getitem__(self, index): method __len__ (line 132) | def __len__(self): FILE: mmagic/datasets/textual_inversion_dataset.py class TextualInversionDataset (line 14) | class TextualInversionDataset(BaseDataset): method __init__ (line 26) | def __init__( method load_data_list (line 49) | def load_data_list(self) -> list: method prepare_data (line 63) | def prepare_data(self, idx): FILE: mmagic/datasets/transforms/albu_function.py class PairedAlbuTransForms (line 11) | class PairedAlbuTransForms(BaseTransform): method __init__ (line 17) | def __init__(self, method transform (line 55) | def transform(self, results): method __repr__ (line 71) | def __repr__(self): class AlbuTransForms (line 84) | class AlbuTransForms(BaseTransform): method __init__ (line 90) | def __init__(self, method transform (line 125) | def transform(self, results): method __repr__ (line 140) | def __repr__(self): class PairedAlbuNormalize (line 152) | class PairedAlbuNormalize(BaseTransform): method __init__ (line 158) | def __init__(self, method transform (line 182) | def transform(self, results): method __repr__ (line 202) | def __repr__(self): class AlbuNormalize (line 216) | class AlbuNormalize(BaseTransform): method __init__ (line 222) | def __init__(self, method transform (line 243) | def transform(self, results): method __repr__ (line 258) | def __repr__(self): function _resolve_aug_fn (line 270) | def _resolve_aug_fn(name): class AlbuCorruptFunction (line 293) | class AlbuCorruptFunction(BaseTransform): method __init__ (line 299) | def __init__(self, keys: List[str], config: List[dict], p: float = 1.0): method transform (line 312) | def transform(self, results): method __repr__ (line 326) | def __repr__(self): FILE: mmagic/datasets/transforms/albumentations.py class Albumentations (line 20) | class Albumentations(BaseTransform): method __init__ (line 70) | def __init__(self, keys: List[str], transforms: List[dict]) -> None: method albu_builder (line 82) | def albu_builder(self, cfg: dict) -> albumentations: method _apply_albu (line 115) | def _apply_albu(self, imgs): method transform (line 130) | def transform(self, results): method __repr__ (line 138) | def __repr__(self): FILE: mmagic/datasets/transforms/alpha.py class GenerateSeg (line 17) | class GenerateSeg(BaseTransform): method __init__ (line 38) | def __init__(self, method _crop_hole (line 53) | def _crop_hole(img, start_point, hole_size): method transform (line 74) | def transform(self, results: dict) -> dict: method __repr__ (line 113) | def __repr__(self): class GenerateSoftSeg (line 125) | class GenerateSoftSeg(BaseTransform): method __init__ (line 148) | def __init__(self, method transform (line 187) | def transform(self, results: dict) -> dict: method __repr__ (line 231) | def __repr__(self): FILE: mmagic/datasets/transforms/aug_frames.py class MirrorSequence (line 9) | class MirrorSequence(BaseTransform): method __init__ (line 27) | def __init__(self, keys): method transform (line 31) | def transform(self, results): method __repr__ (line 51) | def __repr__(self): class TemporalReverse (line 60) | class TemporalReverse(BaseTransform): method __init__ (line 72) | def __init__(self, keys, reverse_ratio=0.5): method transform (line 77) | def transform(self, results): method __repr__ (line 97) | def __repr__(self): FILE: mmagic/datasets/transforms/aug_pixel.py class BinarizeImage (line 17) | class BinarizeImage(BaseTransform): method __init__ (line 28) | def __init__(self, keys, binary_thr, a_min=0, a_max=1, dtype=np.uint8): method _binarize (line 36) | def _binarize(self, img): method transform (line 55) | def transform(self, results): method __repr__ (line 71) | def __repr__(self): class Clip (line 81) | class Clip(BaseTransform): method __init__ (line 92) | def __init__(self, keys, a_min=0, a_max=255): method _clip (line 98) | def _clip(self, input_): method transform (line 120) | def transform(self, results): method __repr__ (line 137) | def __repr__(self): class ColorJitter (line 146) | class ColorJitter(BaseTransform): method __init__ (line 189) | def __init__(self, keys, channel_order='rgb', **kwargs): method _color_jitter (line 200) | def _color_jitter(self, image, this_seed): method transform (line 224) | def transform(self, results: Dict) -> Dict: method __repr__ (line 246) | def __repr__(self): class RandomAffine (line 259) | class RandomAffine(BaseTransform): method __init__ (line 298) | def __init__(self, method _get_params (line 352) | def _get_params(degrees, translate, scale_ranges, shears, flip_ratio, method _get_inverse_affine_matrix (line 389) | def _get_inverse_affine_matrix(center, angle, translate, scale, shear, method transform (line 439) | def transform(self, results): method __repr__ (line 475) | def __repr__(self): class RandomMaskDilation (line 486) | class RandomMaskDilation(BaseTransform): method __init__ (line 496) | def __init__(self, keys, binary_thr=0., kernel_min=9, kernel_max=49): method _random_dilate (line 503) | def _random_dilate(self, img): method transform (line 514) | def transform(self, results): method __repr__ (line 533) | def __repr__(self): class UnsharpMasking (line 543) | class UnsharpMasking(BaseTransform): method __init__ (line 558) | def __init__(self, kernel_size, sigma, weight, threshold, keys): method _unsharp_masking (line 573) | def _unsharp_masking(self, imgs): method transform (line 596) | def transform(self, results): method __repr__ (line 611) | def __repr__(self): FILE: mmagic/datasets/transforms/aug_shape.py class Flip (line 15) | class Flip(BaseTransform): method __init__ (line 40) | def __init__(self, keys, flip_ratio=0.5, direction='horizontal'): method transform (line 50) | def transform(self, results): method __repr__ (line 83) | def __repr__(self): class RandomRotation (line 93) | class RandomRotation(BaseTransform): method __init__ (line 103) | def __init__(self, keys, degrees): method transform (line 118) | def transform(self, results): method __repr__ (line 139) | def __repr__(self): class RandomTransposeHW (line 148) | class RandomTransposeHW(BaseTransform): method __init__ (line 165) | def __init__(self, keys, transpose_ratio=0.5): method transform (line 170) | def transform(self, results): method __repr__ (line 194) | def __repr__(self): class Resize (line 204) | class Resize(BaseTransform): method __init__ (line 267) | def __init__(self, method _resize (line 315) | def _resize(self, img): method transform (line 350) | def transform(self, results: Dict) -> Dict: method __repr__ (line 393) | def __repr__(self): class NumpyPad (line 406) | class NumpyPad(BaseTransform): method __init__ (line 429) | def __init__(self, keys, padding, **kwargs): method transform (line 436) | def transform(self, results): method __repr__ (line 451) | def __repr__(self) -> str: FILE: mmagic/datasets/transforms/blur_kernels.py function get_rotated_sigma_matrix (line 9) | def get_rotated_sigma_matrix(sig_x, sig_y, theta): function _mesh_grid (line 28) | def _mesh_grid(kernel_size): function calculate_gaussian_pdf (line 53) | def calculate_gaussian_pdf(sigma_matrix, grid): function bivariate_gaussian (line 71) | def bivariate_gaussian(kernel_size, function bivariate_generalized_gaussian (line 118) | def bivariate_generalized_gaussian(kernel_size, function bivariate_plateau (line 168) | def bivariate_plateau(kernel_size, function random_bivariate_gaussian_kernel (line 211) | def random_bivariate_gaussian_kernel(kernel_size, function random_bivariate_generalized_gaussian_kernel (line 266) | def random_bivariate_generalized_gaussian_kernel(kernel_size, function random_bivariate_plateau_kernel (line 334) | def random_bivariate_plateau_kernel(kernel_size, function random_circular_lowpass_kernel (line 402) | def random_circular_lowpass_kernel(omega_range, kernel_size, pad_to=0): function random_mixed_kernels (line 441) | def random_mixed_kernels(kernel_list, FILE: mmagic/datasets/transforms/crop.py class Crop (line 22) | class Crop(BaseTransform): method __init__ (line 34) | def __init__(self, keys, crop_size, random_crop=True, is_pad_zeros=Fal... method _crop (line 46) | def _crop(self, data): method transform (line 109) | def transform(self, results): method __repr__ (line 127) | def __repr__(self): class CropLike (line 137) | class CropLike(BaseTransform): method __init__ (line 147) | def __init__(self, target_key, reference_key=None): method transform (line 153) | def transform(self, results): method __repr__ (line 179) | def __repr__(self): class FixedCrop (line 186) | class FixedCrop(BaseTransform): method __init__ (line 197) | def __init__(self, keys, crop_size, crop_pos=None): method _crop (line 213) | def _crop(self, data, x_offset, y_offset, crop_w, crop_h): method transform (line 232) | def transform(self, results): method __repr__ (line 286) | def __repr__(self): class ModCrop (line 296) | class ModCrop(BaseTransform): method __init__ (line 306) | def __init__(self, key='gt') -> None: method transform (line 311) | def transform(self, results): method __repr__ (line 334) | def __repr__(self): class PairedRandomCrop (line 343) | class PairedRandomCrop(BaseTransform): method __init__ (line 357) | def __init__(self, gt_patch_size, lq_key='img', gt_key='gt'): method transform (line 363) | def transform(self, results): method __repr__ (line 421) | def __repr__(self): class RandomResizedCrop (line 432) | class RandomResizedCrop(BaseTransform): method __init__ (line 458) | def __init__(self, method get_params (line 485) | def get_params(self, data): method transform (line 528) | def transform(self, results): method __repr__ (line 552) | def __repr__(self): class CropAroundCenter (line 563) | class CropAroundCenter(BaseTransform): method __init__ (line 579) | def __init__(self, crop_size): method transform (line 587) | def transform(self, results): method __repr__ (line 657) | def __repr__(self): class CropAroundFg (line 663) | class CropAroundFg(BaseTransform): method __init__ (line 682) | def __init__(self, keys, bd_ratio_range=(0.1, 0.4), test_mode=False): method transform (line 694) | def transform(self, results): class CropAroundUnknown (line 737) | class CropAroundUnknown(BaseTransform): method __init__ (line 760) | def __init__(self, method transform (line 796) | def transform(self, results): method __repr__ (line 842) | def __repr__(self): class RandomCropLongEdge (line 853) | class RandomCropLongEdge(BaseTransform): method __init__ (line 860) | def __init__(self, keys='img'): method transform (line 866) | def transform(self, results): method __repr__ (line 892) | def __repr__(self): class CenterCropLongEdge (line 899) | class CenterCropLongEdge(BaseTransform): method __init__ (line 906) | def __init__(self, keys='img'): method transform (line 912) | def transform(self, results): method __repr__ (line 939) | def __repr__(self): class InstanceCrop (line 946) | class InstanceCrop(BaseTransform): method __init__ (line 959) | def __init__(self, method transform (line 983) | def transform(self, results: dict) -> dict: method predict_bbox (line 1043) | def predict_bbox(self, image): FILE: mmagic/datasets/transforms/fgbg.py class CompositeFg (line 17) | class CompositeFg(BaseTransform): method __init__ (line 45) | def __init__(self, fg_dirs, alpha_dirs, interpolation='nearest'): method transform (line 57) | def transform(self, results: dict) -> dict: method _get_file_list (line 96) | def _get_file_list(self, fg_dirs, alpha_dirs): method __repr__ (line 115) | def __repr__(self): class MergeFgAndBg (line 124) | class MergeFgAndBg(BaseTransform): method transform (line 130) | def transform(self, results: dict) -> dict: method __repr__ (line 147) | def __repr__(self) -> str: class PerturbBg (line 153) | class PerturbBg(BaseTransform): method __init__ (line 163) | def __init__(self, gamma_ratio=0.6): method transform (line 169) | def transform(self, results: dict) -> dict: method __repr__ (line 190) | def __repr__(self): class RandomJitter (line 195) | class RandomJitter(BaseTransform): method __init__ (line 209) | def __init__(self, hue_range=40): method transform (line 220) | def transform(self, results): method __repr__ (line 264) | def __repr__(self): class RandomLoadResizeBg (line 270) | class RandomLoadResizeBg(BaseTransform): method __init__ (line 283) | def __init__(self, bg_dir, flag='color', channel_order='bgr'): method transform (line 293) | def transform(self, results: dict) -> dict: method __repr__ (line 313) | def __repr__(self): FILE: mmagic/datasets/transforms/formatting.py class PackInputs (line 12) | class PackInputs(BaseTransform): method __init__ (line 31) | def __init__( method transform (line 51) | def transform(self, results: dict) -> dict: method __repr__ (line 104) | def __repr__(self) -> str: FILE: mmagic/datasets/transforms/generate_assistant.py class GenerateCoordinateAndCell (line 17) | class GenerateCoordinateAndCell(BaseTransform): method __init__ (line 54) | def __init__(self, method transform (line 65) | def transform(self, results): method __repr__ (line 117) | def __repr__(self): class GenerateFacialHeatmap (line 128) | class GenerateFacialHeatmap(BaseTransform): method __init__ (line 139) | def __init__(self, method transform (line 168) | def transform(self, results): method generate_heatmap_from_img (line 196) | def generate_heatmap_from_img(self, image): method _face_alignment_detector (line 217) | def _face_alignment_detector(self, image): method _generate_one_heatmap (line 239) | def _generate_one_heatmap(self, keypoint): method __repr__ (line 260) | def __repr__(self): FILE: mmagic/datasets/transforms/generate_frame_indices.py class GenerateFrameIndices (line 12) | class GenerateFrameIndices(BaseTransform): method __init__ (line 41) | def __init__(self, interval_list, frames_per_clip=99): method transform (line 46) | def transform(self, results): method __repr__ (line 93) | def __repr__(self): class GenerateFrameIndiceswithPadding (line 103) | class GenerateFrameIndiceswithPadding(BaseTransform): method __init__ (line 135) | def __init__(self, padding, filename_tmpl='{:08d}'): method transform (line 145) | def transform(self, results): method __repr__ (line 200) | def __repr__(self): class GenerateSegmentIndices (line 208) | class GenerateSegmentIndices(BaseTransform): method __init__ (line 239) | def __init__(self, interval_list, start_idx=0, filename_tmpl='{:08d}.p... method transform (line 245) | def transform(self, results): method __repr__ (line 295) | def __repr__(self): FILE: mmagic/datasets/transforms/get_masked_image.py class GetMaskedImage (line 11) | class GetMaskedImage(BaseTransform): method __init__ (line 23) | def __init__(self, method transform (line 33) | def transform(self, results): method __repr__ (line 62) | def __repr__(self): FILE: mmagic/datasets/transforms/loading.py class LoadImageFromFile (line 16) | class LoadImageFromFile(BaseTransform): method __init__ (line 48) | def __init__( method transform (line 83) | def transform(self, results: dict) -> dict: method _load_image (line 129) | def _load_image(self, filename): method _convert (line 160) | def _convert(self, img: np.ndarray): method __repr__ (line 187) | def __repr__(self): class LoadMask (line 204) | class LoadMask(BaseTransform): method __init__ (line 271) | def __init__(self, mask_mode='bbox', mask_config=None): method _init_info (line 279) | def _init_info(self): method _get_random_mask_from_set (line 301) | def _get_random_mask_from_set(self): method _get_mask_from_file (line 317) | def _get_mask_from_file(self, path): method transform (line 332) | def transform(self, results): method __repr__ (line 361) | def __repr__(self): class GetSpatialDiscountMask (line 366) | class GetSpatialDiscountMask(BaseTransform): method __init__ (line 379) | def __init__(self, gamma=0.99, beta=1.5): method spatial_discount_mask (line 383) | def spatial_discount_mask(self, mask_width, mask_height): method transform (line 402) | def transform(self, results): method __repr__ (line 426) | def __repr__(self): class LoadPairedImageFromFile (line 432) | class LoadPairedImageFromFile(LoadImageFromFile): method __init__ (line 474) | def __init__(self, method transform (line 494) | def transform(self, results: dict) -> dict: FILE: mmagic/datasets/transforms/matlab_like_resize.py function get_size_from_scale (line 11) | def get_size_from_scale(input_size, scale_factor): function get_scale_from_size (line 30) | def get_scale_from_size(input_size, output_size): function _cubic (line 49) | def _cubic(x): function get_weights_indices (line 73) | def get_weights_indices(input_length, output_length, scale, kernel, function resize_along_dim (line 127) | def resize_along_dim(img_in, weights, indices, dim): class MATLABLikeResize (line 169) | class MATLABLikeResize(BaseTransform): method __init__ (line 193) | def __init__(self, method _resize (line 216) | def _resize(self, img): method transform (line 259) | def transform(self, results): method __repr__ (line 285) | def __repr__(self): FILE: mmagic/datasets/transforms/normalization.py class Normalize (line 10) | class Normalize(BaseTransform): method __init__ (line 26) | def __init__(self, keys, mean, std, to_rgb=False, save_original=False): method transform (line 33) | def transform(self, results): method __repr__ (line 63) | def __repr__(self): class RescaleToZeroOne (line 72) | class RescaleToZeroOne(BaseTransform): method __init__ (line 83) | def __init__(self, keys): method transform (line 86) | def transform(self, results): method __repr__ (line 105) | def __repr__(self): FILE: mmagic/datasets/transforms/random_degradations.py class RandomBlur (line 20) | class RandomBlur: method __init__ (line 31) | def __init__(self, params, keys): method get_kernel (line 35) | def get_kernel(self, num_kernels: int): method _apply_random_blur (line 114) | def _apply_random_blur(self, imgs): method __call__ (line 140) | def __call__(self, results): method __repr__ (line 150) | def __repr__(self): class RandomJPEGCompression (line 158) | class RandomJPEGCompression: method __init__ (line 170) | def __init__(self, params, keys, color_type='color', bgr2rgb=False): method _apply_random_compression (line 176) | def _apply_random_compression(self, imgs): method __call__ (line 212) | def __call__(self, results): method __repr__ (line 222) | def __repr__(self): class RandomNoise (line 230) | class RandomNoise: method __init__ (line 243) | def __init__(self, params, keys): method _apply_gaussian_noise (line 247) | def _apply_gaussian_noise(self, imgs): method _apply_poisson_noise (line 277) | def _apply_poisson_noise(self, imgs): method _apply_random_noise (line 305) | def _apply_random_noise(self, imgs): method __call__ (line 335) | def __call__(self, results): method __repr__ (line 345) | def __repr__(self): class RandomResize (line 353) | class RandomResize: method __init__ (line 364) | def __init__(self, params, keys): method _random_resize (line 374) | def _random_resize(self, imgs): method __call__ (line 451) | def __call__(self, results): method __repr__ (line 461) | def __repr__(self): class RandomVideoCompression (line 469) | class RandomVideoCompression: method __init__ (line 480) | def __init__(self, params, keys): method _apply_random_compression (line 487) | def _apply_random_compression(self, imgs): method __call__ (line 529) | def __call__(self, results): method __repr__ (line 539) | def __repr__(self): class DegradationsWithShuffle (line 556) | class DegradationsWithShuffle: method __init__ (line 583) | def __init__(self, degradations, keys, shuffle_idx=None): method _build_degradations (line 594) | def _build_degradations(self, degradations): method __call__ (line 605) | def __call__(self, results): method __repr__ (line 624) | def __repr__(self): FILE: mmagic/datasets/transforms/random_down_sampling.py class RandomDownSampling (line 13) | class RandomDownSampling(BaseTransform): method __init__ (line 36) | def __init__(self, method transform (line 50) | def transform(self, results): method __repr__ (line 91) | def __repr__(self): function resize_fn (line 102) | def resize_fn(img, size, interpolation='bicubic', backend='pillow'): FILE: mmagic/datasets/transforms/trimap.py class FormatTrimap (line 13) | class FormatTrimap(BaseTransform): method __init__ (line 26) | def __init__(self, to_onehot=False): method transform (line 29) | def transform(self, results): method __repr__ (line 56) | def __repr__(self): class GenerateTrimap (line 61) | class GenerateTrimap(BaseTransform): method __init__ (line 82) | def __init__(self, kernel_size, iterations=1, random=True): method transform (line 113) | def transform(self, results: dict) -> dict: method __repr__ (line 148) | def __repr__(self): class GenerateTrimapWithDistTransform (line 156) | class GenerateTrimapWithDistTransform(BaseTransform): method __init__ (line 169) | def __init__(self, dist_thr=20, random=True): method transform (line 176) | def transform(self, results: dict) -> dict: method __repr__ (line 201) | def __repr__(self): class TransformTrimap (line 208) | class TransformTrimap(BaseTransform): method transform (line 223) | def transform(self, results: dict) -> dict: method __repr__ (line 255) | def __repr__(self): FILE: mmagic/datasets/transforms/values.py class CopyValues (line 11) | class CopyValues(BaseTransform): method __init__ (line 34) | def __init__(self, src_keys, dst_keys): method transform (line 46) | def transform(self, results): method __repr__ (line 62) | def __repr__(self): class SetValues (line 72) | class SetValues(BaseTransform): method __init__ (line 91) | def __init__(self, dictionary): method transform (line 95) | def transform(self, results: Dict): method __repr__ (line 111) | def __repr__(self): FILE: mmagic/datasets/unpaired_image_dataset.py class UnpairedImageDataset (line 16) | class UnpairedImageDataset(BaseDataset): method __init__ (line 40) | def __init__(self, method load_data_list (line 70) | def load_data_list(self): method _load_domain_data_list (line 80) | def _load_domain_data_list(self, dataroot): method get_data_info (line 97) | def get_data_info(self, idx) -> dict: method __len__ (line 118) | def __len__(self): method scan_folder (line 122) | def scan_folder(self, path): FILE: mmagic/engine/hooks/ema.py class ExponentialMovingAverageHook (line 18) | class ExponentialMovingAverageHook(Hook): method __init__ (line 45) | def __init__(self, method lerp (line 72) | def lerp(a, b, momentum=0.001, momentum_nontrainable=1., trainable=True): method every_n_iters (line 103) | def every_n_iters(self, runner: Runner, n: int): method after_train_iter (line 118) | def after_train_iter(self, method before_run (line 154) | def before_run(self, runner: Runner): FILE: mmagic/engine/hooks/iter_time_hook.py class IterTimerHook (line 14) | class IterTimerHook(BaseIterTimerHook): method _after_iter (line 23) | def _after_iter(self, FILE: mmagic/engine/hooks/pggan_fetch_data_hook.py class PGGANFetchDataHook (line 18) | class PGGANFetchDataHook(Hook): method __init__ (line 26) | def __init__(self): method before_train_iter (line 29) | def before_train_iter(self, method update_dataloader (line 49) | def update_dataloader(self, dataloader: DataLoader, FILE: mmagic/engine/hooks/pickle_data_hook.py class PickleDataHook (line 22) | class PickleDataHook(Hook): method __init__ (line 43) | def __init__(self, method after_run (line 59) | def after_run(self, runner): method before_run (line 69) | def before_run(self, runner): method after_train_iter (line 79) | def after_train_iter(self, method _pickle_data (line 98) | def _pickle_data(self, runner: Runner): method _get_numpy_data (line 130) | def _get_numpy_data( FILE: mmagic/engine/hooks/reduce_lr_scheduler_hook.py class ReduceLRSchedulerHook (line 14) | class ReduceLRSchedulerHook(ParamSchedulerHook): method __init__ (line 24) | def __init__(self, method _calculate_average_value (line 38) | def _calculate_average_value(self): method after_train_epoch (line 44) | def after_train_epoch(self, runner: Runner): method after_train_iter (line 61) | def after_train_iter(self, method after_val_epoch (line 98) | def after_val_epoch(self, FILE: mmagic/engine/hooks/visualization_hook.py class BasicVisualizationHook (line 23) | class BasicVisualizationHook(Hook): method __init__ (line 34) | def __init__(self, method _after_iter (line 46) | def _after_iter( class VisualizationHook (line 82) | class VisualizationHook(Hook): method __init__ (line 173) | def __init__(self, method after_val_iter (line 216) | def after_val_iter(self, runner: Runner, batch_idx: int, data_batch: d... method after_test_iter (line 231) | def after_test_iter(self, runner: Runner, batch_idx: int, data_batch: ... method after_train_iter (line 276) | def after_train_iter(self, method vis_sample (line 294) | def vis_sample(self, method vis_from_message_hub (line 393) | def vis_from_message_hub(self, batch_idx: int): FILE: mmagic/engine/optimizers/multi_optimizer_constructor.py class MultiOptimWrapperConstructor (line 15) | class MultiOptimWrapperConstructor: method __init__ (line 116) | def __init__(self, optim_wrapper_cfg: dict, paramwise_cfg=None): method __call__ (line 143) | def __call__(self, function get_params_by_names (line 215) | def get_params_by_names(module: nn.Module, FILE: mmagic/engine/optimizers/pggan_optimizer_constructor.py class PGGANOptimWrapperConstructor (line 13) | class PGGANOptimWrapperConstructor: method __init__ (line 76) | def __init__(self, method __call__ (line 98) | def __call__(self, module: nn.Module) -> OptimWrapperDict: FILE: mmagic/engine/optimizers/singan_optimizer_constructor.py class SinGANOptimWrapperConstructor (line 11) | class SinGANOptimWrapperConstructor: method __init__ (line 56) | def __init__(self, method __call__ (line 72) | def __call__(self, module: nn.Module) -> OptimWrapperDict: FILE: mmagic/engine/runner/log_processor.py class LogProcessor (line 8) | class LogProcessor(BaseLogProcessor): method _get_dataloader_size (line 17) | def _get_dataloader_size(self, runner, mode) -> int: FILE: mmagic/engine/runner/loop_utils.py function update_and_check_evaluator (line 11) | def update_and_check_evaluator(evaluator: EVALUATOR_TYPE function is_evaluator (line 51) | def is_evaluator(evaluator: Any) -> bool: FILE: mmagic/engine/runner/multi_loops.py class MultiValLoop (line 19) | class MultiValLoop(BaseLoop): method __init__ (line 79) | def __init__(self, method total_length (line 99) | def total_length(self) -> int: method _build_dataloaders (line 109) | def _build_dataloaders(self, method _build_evaluators (line 136) | def _build_evaluators(self, evaluator: EVALUATOR_TYPE) -> List[Evaluat... method run (line 167) | def run(self): method run_iter (line 251) | def run_iter(self, idx, data_batch: dict, metrics: Sequence[BaseMetric]): class MultiTestLoop (line 274) | class MultiTestLoop(BaseLoop): method __init__ (line 334) | def __init__(self, runner, dataloader, evaluator, fp16=False): method total_length (line 350) | def total_length(self) -> int: method _build_dataloaders (line 360) | def _build_dataloaders(self, method _build_evaluators (line 387) | def _build_evaluators(self, evaluator: EVALUATOR_TYPE) -> List[Evaluat... method run (line 418) | def run(self): method run_iter (line 502) | def run_iter(self, idx, data_batch: dict, metrics: Sequence[BaseMetric]): FILE: mmagic/engine/schedulers/linear_lr_scheduler_with_interval.py class LinearLrInterval (line 9) | class LinearLrInterval(LinearLR): method __init__ (line 23) | def __init__(self, *args, interval=1, **kwargs): method _get_value (line 27) | def _get_value(self): FILE: mmagic/engine/schedulers/reduce_lr_scheduler.py class ReduceLR (line 9) | class ReduceLR(_ParamScheduler): method __init__ (line 59) | def __init__(self, method _get_value (line 103) | def _get_value(self): method _init_is_better (line 138) | def _init_is_better(self, mode): method _reset (line 144) | def _reset(self): method is_better (line 149) | def is_better(self, a, best): method in_cooldown (line 162) | def in_cooldown(self): FILE: mmagic/evaluation/evaluator.py class Evaluator (line 16) | class Evaluator(Evaluator): method __init__ (line 46) | def __init__(self, metrics: Union[dict, BaseMetric, Sequence]): method prepare_metrics (line 53) | def prepare_metrics(self, module: BaseModel, dataloader: DataLoader): method _cal_metric_hash (line 83) | def _cal_metric_hash(metric: GenMetric): method prepare_samplers (line 97) | def prepare_samplers(self, module: BaseModel, dataloader: DataLoader method process (line 137) | def process(self, data_samples: Sequence[DataSample], method evaluate (line 164) | def evaluate(self) -> dict: FILE: mmagic/evaluation/functional/fid_inception.py class InceptionV3 (line 19) | class InceptionV3(nn.Module): method __init__ (line 34) | def __init__(self, method forward (line 126) | def forward(self, inp): function fid_inception_v3 (line 158) | def fid_inception_v3(load_ckpt=True): class FIDInceptionA (line 186) | class FIDInceptionA(models.inception.InceptionA): method __init__ (line 189) | def __init__(self, in_channels, pool_features): method forward (line 192) | def forward(self, x): class FIDInceptionC (line 220) | class FIDInceptionC(models.inception.InceptionC): method __init__ (line 223) | def __init__(self, in_channels, channels_7x7): method forward (line 226) | def forward(self, x): class FIDInceptionE_1 (line 257) | class FIDInceptionE_1(models.inception.InceptionE): method __init__ (line 260) | def __init__(self, in_channels): method forward (line 263) | def forward(self, x): class FIDInceptionE_2 (line 299) | class FIDInceptionE_2(models.inception.InceptionE): method __init__ (line 302) | def __init__(self, in_channels): method forward (line 305) | def forward(self, x): FILE: mmagic/evaluation/functional/gaussian_funcs.py function gaussian (line 6) | def gaussian(x, sigma): function dgaussian (line 19) | def dgaussian(x, sigma): function gauss_filter (line 32) | def gauss_filter(sigma, epsilon=1e-2): function gauss_gradient (line 63) | def gauss_gradient(img, sigma): FILE: mmagic/evaluation/functional/inception_utils.py function disable_gpu_fuser_on_pt19 (line 32) | def disable_gpu_fuser_on_pt19(): function load_inception (line 48) | def load_inception(inception_args, metric): function _load_inception_from_path (line 107) | def _load_inception_from_path(inception_path): function _load_inception_from_url (line 129) | def _load_inception_from_url(inception_url: str) -> nn.Module: function _load_inception_torch (line 143) | def _load_inception_torch(inception_args, metric) -> nn.Module: function get_inception_feat_cache_name_and_args (line 162) | def get_inception_feat_cache_name_and_args(dataloader: DataLoader, function get_vgg_feat_cache_name_and_args (line 229) | def get_vgg_feat_cache_name_and_args(dataloader: DataLoader, function prepare_inception_feat (line 276) | def prepare_inception_feat(dataloader: DataLoader, function prepare_vgg_feat (line 450) | def prepare_vgg_feat(dataloader: DataLoader, FILE: mmagic/evaluation/metrics/base_gen_metric.py class GenMetric (line 21) | class GenMetric(BaseMetric): method __init__ (line 45) | def __init__(self, method real_nums_per_device (line 64) | def real_nums_per_device(self): method fake_nums_per_device (line 69) | def fake_nums_per_device(self): method _collect_target_results (line 73) | def _collect_target_results(self, target: str) -> Optional[list]: method evaluate (line 110) | def evaluate(self) -> dict: method get_metric_sampler (line 145) | def get_metric_sampler(self, model: nn.Module, dataloader: DataLoader, method compute_metrics (line 177) | def compute_metrics(self, results_fake, results_real) -> dict: method prepare (line 188) | def prepare(self, module: nn.Module, dataloader: DataLoader) -> None: class GenerativeMetric (line 201) | class GenerativeMetric(GenMetric): method __init__ (line 235) | def __init__(self, method get_metric_sampler (line 253) | def get_metric_sampler(self, model: nn.Module, dataloader: DataLoader, method evaluate (line 330) | def evaluate(self) -> dict(): method compute_metrics (line 361) | def compute_metrics(self, results) -> dict: FILE: mmagic/evaluation/metrics/base_sample_wise_metric.py class BaseSampleWiseMetric (line 16) | class BaseSampleWiseMetric(BaseMetric): method __init__ (line 45) | def __init__(self, method compute_metrics (line 65) | def compute_metrics(self, results: List): method process (line 80) | def process(self, data_batch: Sequence[dict], method process_image (line 112) | def process_image(self, gt, pred, mask): method evaluate (line 115) | def evaluate(self) -> dict: method prepare (line 121) | def prepare(self, module: nn.Module, dataloader: DataLoader): method get_metric_sampler (line 127) | def get_metric_sampler(self, model: nn.Module, dataloader: DataLoader, FILE: mmagic/evaluation/metrics/connectivity_error.py class ConnectivityError (line 18) | class ConnectivityError(BaseSampleWiseMetric): method __init__ (line 45) | def __init__( method prepare (line 55) | def prepare(self, module: nn.Module, dataloader: DataLoader): method process (line 61) | def process(self, data_batch: Sequence[dict], method compute_metrics (line 115) | def compute_metrics(self, results: List): FILE: mmagic/evaluation/metrics/equivariance.py class Equivariance (line 18) | class Equivariance(GenerativeMetric): method __init__ (line 22) | def __init__(self, method process (line 57) | def process(self, data_batch: dict, data_samples: Sequence[dict]) -> N... method get_metric_sampler (line 78) | def get_metric_sampler(self, model: nn.Module, dataloader: DataLoader, method compute_metrics (line 109) | def compute_metrics(self, results) -> dict: method _collect_target_results (line 130) | def _collect_target_results(self, target: str) -> Optional[list]: class eq_iterator (line 154) | class eq_iterator: method __init__ (line 156) | def __init__(self, batch_size, max_length, sample_mode, eq_cfg, method __iter__ (line 164) | def __iter__(self) -> Iterator: method __len__ (line 168) | def __len__(self) -> int: method __next__ (line 171) | def __next__(self) -> dict: FILE: mmagic/evaluation/metrics/fid.py class FrechetInceptionDistance (line 21) | class FrechetInceptionDistance(GenerativeMetric): method __init__ (line 65) | def __init__(self, method prepare (line 88) | def prepare(self, module: nn.Module, dataloader: DataLoader) -> None: method _load_inception (line 104) | def _load_inception(self, inception_style: str, method forward_inception (line 126) | def forward_inception(self, image: Tensor) -> Tensor: method process (line 148) | def process(self, data_batch: dict, data_samples: Sequence[dict]) -> N... method _calc_fid (line 189) | def _calc_fid(sample_mean: np.ndarray, method compute_metrics (line 224) | def compute_metrics(self, fake_results: list) -> dict: class TransFID (line 246) | class TransFID(FrechetInceptionDistance): method __init__ (line 248) | def __init__(self, method get_metric_sampler (line 267) | def get_metric_sampler(self, model: nn.Module, dataloader: DataLoader, FILE: mmagic/evaluation/metrics/gradient_error.py class GradientError (line 17) | class GradientError(BaseSampleWiseMetric): method __init__ (line 44) | def __init__( method prepare (line 54) | def prepare(self, module: nn.Module, dataloader: DataLoader): method process (line 60) | def process(self, data_batch: Sequence[dict], method compute_metrics (line 93) | def compute_metrics(self, results: List): FILE: mmagic/evaluation/metrics/inception_score.py class InceptionScore (line 22) | class InceptionScore(GenerativeMetric): method __init__ (line 92) | def __init__(self, method prepare (line 132) | def prepare(self, module: nn.Module, dataloader: DataLoader) -> None: method _load_inception (line 143) | def _load_inception(self, inception_style: str, method _preprocess (line 161) | def _preprocess(self, image: Tensor) -> Tensor: method process (line 193) | def process(self, data_batch: dict, data_samples: Sequence[dict]) -> N... method compute_metrics (line 232) | def compute_metrics(self, fake_results: list) -> dict: class TransIS (line 262) | class TransIS(InceptionScore): method __init__ (line 315) | def __init__(self, method get_metric_sampler (line 334) | def get_metric_sampler(self, model: nn.Module, dataloader: DataLoader, FILE: mmagic/evaluation/metrics/mae.py class MAE (line 11) | class MAE(BaseSampleWiseMetric): method process_image (line 36) | def process_image(self, gt, pred, mask): FILE: mmagic/evaluation/metrics/matting_mse.py class MattingMSE (line 14) | class MattingMSE(BaseSampleWiseMetric): method __init__ (line 44) | def __init__( method prepare (line 52) | def prepare(self, module: nn.Module, dataloader: DataLoader): method process (line 58) | def process(self, data_batch: Sequence[dict], method compute_metrics (line 79) | def compute_metrics(self, results: List): FILE: mmagic/evaluation/metrics/metrics_utils.py function _assert_ndim (line 9) | def _assert_ndim(input, name, ndim, shape_hint): function _assert_masked (line 15) | def _assert_masked(pred_alpha, trimap): function _fetch_data_and_check (line 22) | def _fetch_data_and_check(data_samples): function average (line 53) | def average(results, key): function img_transform (line 74) | def img_transform(img, function obtain_data (line 129) | def obtain_data(data_sample, key, device='cpu'): FILE: mmagic/evaluation/metrics/ms_ssim.py function _f_special_gauss (line 14) | def _f_special_gauss(size, sigma): function _hox_downsample (line 38) | def _hox_downsample(img): function _ssim_for_multi_scale (line 53) | def _ssim_for_multi_scale(img1, function ms_ssim (line 143) | def ms_ssim(img1, class MultiScaleStructureSimilarity (line 229) | class MultiScaleStructureSimilarity(GenerativeMetric): method __init__ (line 262) | def __init__(self, method process (line 275) | def process(self, data_batch: dict, data_samples: Sequence[dict]) -> N... method _collect_target_results (line 309) | def _collect_target_results(self, target: str) -> Optional[list]: method compute_metrics (line 341) | def compute_metrics(self, results_fake: List): FILE: mmagic/evaluation/metrics/mse.py class MSE (line 9) | class MSE(BaseSampleWiseMetric): method process_image (line 34) | def process_image(self, gt, pred, mask): FILE: mmagic/evaluation/metrics/niqe.py class NIQE (line 19) | class NIQE(BaseSampleWiseMetric): method __init__ (line 57) | def __init__(self, method process_image (line 79) | def process_image(self, gt, pred, mask) -> None: function estimate_aggd_param (line 98) | def estimate_aggd_param(block): function compute_feature (line 128) | def compute_feature(block): function niqe_core (line 154) | def niqe_core(img, function niqe (line 242) | def niqe(img, crop_border, input_order='HWC', convert_to='y'): FILE: mmagic/evaluation/metrics/ppl.py function slerp (line 16) | def slerp(a, b, percent): class PerceptualPathLength (line 40) | class PerceptualPathLength(GenerativeMetric): method __init__ (line 74) | def __init__(self, method process (line 98) | def process(self, data_batch: dict, data_samples: Sequence[dict]) -> N... method _compute_distance (line 127) | def _compute_distance(self, images): method compute_metrics (line 155) | def compute_metrics(self, fake_results: list) -> dict: method get_metric_sampler (line 169) | def get_metric_sampler(self, model: nn.Module, dataloader: DataLoader, FILE: mmagic/evaluation/metrics/precision_and_recall.py function compute_pr_distances (line 19) | def compute_pr_distances(row_features, class PrecisionAndRecall (line 49) | class PrecisionAndRecall(GenerativeMetric): method __init__ (line 104) | def __init__(self, method _load_vgg (line 131) | def _load_vgg(self, vgg16_script: Optional[str]) -> Tuple[nn.Module, b... method extract_features (line 154) | def extract_features(self, images: torch.Tensor) -> torch.Tensor: method compute_metrics (line 177) | def compute_metrics(self, results_fake) -> dict: method process (line 218) | def process(self, data_batch: dict, data_samples: Sequence[dict]) -> N... method prepare (line 246) | def prepare(self, module: nn.Module, dataloader: DataLoader) -> None: FILE: mmagic/evaluation/metrics/psnr.py class PSNR (line 12) | class PSNR(BaseSampleWiseMetric): method __init__ (line 43) | def __init__(self, method process_image (line 62) | def process_image(self, gt, pred, mask): function psnr (line 82) | def psnr(img1, FILE: mmagic/evaluation/metrics/sad.py class SAD (line 15) | class SAD(BaseSampleWiseMetric): method __init__ (line 45) | def __init__( method prepare (line 53) | def prepare(self, module: nn.Module, dataloader: DataLoader): method process (line 59) | def process(self, data_batch: Sequence[dict], method compute_metrics (line 79) | def compute_metrics(self, results: List): FILE: mmagic/evaluation/metrics/snr.py class SNR (line 12) | class SNR(BaseSampleWiseMetric): method __init__ (line 43) | def __init__(self, method process_image (line 62) | def process_image(self, gt, pred, mask): function snr (line 82) | def snr(gt, FILE: mmagic/evaluation/metrics/ssim.py class SSIM (line 14) | class SSIM(BaseSampleWiseMetric): method __init__ (line 52) | def __init__(self, method process_image (line 71) | def process_image(self, gt, pred, mask): function _ssim (line 91) | def _ssim(img1, img2): function ssim (line 125) | def ssim(img1, FILE: mmagic/evaluation/metrics/swd.py function sliced_wasserstein (line 13) | def sliced_wasserstein(distribution_a, function get_gaussian_kernel (line 54) | def get_gaussian_kernel(): function get_pyramid_layer (line 67) | def get_pyramid_layer(image, gaussian_k, direction='down'): function gaussian_pyramid (line 93) | def gaussian_pyramid(original, n_pyramids, gaussian_k): function laplacian_pyramid (line 113) | def laplacian_pyramid(original, n_pyramids, gaussian_k): function get_descriptors_for_minibatch (line 140) | def get_descriptors_for_minibatch(minibatch, nhood_size, nhoods_per_image): function finalize_descriptors (line 165) | def finalize_descriptors(desc): class SlicedWassersteinDistance (line 187) | class SlicedWassersteinDistance(GenMetric): method __init__ (line 219) | def __init__(self, method process (line 248) | def process(self, data_batch: dict, data_samples: Sequence[dict]) -> N... method _collect_target_results (line 315) | def _collect_target_results(self, target: str) -> Optional[list]: method compute_metrics (line 345) | def compute_metrics(self, results_fake, results_real) -> dict: FILE: mmagic/models/archs/__init__.py function register_diffusers_models (line 31) | def register_diffusers_models() -> List[str]: FILE: mmagic/models/archs/all_gather_layer.py class AllGatherLayer (line 7) | class AllGatherLayer(autograd.Function): method forward (line 16) | def forward(ctx, x): method backward (line 24) | def backward(ctx, *grad_outputs): FILE: mmagic/models/archs/aspp.py class ASPPPooling (line 12) | class ASPPPooling(nn.Sequential): method __init__ (line 28) | def __init__(self, in_channels: int, out_channels: int, method forward (line 41) | def forward(self, x: Tensor) -> Tensor: class ASPP (line 57) | class ASPP(nn.Module): method __init__ (line 85) | def __init__(self, method forward (line 138) | def forward(self, x: Tensor) -> Tensor: FILE: mmagic/models/archs/attention_injection.py function torch_dfs (line 12) | def torch_dfs(model: torch.nn.Module): class AttentionInjection (line 19) | class AttentionInjection(nn.Module): method __init__ (line 26) | def __init__(self, module: nn.Module, injection_weight=5): method forward (line 122) | def forward(self, FILE: mmagic/models/archs/downsample.py function pixel_unshuffle (line 5) | def pixel_unshuffle(x: Tensor, scale: int) -> Tensor: FILE: mmagic/models/archs/ensemble.py class SpatialTemporalEnsemble (line 8) | class SpatialTemporalEnsemble(nn.Module): method __init__ (line 18) | def __init__(self, is_temporal_ensemble: Optional[bool] = False): method _transform (line 24) | def _transform(self, imgs: torch.Tensor, mode: str) -> torch.Tensor: method spatial_ensemble (line 57) | def spatial_ensemble(self, imgs: torch.Tensor, method forward (line 88) | def forward(self, imgs: torch.Tensor, model: nn.Module) -> torch.Tensor: FILE: mmagic/models/archs/gated_conv_module.py class SimpleGatedConvModule (line 10) | class SimpleGatedConvModule(nn.Module): method __init__ (line 35) | def __init__(self, method forward (line 58) | def forward(self, x: torch.Tensor) -> torch.Tensor: FILE: mmagic/models/archs/img_normalize.py class ImgNormalize (line 8) | class ImgNormalize(nn.Conv2d): method __init__ (line 20) | def __init__(self, FILE: mmagic/models/archs/linear_module.py class LinearModule (line 10) | class LinearModule(nn.Module): method __init__ (line 29) | def __init__(self, method init_weights (line 68) | def init_weights(self) -> None: method forward (line 79) | def forward(self, x: Tensor, activate: Optional[bool] = True) -> Tensor: FILE: mmagic/models/archs/lora.py class LoRALinear (line 10) | class LoRALinear(nn.Module): method __init__ (line 19) | def __init__(self, in_feat: int, out_feat: int, rank: int = 4): method forward (line 30) | def forward(self, x: Tensor) -> Tensor: class LoRAWrapper (line 39) | class LoRAWrapper(nn.Module): method __init__ (line 53) | def __init__(self, method add_lora (line 104) | def add_lora(self, method _set_value (line 145) | def _set_value(self, method set_scale (line 174) | def set_scale(self, scale: float, name: Optional[str] = None): method set_enable (line 183) | def set_enable(self, name: Optional[str] = None): method set_disable (line 191) | def set_disable(self, name: Optional[str] = None): method forward_lora_mapping (line 199) | def forward_lora_mapping(self, x: Tensor) -> Tensor: method forward (line 222) | def forward(self, x: Tensor, *args, **kwargs) -> Tensor: method wrap_lora (line 235) | def wrap_lora(cls, module, rank=4, scale=1, names=None, state_dict=None): function replace_module (line 259) | def replace_module(parent_module: nn.Module, child_name: str, function get_submodule (line 265) | def get_submodule(module: nn.Module, key: str): function set_lora (line 273) | def set_lora(module: nn.Module, function set_only_lora_trainable (line 349) | def set_only_lora_trainable(module: nn.Module) -> nn.Module: function set_lora_enable (line 361) | def set_lora_enable(module: nn.Module) -> nn.Module: function set_lora_disable (line 371) | def set_lora_disable(module: nn.Module) -> nn.Module: FILE: mmagic/models/archs/multi_layer_disc.py class MultiLayerDiscriminator (line 15) | class MultiLayerDiscriminator(nn.Module): method __init__ (line 49) | def __init__(self, method forward (line 134) | def forward(self, x: Tensor) -> Tensor: method init_weights (line 155) | def init_weights(self, pretrained: Optional[str] = None) -> None: FILE: mmagic/models/archs/patch_disc.py class PatchDiscriminator (line 14) | class PatchDiscriminator(BaseModule): method __init__ (line 31) | def __init__(self, method forward (line 110) | def forward(self, x: Tensor) -> Tensor: method init_weights (line 121) | def init_weights(self) -> None: FILE: mmagic/models/archs/resnet.py class BasicBlock (line 14) | class BasicBlock(nn.Module): method __init__ (line 35) | def __init__(self, method norm1 (line 71) | def norm1(self) -> nn.Module: method norm2 (line 76) | def norm2(self) -> nn.Module: method forward (line 80) | def forward(self, x: Tensor) -> Tensor: class Bottleneck (line 110) | class Bottleneck(nn.Module): method __init__ (line 131) | def __init__(self, method norm1 (line 191) | def norm1(self) -> nn.Module: method norm2 (line 196) | def norm2(self) -> nn.Module: method norm3 (line 201) | def norm3(self) -> nn.Module: method forward (line 205) | def forward(self, x: Tensor) -> Tensor: class ResNet (line 228) | class ResNet(nn.Module): method __init__ (line 274) | def __init__(self, method _make_stem_layer (line 340) | def _make_stem_layer(self, in_channels: int, stem_channels: int) -> None: method norm1 (line 390) | def norm1(self) -> nn.Module: method _make_layer (line 394) | def _make_layer(self, method _nostride_dilate (line 435) | def _nostride_dilate(self, m: nn.Module, dilate: int) -> None: method init_weights (line 451) | def init_weights(self, pretrained: Optional[str] = None) -> None: method _freeze_stages (line 477) | def _freeze_stages(self) -> None: method forward (line 496) | def forward(self, x: Tensor) -> List[Tensor]: FILE: mmagic/models/archs/separable_conv_module.py class DepthwiseSeparableConvModule (line 9) | class DepthwiseSeparableConvModule(nn.Module): method __init__ (line 44) | def __init__(self, method forward (line 89) | def forward(self, x: Tensor) -> Tensor: FILE: mmagic/models/archs/simple_encoder_decoder.py class SimpleEncoderDecoder (line 11) | class SimpleEncoderDecoder(BaseModule): method __init__ (line 20) | def __init__(self, method forward (line 31) | def forward(self, *args, **kwargs) -> Tensor: FILE: mmagic/models/archs/smpatch_disc.py class SoftMaskPatchDiscriminator (line 14) | class SoftMaskPatchDiscriminator(BaseModule): method __init__ (line 33) | def __init__(self, method forward (line 109) | def forward(self, x: Tensor) -> Tensor: method init_weights (line 120) | def init_weights(self) -> None: FILE: mmagic/models/archs/sr_backbone.py class ResidualBlockNoBN (line 41) | class ResidualBlockNoBN(nn.Module): method __init__ (line 58) | def __init__(self, mid_channels: int = 64, res_scale: float = 1.0): method init_weights (line 71) | def init_weights(self) -> None: method forward (line 83) | def forward(self, x: Tensor) -> Tensor: FILE: mmagic/models/archs/tokenizer.py class TokenizerWrapper (line 14) | class TokenizerWrapper: method __init__ (line 34) | def __init__(self, method __getattr__ (line 62) | def __getattr__(self, name: str) -> Any: method try_adding_tokens (line 77) | def try_adding_tokens(self, tokens: Union[str, List[str]], *args, method get_token_info (line 90) | def get_token_info(self, token: str) -> dict: method add_placeholder_token (line 105) | def add_placeholder_token(self, method replace_placeholder_tokens_in_text (line 137) | def replace_placeholder_tokens_in_text(self, method replace_text_with_placeholder_tokens (line 173) | def replace_text_with_placeholder_tokens(self, text: Union[str, List[s... method __call__ (line 197) | def __call__(self, method encode (line 220) | def encode(self, text: Union[str, List[str]], *args, **kwargs): method decode (line 230) | def decode(self, method __repr__ (line 252) | def __repr__(self): FILE: mmagic/models/archs/upsample.py class PixelShufflePack (line 9) | class PixelShufflePack(nn.Module): method __init__ (line 22) | def __init__(self, in_channels: int, out_channels: int, scale_factor: ... method init_weights (line 36) | def init_weights(self) -> None: method forward (line 40) | def forward(self, x: Tensor) -> Tensor: FILE: mmagic/models/archs/vgg.py class VGG16 (line 14) | class VGG16(BaseModule): method __init__ (line 31) | def __init__(self, method _make_layer (line 59) | def _make_layer(self, inplanes: int, planes: int, method init_weights (line 73) | def init_weights(self) -> None: method forward (line 85) | def forward(self, x: Tensor) -> Dict[str, Tensor]: FILE: mmagic/models/archs/wrapper.py class DiffusersWrapper (line 20) | class DiffusersWrapper(BaseModule): method __init__ (line 72) | def __init__(self, method init_weights (line 112) | def init_weights(self): method __getattr__ (line 126) | def __getattr__(self, name: str) -> Any: method __repr__ (line 158) | def __repr__(self): method forward (line 170) | def forward(self, *args, **kwargs) -> Any: method to (line 181) | def to( FILE: mmagic/models/base_models/average_model.py class ExponentialMovingAverage (line 19) | class ExponentialMovingAverage(BaseAveragedModel): method __init__ (line 43) | def __init__(self, method avg_func (line 60) | def avg_func(self, averaged_param: Tensor, source_param: Tensor, method _load_from_state_dict (line 74) | def _load_from_state_dict(self, state_dict: dict, prefix: str, method sync_buffers (line 131) | def sync_buffers(self, model: nn.Module) -> None: method sync_parameters (line 148) | def sync_parameters(self, model: nn.Module) -> None: class RampUpEMA (line 163) | class RampUpEMA(BaseAveragedModel): method __init__ (line 183) | def __init__(self, method rampup (line 202) | def rampup(steps, ema_kimg=10, ema_rampup=0.05, batch_size=4, eps=1e-8): method avg_func (line 228) | def avg_func(self, averaged_param: Tensor, source_param: Tensor, method _load_from_state_dict (line 246) | def _load_from_state_dict(self, state_dict: dict, prefix: str, method sync_buffers (line 303) | def sync_buffers(self, model: nn.Module) -> None: method sync_parameters (line 320) | def sync_parameters(self, model: nn.Module) -> None: FILE: mmagic/models/base_models/base_conditional_gan.py class BaseConditionalGAN (line 19) | class BaseConditionalGAN(BaseGAN): method __init__ (line 40) | def __init__(self, method label_fn (line 57) | def label_fn(self, label: LabelVar = None, num_batches: int = 1) -> Te... method data_sample_to_label (line 88) | def data_sample_to_label(self, data_sample: DataSample method _get_valid_num_classes (line 107) | def _get_valid_num_classes(num_classes: Optional[int], method forward (line 153) | def forward(self, method train_generator (line 234) | def train_generator(self, inputs: dict, data_samples: List[DataSample], method train_discriminator (line 271) | def train_discriminator(self, inputs: dict, data_samples: List[DataSam... FILE: mmagic/models/base_models/base_edit_model.py class BaseEditModel (line 12) | class BaseEditModel(BaseModel): method __init__ (line 35) | def __init__(self, method forward (line 54) | def forward(self, method convert_to_datasample (line 121) | def convert_to_datasample(self, predictions: DataSample, method forward_tensor (line 151) | def forward_tensor(self, method forward_inference (line 171) | def forward_inference(self, method forward_train (line 196) | def forward_train(self, FILE: mmagic/models/base_models/base_gan.py class BaseGAN (line 22) | class BaseGAN(BaseModel, metaclass=ABCMeta): method __init__ (line 39) | def __init__(self, method gather_log_vars (line 94) | def gather_log_vars(log_vars_list: List[Dict[str, Tensor]] method _init_loss (line 118) | def _init_loss(self, loss_config: Optional[Dict] = None) -> None: method noise_fn (line 202) | def noise_fn(self, noise: NoiseVar = None, num_batches: int = 1): method generator_steps (line 232) | def generator_steps(self) -> int: method discriminator_steps (line 238) | def discriminator_steps(self) -> int: method device (line 244) | def device(self) -> torch.device: method with_ema_gen (line 253) | def with_ema_gen(self) -> bool: method _init_ema_model (line 262) | def _init_ema_model(self, ema_config: dict): method _get_valid_model (line 277) | def _get_valid_model(self, batch_inputs: ForwardInputs) -> str: method forward (line 315) | def forward(self, method val_step (line 412) | def val_step(self, data: dict) -> SampleList: method test_step (line 430) | def test_step(self, data: dict) -> SampleList: method train_step (line 444) | def train_step(self, data: dict, method _get_gen_loss (line 520) | def _get_gen_loss(self, out_dict): method _get_disc_loss (line 543) | def _get_disc_loss(self, out_dict): method train_generator (line 572) | def train_generator(self, inputs: dict, data_samples: List[DataSample], method train_discriminator (line 605) | def train_discriminator(self, inputs: dict, data_samples: List[DataSam... FILE: mmagic/models/base_models/base_mattor.py function _pad (line 18) | def _pad(batch_image: torch.Tensor, function _interpolate (line 38) | def _interpolate(batch_image: torch.Tensor, class BaseMattor (line 56) | class BaseMattor(BaseModel, metaclass=ABCMeta): method __init__ (line 87) | def __init__(self, method resize_inputs (line 105) | def resize_inputs(self, batch_inputs: torch.Tensor) -> torch.Tensor: method restore_size (line 129) | def restore_size(self, pred_alpha: torch.Tensor, method postprocess (line 159) | def postprocess( method forward (line 212) | def forward(self, method convert_to_datasample (line 256) | def convert_to_datasample(self, predictions: List[DataSample], FILE: mmagic/models/base_models/base_translation_model.py class BaseTranslationModel (line 14) | class BaseTranslationModel(BaseModel, metaclass=ABCMeta): method __init__ (line 47) | def __init__(self, method init_weights (line 87) | def init_weights(self): method get_module (line 125) | def get_module(self, module): method forward (line 141) | def forward(self, img, test_mode=False, **kwargs): method forward_train (line 154) | def forward_train(self, img, target_domain, **kwargs): method forward_test (line 169) | def forward_test(self, img, target_domain, **kwargs): method is_domain_reachable (line 184) | def is_domain_reachable(self, domain): method get_other_domains (line 188) | def get_other_domains(self, domain): method _get_target_generator (line 192) | def _get_target_generator(self, domain): method _get_target_discriminator (line 201) | def _get_target_discriminator(self, domain): method translation (line 210) | def translation(self, image, target_domain=None, **kwargs): FILE: mmagic/models/base_models/basic_interpolator.py class BasicInterpolator (line 14) | class BasicInterpolator(BaseEditModel): method __init__ (line 39) | def __init__(self, method split_frames (line 62) | def split_frames(self, input_tensors: torch.Tensor) -> torch.Tensor: method merge_frames (line 85) | def merge_frames(input_tensors: torch.Tensor, FILE: mmagic/models/base_models/one_stage.py class OneStageInpaintor (line 19) | class OneStageInpaintor(BaseModel): method __init__ (line 51) | def __init__(self, method forward (line 107) | def forward(self, method train_step (line 156) | def train_step(self, data: List[dict], method forward_train (line 256) | def forward_train(self, *args, **kwargs) -> None: method forward_train_d (line 265) | def forward_train_d(self, data_batch: torch.Tensor, is_real: bool, method generator_loss (line 298) | def generator_loss(self, fake_res: torch.Tensor, fake_img: torch.Tensor, method forward_tensor (line 364) | def forward_tensor(self, inputs: torch.Tensor, data_samples: SampleList method forward_test (line 385) | def forward_test(self, inputs: torch.Tensor, method convert_to_datasample (line 409) | def convert_to_datasample(self, predictions: DataSample, method forward_dummy (line 437) | def forward_dummy(self, x: torch.Tensor) -> torch.Tensor: FILE: mmagic/models/base_models/two_stage.py class TwoStageInpaintor (line 15) | class TwoStageInpaintor(OneStageInpaintor): method __init__ (line 55) | def __init__( method forward_tensor (line 100) | def forward_tensor(self, inputs: torch.Tensor, data_samples: SampleList method two_stage_loss (line 123) | def two_stage_loss(self, stage1_data: dict, stage2_data: dict, method calculate_loss_with_type (line 172) | def calculate_loss_with_type(self, method train_step (line 222) | def train_step(self, data: List[dict], FILE: mmagic/models/data_preprocessors/data_preprocessor.py class DataPreprocessor (line 21) | class DataPreprocessor(ImgDataPreprocessor): method __init__ (line 74) | def __init__(self, method cast_data (line 128) | def cast_data(self, data: CastData) -> CastData: method _parse_channel_index (line 142) | def _parse_channel_index(inputs) -> int: method _parse_channel_order (line 161) | def _parse_channel_order(self, method _parse_batch_channel_order (line 213) | def _parse_batch_channel_order(self, key: str, inputs: Sequence, method _update_metainfo (line 233) | def _update_metainfo(self, method _do_conversion (line 284) | def _do_conversion(self, method _do_norm (line 329) | def _do_norm(self, method _preprocess_image_tensor (line 358) | def _preprocess_image_tensor(self, method _preprocess_image_list (line 407) | def _preprocess_image_list(self, method _preprocess_dict_inputs (line 479) | def _preprocess_dict_inputs(self, method _preprocess_data_sample (line 549) | def _preprocess_data_sample(self, data_samples: SampleList, method forward (line 606) | def forward(self, data: dict, training: bool = False) -> dict: method destruct (line 656) | def destruct(self, method _destruct_norm_and_conversion (line 701) | def _destruct_norm_and_conversion(self, batch_tensor: Tensor, method _destruct_padding (line 746) | def _destruct_padding(self, FILE: mmagic/models/data_preprocessors/mattor_preprocessor.py class MattorPreprocessor (line 21) | class MattorPreprocessor(DataPreprocessor): method __init__ (line 50) | def __init__(self, method _proc_batch_trimap (line 68) | def _proc_batch_trimap(self, batch_trimaps: torch.Tensor): method _preprocess_data_sample (line 80) | def _preprocess_data_sample(self, data_samples: SampleList, method forward (line 137) | def forward(self, FILE: mmagic/models/diffusion_schedulers/__init__.py class SchedulerWrapper (line 10) | class SchedulerWrapper: method __init__ (line 43) | def __init__(self, method __getattr__ (line 62) | def __getattr__(self, name: str) -> Any: method __repr__ (line 80) | def __repr__(self): function register_diffusers_schedulers (line 93) | def register_diffusers_schedulers() -> List[str]: FILE: mmagic/models/diffusion_schedulers/ddim_scheduler.py class EditDDIMScheduler (line 12) | class EditDDIMScheduler: method __init__ (line 30) | def __init__( method set_timesteps (line 87) | def set_timesteps(self, num_inference_steps, offset=0): method scale_model_input (line 96) | def scale_model_input(self, method _get_variance (line 112) | def _get_variance(self, timestep, prev_timestep): method step (line 124) | def step( method add_noise (line 248) | def add_noise(self, original_samples, noise, timesteps): method __len__ (line 258) | def __len__(self): FILE: mmagic/models/diffusion_schedulers/ddpm_scheduler.py class EditDDPMScheduler (line 12) | class EditDDPMScheduler: method __init__ (line 14) | def __init__(self, method set_timesteps (line 80) | def set_timesteps(self, num_inference_steps): method _get_variance (line 90) | def _get_variance(self, t, predicted_variance=None, variance_type=None): method step (line 132) | def step(self, method add_noise (line 214) | def add_noise(self, original_samples, noise, timesteps): method training_loss (line 224) | def training_loss(self, model, x_0, t): method sample_timestep (line 229) | def sample_timestep(self): method __len__ (line 232) | def __len__(self): FILE: mmagic/models/editors/animatediff/animatediff.py class AnimateDiff (line 31) | class AnimateDiff(BaseModel): method __init__ (line 76) | def __init__( method set_xformers (line 143) | def set_xformers(self, module: Optional[nn.Module] = None) -> nn.Module: method set_tomesd (line 155) | def set_tomesd(self) -> nn.Module: method device (line 165) | def device(self): method init_motion_module (line 169) | def init_motion_module(self, motion_module_cfg): method init_dreambooth_lora (line 181) | def init_dreambooth_lora(self, dream_booth_lora_cfg): method _encode_prompt (line 204) | def _encode_prompt(self, prompt, device, num_videos_per_prompt, method decode_latents (line 308) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 326) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 350) | def check_inputs(self, prompt, height, width): method convert_lora (line 373) | def convert_lora(self, method prepare_latents (line 464) | def prepare_latents(self, method prepare_model (line 515) | def prepare_model(self): method set_lora (line 535) | def set_lora(self): method val_step (line 541) | def val_step(self, data: dict) -> SampleList: method test_step (line 571) | def test_step(self, data: dict) -> SampleList: method infer (line 600) | def infer(self, method forward (line 768) | def forward(self, FILE: mmagic/models/editors/animatediff/animatediff_utils.py function shave_segments (line 18) | def shave_segments(path, n_shave_prefix_segments=1): function renew_resnet_paths (line 29) | def renew_resnet_paths(old_list, n_shave_prefix_segments=0): function renew_vae_resnet_paths (line 51) | def renew_vae_resnet_paths(old_list, n_shave_prefix_segments=0): function renew_attention_paths (line 67) | def renew_attention_paths(old_list, n_shave_prefix_segments=0): function renew_vae_attention_paths (line 79) | def renew_vae_attention_paths(old_list, n_shave_prefix_segments=0): function assign_to_checkpoint (line 109) | def assign_to_checkpoint(paths, function conv_attn_to_linear (line 168) | def conv_attn_to_linear(checkpoint): function create_unet_diffusers_config (line 180) | def create_unet_diffusers_config(original_config, function create_vae_diffusers_config (line 269) | def create_vae_diffusers_config(original_config, image_size: int): function convert_ldm_unet_checkpoint (line 293) | def convert_ldm_unet_checkpoint(checkpoint, function convert_ldm_vae_checkpoint (line 611) | def convert_ldm_vae_checkpoint(checkpoint, config): function convert_ldm_clip_checkpoint (line 815) | def convert_ldm_clip_checkpoint(checkpoint): function convert_paint_by_example_checkpoint (line 867) | def convert_paint_by_example_checkpoint(checkpoint): function convert_open_clip_checkpoint (line 934) | def convert_open_clip_checkpoint(checkpoint): function stable_unclip_image_encoder (line 994) | def stable_unclip_image_encoder(original_config): function stable_unclip_image_noising_components (line 1031) | def stable_unclip_image_noising_components( function save_videos_grid (line 1083) | def save_videos_grid(videos: torch.Tensor, FILE: mmagic/models/editors/animatediff/attention_3d.py class Transformer3DModelOutput (line 22) | class Transformer3DModelOutput(BaseOutput): class Transformer3DModel (line 38) | class Transformer3DModel(ModelMixin, ConfigMixin): method __init__ (line 102) | def __init__( method forward (line 165) | def forward(self, class BasicTransformerBlock (line 252) | class BasicTransformerBlock(nn.Module): method __init__ (line 278) | def __init__( method forward (line 371) | def forward(self, class CrossAttention (line 422) | class CrossAttention(nn.Module): method __init__ (line 442) | def __init__( method reshape_heads_to_batch_dim (line 497) | def reshape_heads_to_batch_dim(self, tensor): method reshape_batch_dim_to_heads (line 506) | def reshape_batch_dim_to_heads(self, tensor): method set_attention_slice (line 515) | def set_attention_slice(self, slice_size): method forward (line 522) | def forward(self, method _attention (line 606) | def _attention(self, query, key, value, attention_mask=None): method _sliced_attention (line 642) | def _sliced_attention(self, query, key, value, sequence_length, dim, method _memory_efficient_attention_xformers (line 693) | def _memory_efficient_attention_xformers(self, query, key, value, FILE: mmagic/models/editors/animatediff/motion_module.py function zero_module (line 19) | def zero_module(module): class TemporalTransformer3DModelOutput (line 27) | class TemporalTransformer3DModelOutput(BaseOutput): function get_motion_module (line 39) | def get_motion_module(in_channels, motion_module_type: str, class VanillaTemporalModule (line 51) | class VanillaTemporalModule(nn.Module): method __init__ (line 54) | def __init__( method forward (line 84) | def forward(self, class TemporalTransformer3DModel (line 100) | class TemporalTransformer3DModel(nn.Module): method __init__ (line 103) | def __init__( method forward (line 153) | def forward(self, class TemporalTransformerBlock (line 194) | class TemporalTransformerBlock(nn.Module): method __init__ (line 197) | def __init__( method forward (line 246) | def forward(self, class PositionalEncoding (line 268) | class PositionalEncoding(nn.Module): method __init__ (line 271) | def __init__(self, d_model, dropout=0., max_len=24): method forward (line 282) | def forward(self, x): class VersatileAttention (line 288) | class VersatileAttention(CrossAttention): method __init__ (line 291) | def __init__(self, method extra_repr (line 313) | def extra_repr(self): method reshape_heads_to_batch_dim (line 318) | def reshape_heads_to_batch_dim(self, tensor): method reshape_batch_dim_to_heads (line 328) | def reshape_batch_dim_to_heads(self, tensor): method _memory_efficient_attention_xformers (line 338) | def _memory_efficient_attention_xformers(self, query, key, value, method forward (line 350) | def forward(self, class FeedForward (line 432) | class FeedForward(nn.Module): method __init__ (line 448) | def __init__( method forward (line 475) | def forward(self, hidden_states): class GELU (line 481) | class GELU(nn.Module): method __init__ (line 486) | def __init__(self, dim_in: int, dim_out: int): method gelu (line 490) | def gelu(self, gate): method forward (line 496) | def forward(self, hidden_states): FILE: mmagic/models/editors/animatediff/resnet_3d.py class InflatedConv3d (line 11) | class InflatedConv3d(nn.Conv2d): method forward (line 14) | def forward(self, x): class InflatedGroupNorm (line 25) | class InflatedGroupNorm(nn.GroupNorm): method forward (line 27) | def forward(self, x): class Upsample3D (line 37) | class Upsample3D(nn.Module): method __init__ (line 47) | def __init__(self, method forward (line 66) | def forward(self, hidden_states, output_size=None): class Downsample3D (line 107) | class Downsample3D(nn.Module): method __init__ (line 117) | def __init__(self, method forward (line 141) | def forward(self, hidden_states): class ResnetBlock3D (line 153) | class ResnetBlock3D(nn.Module): method __init__ (line 172) | def __init__( method forward (line 265) | def forward(self, input_tensor, temb): class Mish (line 301) | class Mish(torch.nn.Module): method forward (line 304) | def forward(self, hidden_states): FILE: mmagic/models/editors/animatediff/unet_3d.py class UNet3DConditionOutput (line 32) | class UNet3DConditionOutput(BaseOutput): class UNet3DConditionMotionModel (line 38) | class UNet3DConditionMotionModel(ModelMixin, ConfigMixin): method __init__ (line 43) | def __init__( method init_weights (line 269) | def init_weights(self, subfolder=None, from_pretrained=None): method set_attention_slice (line 325) | def set_attention_slice(self, slice_size): method _set_gradient_checkpointing (line 403) | def _set_gradient_checkpointing(self, module, value=False): method forward (line 409) | def forward( method from_pretrained_2d (line 578) | def from_pretrained_2d(cls, FILE: mmagic/models/editors/animatediff/unet_block.py function get_down_block (line 13) | def get_down_block( function get_up_block (line 90) | def get_up_block( class UNetMidBlock3DCrossAttn (line 167) | class UNetMidBlock3DCrossAttn(nn.Module): method __init__ (line 170) | def __init__( method forward (line 262) | def forward(self, class CrossAttnDownBlock3D (line 286) | class CrossAttnDownBlock3D(nn.Module): method __init__ (line 289) | def __init__( method forward (line 383) | def forward(self, class DownBlock3D (line 443) | class DownBlock3D(nn.Module): method __init__ (line 446) | def __init__( method forward (line 510) | def forward(self, hidden_states, temb=None, encoder_hidden_states=None): class CrossAttnUpBlock3D (line 553) | class CrossAttnUpBlock3D(nn.Module): method __init__ (line 556) | def __init__( method forward (line 650) | def forward( class UpBlock3D (line 714) | class UpBlock3D(nn.Module): method __init__ (line 717) | def __init__( method forward (line 781) | def forward( FILE: mmagic/models/editors/aotgan/aot_decoder.py class AOTDecoder (line 11) | class AOTDecoder(BaseModule): method __init__ (line 28) | def __init__(self, method forward (line 60) | def forward(self, x): FILE: mmagic/models/editors/aotgan/aot_encoder.py class AOTEncoder (line 10) | class AOTEncoder(BaseModule): method __init__ (line 27) | def __init__(self, method forward (line 56) | def forward(self, x): FILE: mmagic/models/editors/aotgan/aot_encoder_decoder.py class AOTEncoderDecoder (line 8) | class AOTEncoderDecoder(GLEncoderDecoder): method __init__ (line 22) | def __init__(self, FILE: mmagic/models/editors/aotgan/aot_inpaintor.py class AOTInpaintor (line 12) | class AOTInpaintor(OneStageInpaintor): method forward_train_d (line 19) | def forward_train_d(self, data_batch, is_real, is_disc, mask): method generator_loss (line 53) | def generator_loss(self, fake_res, fake_img, gt, mask, masked_img): method forward_tensor (line 101) | def forward_tensor(self, inputs, data_samples): method train_step (line 123) | def train_step(self, data: List[dict], optim_wrapper): FILE: mmagic/models/editors/aotgan/aot_neck.py class AOTBlockNeck (line 11) | class AOTBlockNeck(BaseModule): method __init__ (line 28) | def __init__(self, method forward (line 44) | def forward(self, x): class AOTBlock (line 49) | class AOTBlock(BaseModule): method __init__ (line 72) | def __init__(self, method normalize (line 98) | def normalize(self, x): method forward (line 105) | def forward(self, x): FILE: mmagic/models/editors/arcface/arcface_modules.py class Flatten (line 15) | class Flatten(Module): method forward (line 18) | def forward(self, input): function l2_norm (line 22) | def l2_norm(input, axis=1): class Bottleneck (line 38) | class Bottleneck(namedtuple('Block', ['in_channel', 'depth', 'stride'])): function get_block (line 42) | def get_block(in_channel, depth, num_units, stride=2): function get_blocks (line 58) | def get_blocks(num_layers): class SEModule (line 98) | class SEModule(Module): method __init__ (line 106) | def __init__(self, channels, reduction): method forward (line 124) | def forward(self, x): class bottleneck_IR (line 135) | class bottleneck_IR(Module): method __init__ (line 144) | def __init__(self, in_channel, depth, stride): method forward (line 165) | def forward(self, x): class bottleneck_IR_SE (line 172) | class bottleneck_IR_SE(Module): method __init__ (line 181) | def __init__(self, in_channel, depth, stride): method forward (line 195) | def forward(self, x): FILE: mmagic/models/editors/arcface/id_loss.py class IDLossModel (line 11) | class IDLossModel(nn.Module): method __init__ (line 21) | def __init__(self, ir_se50_weights=None): method extract_feats (line 35) | def extract_feats(self, x): method forward (line 51) | def forward(self, pred=None, gt=None): FILE: mmagic/models/editors/arcface/model_irse.py class Backbone (line 15) | class Backbone(Module): method __init__ (line 31) | def __init__(self, method forward (line 67) | def forward(self, x): function IR_50 (line 75) | def IR_50(input_size): function IR_101 (line 82) | def IR_101(input_size): function IR_152 (line 89) | def IR_152(input_size): function IR_SE_50 (line 96) | def IR_SE_50(input_size): function IR_SE_101 (line 103) | def IR_SE_101(input_size): function IR_SE_152 (line 110) | def IR_SE_152(input_size): FILE: mmagic/models/editors/basicvsr/basicvsr.py class BasicVSR (line 10) | class BasicVSR(BaseEditModel): method __init__ (line 31) | def __init__(self, method check_if_mirror_extended (line 67) | def check_if_mirror_extended(self, lrs): method forward_train (line 85) | def forward_train(self, inputs, data_samples=None, **kwargs): method forward_inference (line 117) | def forward_inference(self, inputs, data_samples=None, **kwargs): FILE: mmagic/models/editors/basicvsr/basicvsr_net.py class BasicVSRNet (line 18) | class BasicVSRNet(BaseModule): method __init__ (line 36) | def __init__(self, mid_channels=64, num_blocks=30, spynet_pretrained=N... method check_if_mirror_extended (line 68) | def check_if_mirror_extended(self, lrs): method compute_flow (line 84) | def compute_flow(self, lrs): method forward (line 113) | def forward(self, lrs): class ResidualBlocksWithInputConv (line 179) | class ResidualBlocksWithInputConv(BaseModule): method __init__ (line 189) | def __init__(self, in_channels, out_channels=64, num_blocks=30): method forward (line 205) | def forward(self, feat): class SPyNet (line 217) | class SPyNet(BaseModule): method __init__ (line 231) | def __init__(self, pretrained): method compute_flow (line 251) | def compute_flow(self, ref, supp): method forward (line 311) | def forward(self, ref, supp): class SPyNetBasicModule (line 350) | class SPyNetBasicModule(BaseModule): method __init__ (line 357) | def __init__(self): method forward (line 402) | def forward(self, tensor_input): FILE: mmagic/models/editors/basicvsr_plusplus_net/basicvsr_plusplus_net.py class BasicVSRPlusPlusNet (line 16) | class BasicVSRPlusPlusNet(BaseModule): method __init__ (line 44) | def __init__(self, method check_if_mirror_extended (line 101) | def check_if_mirror_extended(self, lqs): method compute_flow (line 119) | def compute_flow(self, lqs): method propagate (line 153) | def propagate(self, feats, flows, module_name): method upsample (line 242) | def upsample(self, lqs, feats): method forward (line 285) | def forward(self, lqs): class SecondOrderDeformableAlignment (line 356) | class SecondOrderDeformableAlignment(ModulatedDeformConv2d): method __init__ (line 374) | def __init__(self, *args, **kwargs): method init_offset (line 391) | def init_offset(self): method forward (line 395) | def forward(self, x, extra_feat, flow_1, flow_2): FILE: mmagic/models/editors/biggan/biggan.py class BigGAN (line 20) | class BigGAN(BaseConditionalGAN): method __init__ (line 47) | def __init__(self, method disc_loss (line 60) | def disc_loss(self, disc_pred_fake: Tensor, method gen_loss (line 87) | def gen_loss(self, disc_pred_fake): method train_discriminator (line 107) | def train_discriminator(self, inputs: dict, data_samples: DataSample, method train_generator (line 141) | def train_generator(self, inputs: dict, data_samples: DataSample, FILE: mmagic/models/editors/biggan/biggan_deep_discriminator.py class BigGANDeepDiscriminator (line 19) | class BigGANDeepDiscriminator(nn.Module): method __init__ (line 87) | def __init__(self, method _get_default_arch_cfg (line 179) | def _get_default_arch_cfg(self, input_scale, base_channels): method forward (line 228) | def forward(self, x, label=None): method init_weights (line 251) | def init_weights(self, pretrained=None, init_type='ortho'): FILE: mmagic/models/editors/biggan/biggan_deep_generator.py class BigGANDeepGenerator (line 20) | class BigGANDeepGenerator(nn.Module): method __init__ (line 108) | def __init__(self, method _get_default_arch_cfg (line 248) | def _get_default_arch_cfg(self, output_scale, base_channels): method forward (line 298) | def forward(self, method init_weights (line 423) | def init_weights(self, pretrained=None, init_type='ortho'): FILE: mmagic/models/editors/biggan/biggan_discriminator.py class BigGANDiscriminator (line 16) | class BigGANDiscriminator(BaseModule): method __init__ (line 76) | def __init__(self, method _get_default_arch_cfg (line 150) | def _get_default_arch_cfg(self, input_scale, in_channels, base_channels): method forward (line 202) | def forward(self, x, label=None): method init_weights (line 225) | def init_weights(self): FILE: mmagic/models/editors/biggan/biggan_generator.py class BigGANGenerator (line 17) | class BigGANGenerator(BaseModule): method __init__ (line 96) | def __init__(self, method _get_default_arch_cfg (line 226) | def _get_default_arch_cfg(self, output_scale, base_channels): method forward (line 276) | def forward(self, method init_weights (line 403) | def init_weights(self): FILE: mmagic/models/editors/biggan/biggan_modules.py class SNConvModule (line 17) | class SNConvModule(ConvModule): method __init__ (line 31) | def __init__(self, class BigGANGenResBlock (line 64) | class BigGANGenResBlock(nn.Module): method __init__ (line 92) | def __init__(self, method forward (line 161) | def forward(self, x, y): class BigGANConditionBN (line 187) | class BigGANConditionBN(nn.Module): method __init__ (line 214) | def __init__(self, method forward (line 268) | def forward(self, x, y): class SelfAttentionBlock (line 291) | class SelfAttentionBlock(nn.Module): method __init__ (line 308) | def __init__(self, method forward (line 355) | def forward(self, x): class BigGANDiscResBlock (line 382) | class BigGANDiscResBlock(nn.Module): method __init__ (line 406) | def __init__(self, method forward_sc (line 453) | def forward_sc(self, x): method forward (line 474) | def forward(self, x): class BigGANDeepGenResBlock (line 497) | class BigGANDeepGenResBlock(nn.Module): method __init__ (line 529) | def __init__(self, method forward (line 634) | def forward(self, x, y): class BigGANDeepDiscResBlock (line 671) | class BigGANDeepDiscResBlock(nn.Module): method __init__ (line 695) | def __init__(self, method forward_sc (line 769) | def forward_sc(self, x): method forward (line 785) | def forward(self, x): FILE: mmagic/models/editors/biggan/biggan_snmodule.py function proj (line 13) | def proj(x, y): function gram_schmidt (line 26) | def gram_schmidt(x, ys): function power_iteration (line 43) | def power_iteration(weight, u_list, update=True, eps=1e-12): class SpectralNorm (line 76) | class SpectralNorm(object): method __init__ (line 90) | def __init__(self, method u (line 106) | def u(self): method sv (line 111) | def sv(self): method sn_weight (line 115) | def sn_weight(self): class SNConv2d (line 132) | class SNConv2d(nn.Conv2d, SpectralNorm): method __init__ (line 154) | def __init__(self, method forward (line 170) | def forward(self, x): class SNLinear (line 176) | class SNLinear(nn.Linear, SpectralNorm): method __init__ (line 190) | def __init__(self, method forward (line 200) | def forward(self, x): class SNEmbedding (line 207) | class SNEmbedding(nn.Embedding, SpectralNorm): method __init__ (line 238) | def __init__(self, method forward (line 256) | def forward(self, x): FILE: mmagic/models/editors/cain/cain.py class CAIN (line 7) | class CAIN(BasicInterpolator): method forward_inference (line 32) | def forward_inference(self, inputs, data_samples=None): FILE: mmagic/models/editors/cain/cain_net.py class CAINNet (line 13) | class CAINNet(BaseModule): method __init__ (line 33) | def __init__(self, method forward (line 65) | def forward(self, imgs, padding_flag=False): function get_padding_functions (line 107) | def get_padding_functions(x, padding=7): class ConvNormWithReflectionPad (line 150) | class ConvNormWithReflectionPad(BaseModule): method __init__ (line 162) | def __init__(self, in_channels, out_channels, kernel_size, norm=None): method forward (line 179) | def forward(self, x): class ChannelAttentionLayer (line 196) | class ChannelAttentionLayer(BaseModule): method __init__ (line 204) | def __init__(self, mid_channels, reduction=16): method forward (line 224) | def forward(self, x): class ResidualChannelAttention (line 239) | class ResidualChannelAttention(BaseModule): method __init__ (line 251) | def __init__(self, method forward (line 266) | def forward(self, x): class ResidualGroup (line 280) | class ResidualGroup(BaseModule): method __init__ (line 295) | def __init__(self, method forward (line 316) | def forward(self, x): FILE: mmagic/models/editors/controlnet/controlnet.py class ControlStableDiffusion (line 28) | class ControlStableDiffusion(StableDiffusion): method __init__ (line 60) | def __init__(self, method init_weights (line 99) | def init_weights(self): method train_step (line 187) | def train_step(self, data: dict, method val_step (line 264) | def val_step(self, data: dict) -> SampleList: method test_step (line 295) | def test_step(self, data: dict) -> SampleList: method prepare_control (line 328) | def prepare_control(image: Tuple[Image.Image, List[Image.Image], Tensor, method train (line 381) | def train(self, mode: bool = True): method infer (line 403) | def infer(self, method forward (line 593) | def forward(self, *args, **kwargs): class ControlStableDiffusionImg2Img (line 600) | class ControlStableDiffusionImg2Img(ControlStableDiffusion): method _default_height_width (line 602) | def _default_height_width(self, height, width, image): method get_timesteps (line 624) | def get_timesteps(self, num_inference_steps, strength, device): method prepare_latents (line 634) | def prepare_latents(self, method prepare_latent_image (line 690) | def prepare_latent_image(self, image, dtype): method infer (line 714) | def infer( FILE: mmagic/models/editors/controlnet/controlnet_utils.py function change_base_model (line 10) | def change_base_model(controlnet: nn.Module, FILE: mmagic/models/editors/cyclegan/cyclegan.py class CycleGAN (line 16) | class CycleGAN(BaseTranslationModel): method __init__ (line 24) | def __init__(self, method forward_test (line 38) | def forward_test(self, img, target_domain, **kwargs): method _get_disc_loss (line 56) | def _get_disc_loss(self, outputs): method _get_gen_loss (line 89) | def _get_gen_loss(self, outputs): method _get_opposite_domain (line 136) | def _get_opposite_domain(self, domain): method train_step (line 150) | def train_step(self, data: dict, optim_wrapper: OptimWrapperDict): method test_step (line 215) | def test_step(self, data: dict) -> SampleList: method val_step (line 255) | def val_step(self, data: dict) -> SampleList: FILE: mmagic/models/editors/cyclegan/cyclegan_generator.py class ResnetGenerator (line 12) | class ResnetGenerator(BaseModule): method __init__ (line 33) | def __init__(self, method forward (line 123) | def forward(self, x): method init_weights (line 134) | def init_weights(self): FILE: mmagic/models/editors/cyclegan/cyclegan_modules.py class ResidualBlockWithDropout (line 8) | class ResidualBlockWithDropout(nn.Module): method __init__ (line 26) | def __init__(self, method forward (line 67) | def forward(self, x): class GANImageBuffer (line 80) | class GANImageBuffer: method __init__ (line 95) | def __init__(self, buffer_size, buffer_ratio=0.5): method query (line 103) | def query(self, images): FILE: mmagic/models/editors/dcgan/dcgan.py class DCGAN (line 15) | class DCGAN(BaseGAN): method disc_loss (line 28) | def disc_loss(self, disc_pred_fake: Tensor, method gen_loss (line 51) | def gen_loss(self, disc_pred_fake: Tensor) -> Tuple: method train_discriminator (line 67) | def train_discriminator(self, inputs: dict, data_samples: DataSample, method train_generator (line 95) | def train_generator(self, inputs: dict, data_samples: DataSample, FILE: mmagic/models/editors/dcgan/dcgan_discriminator.py class DCGANDiscriminator (line 12) | class DCGANDiscriminator(BaseModule): method __init__ (line 43) | def __init__(self, method forward (line 95) | def forward(self, x): method init_weights (line 112) | def init_weights(self): FILE: mmagic/models/editors/dcgan/dcgan_generator.py class DCGANGenerator (line 14) | class DCGANGenerator(BaseModule): method __init__ (line 55) | def __init__(self, method forward (line 117) | def forward(self, noise, num_batches=0, return_noise=False): method init_weights (line 167) | def init_weights(self): FILE: mmagic/models/editors/ddpm/attention.py class Transformer2DModel (line 10) | class Transformer2DModel(nn.Module): method __init__ (line 65) | def __init__( method _set_attention_slice (line 147) | def _set_attention_slice(self, slice_size): method forward (line 153) | def forward(self, class BasicTransformerBlock (line 232) | class BasicTransformerBlock(nn.Module): method __init__ (line 252) | def __init__( method _set_attention_slice (line 290) | def _set_attention_slice(self, slice_size): method forward (line 295) | def forward(self, hidden_states, context=None, timestep=None): class CrossAttention (line 317) | class CrossAttention(nn.Module): method __init__ (line 337) | def __init__( method reshape_heads_to_batch_dim (line 365) | def reshape_heads_to_batch_dim(self, tensor): method reshape_batch_dim_to_heads (line 375) | def reshape_batch_dim_to_heads(self, tensor): method forward (line 385) | def forward(self, hidden_states, context=None, mask=None): method _attention (line 416) | def _attention(self, query, key, value): method _sliced_attention (line 439) | def _sliced_attention(self, query, key, value, sequence_length, dim): class FeedForward (line 473) | class FeedForward(nn.Module): method __init__ (line 490) | def __init__( method forward (line 515) | def forward(self, hidden_states): class GEGLU (line 523) | class GEGLU(nn.Module): method __init__ (line 533) | def __init__(self, dim_in: int, dim_out: int): method gelu (line 537) | def gelu(self, gate): method forward (line 541) | def forward(self, hidden_states): class ApproximateGELU (line 547) | class ApproximateGELU(nn.Module): method __init__ (line 553) | def __init__(self, dim_in: int, dim_out: int): method forward (line 557) | def forward(self, x): FILE: mmagic/models/editors/ddpm/denoising_unet.py class EmbedSequential (line 27) | class EmbedSequential(nn.Sequential): method forward (line 35) | def forward(self, x, y, encoder_out=None): class GroupNorm32 (line 49) | class GroupNorm32(nn.GroupNorm): method __init__ (line 51) | def __init__(self, num_channels, num_groups=32, **kwargs): method forward (line 54) | def forward(self, x): function convert_module_to_f16 (line 58) | def convert_module_to_f16(layer): function convert_module_to_f32 (line 66) | def convert_module_to_f32(layer): class SiLU (line 76) | class SiLU(BaseModule): method __init__ (line 84) | def __init__(self, inplace=False): method forward (line 92) | def forward(self, x): class MultiHeadAttention (line 108) | class MultiHeadAttention(BaseModule): method __init__ (line 121) | def __init__(self, method QKVAttention (line 133) | def QKVAttention(qkv): method forward (line 142) | def forward(self, x): method init_weights (line 159) | def init_weights(self): class MultiHeadAttentionBlock (line 164) | class MultiHeadAttentionBlock(BaseModule): method __init__ (line 172) | def __init__(self, method forward (line 202) | def forward(self, x, encoder_out=None): class QKVAttentionLegacy (line 216) | class QKVAttentionLegacy(BaseModule): method __init__ (line 222) | def __init__(self, n_heads): method forward (line 226) | def forward(self, qkv, encoder_kv=None): class QKVAttention (line 253) | class QKVAttention(BaseModule): method __init__ (line 257) | def __init__(self, n_heads): method forward (line 261) | def forward(self, qkv): class TimeEmbedding (line 284) | class TimeEmbedding(BaseModule): method __init__ (line 299) | def __init__(self, method sinusodial_embedding (line 322) | def sinusodial_embedding(timesteps, dim, max_period=10000): method forward (line 348) | def forward(self, t): class DenoisingResBlock (line 361) | class DenoisingResBlock(BaseModule): method __init__ (line 382) | def __init__(self, method forward_shortcut (line 450) | def forward_shortcut(self, x): method forward (line 455) | def forward(self, x, y): method init_weights (line 479) | def init_weights(self): class NormWithEmbedding (line 485) | class NormWithEmbedding(BaseModule): method __init__ (line 505) | def __init__(self, method forward (line 520) | def forward(self, x, y): class DenoisingDownsample (line 542) | class DenoisingDownsample(BaseModule): method __init__ (line 553) | def __init__(self, in_channels, with_conv=True): method forward (line 560) | def forward(self, x): class DenoisingUpsample (line 572) | class DenoisingUpsample(BaseModule): method __init__ (line 584) | def __init__(self, in_channels, with_conv=True): method forward (line 590) | def forward(self, x): function build_down_block_resattn (line 604) | def build_down_block_resattn(resblocks_per_downsample, resblock_cfg, function build_mid_blocks_resattn (line 651) | def build_mid_blocks_resattn(resblock_cfg, attention_cfg, in_channels_): function build_up_blocks_resattn (line 662) | def build_up_blocks_resattn( class DenoisingUnet (line 719) | class DenoisingUnet(BaseModule): method __init__ (line 840) | def __init__(self, method forward (line 1145) | def forward(self, method init_weights (line 1288) | def init_weights(self, pretrained=None): method convert_to_fp16 (line 1317) | def convert_to_fp16(self): method convert_to_fp32 (line 1323) | def convert_to_fp32(self): FILE: mmagic/models/editors/ddpm/embeddings.py class TimestepEmbedding (line 11) | class TimestepEmbedding(nn.Module): method __init__ (line 14) | def __init__(self, method forward (line 38) | def forward(self, sample): class Timesteps (line 50) | class Timesteps(nn.Module): method __init__ (line 53) | def __init__(self, method forward (line 64) | def forward(self, timesteps): FILE: mmagic/models/editors/ddpm/res_blocks.py class ResnetBlock2D (line 10) | class ResnetBlock2D(nn.Module): method __init__ (line 31) | def __init__( method forward (line 107) | def forward(self, input_tensor, temb): class Upsample2D (line 148) | class Upsample2D(nn.Module): method __init__ (line 158) | def __init__(self, method forward (line 179) | def forward(self, hidden_states, output_size=None): class Downsample2D (line 200) | class Downsample2D(nn.Module): method __init__ (line 210) | def __init__(self, method forward (line 237) | def forward(self, hidden_states): FILE: mmagic/models/editors/ddpm/unet_blocks.py function get_down_block (line 9) | def get_down_block( function get_up_block (line 62) | def get_up_block( class UNetMidBlock2DCrossAttn (line 115) | class UNetMidBlock2DCrossAttn(nn.Module): method __init__ (line 118) | def __init__( method set_attention_slice (line 189) | def set_attention_slice(self, slice_size): method forward (line 203) | def forward(self, hidden_states, temb=None, encoder_hidden_states=None): class CrossAttnDownBlock2D (line 214) | class CrossAttnDownBlock2D(nn.Module): method __init__ (line 217) | def __init__( method set_attention_slice (line 290) | def set_attention_slice(self, slice_size): method forward (line 304) | def forward(self, hidden_states, temb=None, encoder_hidden_states=None): class DownBlock2D (line 326) | class DownBlock2D(nn.Module): method __init__ (line 329) | def __init__( method forward (line 380) | def forward(self, hidden_states, temb=None): class CrossAttnUpBlock2D (line 399) | class CrossAttnUpBlock2D(nn.Module): method __init__ (line 402) | def __init__( method set_attention_slice (line 475) | def set_attention_slice(self, slice_size): method forward (line 491) | def forward( class UpBlock2D (line 520) | class UpBlock2D(nn.Module): method __init__ (line 523) | def __init__( method forward (line 574) | def forward(self, FILE: mmagic/models/editors/deblurganv2/deblurganv2.py class DeblurGanV2 (line 18) | class DeblurGanV2(BaseModel): method __init__ (line 20) | def __init__(self, method forward (line 70) | def forward(self, method convert_to_datasample (line 154) | def convert_to_datasample(self, predictions: DataSample, method forward_tensor (line 183) | def forward_tensor(self, method forward_inference (line 204) | def forward_inference(self, method forward_train (line 227) | def forward_train(self, inputs, data_samples=None, **kwargs): method val_step (line 243) | def val_step(self, data: Union[tuple, dict, list]) -> list: method test_step (line 260) | def test_step(self, data: Union[dict, tuple, list]) -> list: method _run_forward (line 272) | def _run_forward(self, data: Union[dict, tuple, list], method train_step (line 292) | def train_step(self, data: List[dict], method g_step (line 341) | def g_step(self, batch_outputs: torch.Tensor, batch_gt_data: torch.Ten... method d_step (line 382) | def d_step(self, batch_outputs: torch.Tensor, batch_gt_data: torch.Ten... method g_step_with_optim (line 402) | def g_step_with_optim(self, batch_outputs: torch.Tensor, method d_step_with_optim (line 429) | def d_step_with_optim(self, batch_outputs: torch.Tensor, method extract_gt_data (line 461) | def extract_gt_data(self, data_samples): FILE: mmagic/models/editors/deblurganv2/deblurganv2_discriminator.py class NLayerDiscriminator (line 13) | class NLayerDiscriminator(nn.Module): method __init__ (line 16) | def __init__(self, method forward (line 77) | def forward(self, input): class DicsriminatorTail (line 89) | class DicsriminatorTail(nn.Module): method __init__ (line 91) | def __init__(self, method forward (line 128) | def forward(self, input): class MultiScaleDiscriminator (line 140) | class MultiScaleDiscriminator(nn.Module): method __init__ (line 144) | def __init__(self, method forward (line 206) | def forward(self, input): function get_fullD (line 224) | def get_fullD(norm_layer): class DoubleGan (line 237) | class DoubleGan(nn.Module): method __init__ (line 240) | def __init__(self, norm_layer='instance', d_layers=3): method forward (line 248) | def forward(self, x): class PatchGan (line 264) | class PatchGan(nn.Module): method __init__ (line 267) | def __init__(self, norm_layer='instance', d_layers=3): method forward (line 274) | def forward(self, x): class MultiScale (line 287) | class MultiScale(nn.Module): method __init__ (line 290) | def __init__(self, norm_layer='instance', d_layers=3): method forward (line 295) | def forward(self, x): class DeblurGanV2Discriminator (line 309) | class DeblurGanV2Discriminator: method __new__ (line 316) | def __new__(cls, backbone, *args, **kwargs): FILE: mmagic/models/editors/deblurganv2/deblurganv2_generator.py class FPNHead (line 12) | class FPNHead(nn.Module): method __init__ (line 15) | def __init__(self, num_in, num_mid, num_out): method forward (line 23) | def forward(self, x): class FPN_inception (line 37) | class FPN_inception(nn.Module): method __init__ (line 39) | def __init__(self, norm_layer, num_filter=256, pretrained='imagenet'): method unfreeze (line 91) | def unfreeze(self): method forward (line 96) | def forward(self, x): class FPNInception (line 140) | class FPNInception(nn.Module): method __init__ (line 144) | def __init__(self, method unfreeze (line 177) | def unfreeze(self): method forward (line 181) | def forward(self, x): class FPN_inceptionsimple (line 214) | class FPN_inceptionsimple(nn.Module): method __init__ (line 216) | def __init__(self, norm_layer, num_filters=256): method unfreeze (line 260) | def unfreeze(self): method forward (line 265) | def forward(self, x): class FPNInceptionSimple (line 306) | class FPNInceptionSimple(nn.Module): method __init__ (line 310) | def __init__(self, method unfreeze (line 343) | def unfreeze(self): method forward (line 347) | def forward(self, x): class FPN_mobilenet (line 380) | class FPN_mobilenet(nn.Module): method __init__ (line 382) | def __init__(self, norm_layer, num_filters=128, pretrained=None): method unfreeze (line 429) | def unfreeze(self): method forward (line 434) | def forward(self, x): class FPNMobileNet (line 476) | class FPNMobileNet(nn.Module): method __init__ (line 478) | def __init__(self, method unfreeze (line 516) | def unfreeze(self): method forward (line 520) | def forward(self, x): class DeblurGanV2Generator (line 554) | class DeblurGanV2Generator: method __new__ (line 561) | def __new__(cls, backbone, *args, **kwargs): FILE: mmagic/models/editors/deblurganv2/deblurganv2_util.py class BasicConv2d (line 39) | class BasicConv2d(nn.Module): method __init__ (line 41) | def __init__(self, in_planes, out_planes, kernel_size, stride, padding... method forward (line 57) | def forward(self, x): class Mixed_5b (line 72) | class Mixed_5b(nn.Module): method __init__ (line 74) | def __init__(self): method forward (line 92) | def forward(self, x): class Block35 (line 109) | class Block35(nn.Module): method __init__ (line 111) | def __init__(self, scale=1.0): method forward (line 130) | def forward(self, x): class Mixed_6a (line 149) | class Mixed_6a(nn.Module): method __init__ (line 151) | def __init__(self): method forward (line 163) | def forward(self, x): class Block17 (line 179) | class Block17(nn.Module): method __init__ (line 181) | def __init__(self, scale=1.0): method forward (line 198) | def forward(self, x): class Mixed_7a (line 216) | class Mixed_7a(nn.Module): method __init__ (line 218) | def __init__(self): method forward (line 236) | def forward(self, x): class Block8 (line 253) | class Block8(nn.Module): method __init__ (line 255) | def __init__(self, scale=1.0, noReLU=False): method forward (line 274) | def forward(self, x): class InceptionResNetV2 (line 293) | class InceptionResNetV2(nn.Module): method __init__ (line 296) | def __init__(self, num_classes=1001): method features (line 337) | def features(self, input): method logits (line 360) | def logits(self, features): method forward (line 372) | def forward(self, input): function inceptionresnetv2 (line 386) | def inceptionresnetv2(num_classes=1000, pretrained='imagenet'): function conv_bn (line 410) | def conv_bn(inp, oup, stride): function conv_1x1_bn (line 416) | def conv_1x1_bn(inp, oup): class InvertedResidual (line 422) | class InvertedResidual(nn.Module): method __init__ (line 424) | def __init__(self, inp, oup, stride, expand_ratio): method forward (line 471) | def forward(self, x): class MobileNetV2 (line 486) | class MobileNetV2(nn.Module): method __init__ (line 488) | def __init__(self, n_class=1000, input_size=224, width_mult=1.): method forward (line 536) | def forward(self, x): method _initialize_weights (line 550) | def _initialize_weights(self): function get_norm_layer (line 566) | def get_norm_layer(norm_type='instance'): FILE: mmagic/models/editors/deepfillv1/contextual_attention.py class ContextualAttentionModule (line 10) | class ContextualAttentionModule(BaseModule): method __init__ (line 41) | def __init__(self, method forward (line 76) | def forward(self, x, context, mask=None): method patch_correlation (line 147) | def patch_correlation(self, x, kernel): method patch_copy_deconv (line 169) | def patch_copy_deconv(self, attention_score, context_filter): method fuse_correlation_map (line 190) | def fuse_correlation_map(self, correlation_map, h_unfold, w_unfold): method calculate_unfold_hw (line 239) | def calculate_unfold_hw(self, method calculate_overlap_factor (line 261) | def calculate_overlap_factor(self, attention_score): method mask_correlation_map (line 287) | def mask_correlation_map(self, correlation_map, mask): method im2col (line 321) | def im2col(self, FILE: mmagic/models/editors/deepfillv1/contextual_attention_neck.py class ContextualAttentionNeck (line 12) | class ContextualAttentionNeck(BaseModule): method __init__ (line 30) | def __init__(self, method forward (line 61) | def forward(self, x, mask): FILE: mmagic/models/editors/deepfillv1/deepfill_decoder.py class DeepFillDecoder (line 16) | class DeepFillDecoder(BaseModule): method __init__ (line 37) | def __init__(self, method forward (line 80) | def forward(self, input_dict): FILE: mmagic/models/editors/deepfillv1/deepfill_disc.py class DeepFillv1Discriminators (line 10) | class DeepFillv1Discriminators(BaseModule): method __init__ (line 26) | def __init__(self, global_disc_cfg, local_disc_cfg): method forward (line 31) | def forward(self, x): method init_weights (line 49) | def init_weights(self): FILE: mmagic/models/editors/deepfillv1/deepfill_encoder.py class DeepFillEncoder (line 10) | class DeepFillEncoder(BaseModule): method __init__ (line 31) | def __init__(self, method forward (line 65) | def forward(self, x): FILE: mmagic/models/editors/deepfillv1/deepfill_refiner.py class DeepFillRefiner (line 10) | class DeepFillRefiner(BaseModule): method __init__ (line 29) | def __init__(self, method forward (line 48) | def forward(self, x, mask): FILE: mmagic/models/editors/deepfillv1/deepfillv1.py class DeepFillv1Inpaintor (line 13) | class DeepFillv1Inpaintor(TwoStageInpaintor): method __init__ (line 68) | def __init__(self, method forward_train_d (line 106) | def forward_train_d(self, data_batch, is_real, is_disc): method two_stage_loss (line 146) | def two_stage_loss(self, stage1_data, stage2_data, gt, mask, masked_img): method calculate_loss_with_type (line 199) | def calculate_loss_with_type(self, method train_step (line 254) | def train_step(self, data: List[dict], optim_wrapper): FILE: mmagic/models/editors/deepfillv2/two_stage_encoder_decoder.py class DeepFillEncoderDecoder (line 12) | class DeepFillEncoderDecoder(BaseModule): method __init__ (line 27) | def __init__(self, method forward (line 47) | def forward(self, x): method init_weights (line 75) | def init_weights(self): FILE: mmagic/models/editors/dic/dic.py class DIC (line 13) | class DIC(SRGAN): method __init__ (line 34) | def __init__(self, method forward_tensor (line 62) | def forward_tensor(self, inputs, data_samples=None, training=False): method if_run_g (line 84) | def if_run_g(self): method if_run_d (line 89) | def if_run_d(self): method g_step (line 94) | def g_step(self, batch_outputs, batch_gt_data): method train_step (line 132) | def train_step(self, data: List[dict], method extract_gt_data (line 190) | def extract_gt_data(data_samples): FILE: mmagic/models/editors/dic/dic_net.py class DICNet (line 12) | class DICNet(BaseModule): method __init__ (line 38) | def __init__(self, method forward (line 84) | def forward(self, x): class FeedbackBlock (line 125) | class FeedbackBlock(nn.Module): method __init__ (line 144) | def __init__(self, method forward (line 196) | def forward(self, x): class FeedbackBlockCustom (line 240) | class FeedbackBlockCustom(FeedbackBlock): method __init__ (line 250) | def __init__(self, in_channels, mid_channels, num_blocks, upscale_fact... method forward (line 258) | def forward(self, x): class GroupResBlock (line 294) | class GroupResBlock(nn.Module): method __init__ (line 306) | def __init__(self, method forward (line 320) | def forward(self, x): class FeatureHeatmapFusingBlock (line 334) | class FeatureHeatmapFusingBlock(nn.Module): method __init__ (line 345) | def __init__(self, method forward (line 369) | def forward(self, feature, heatmap): class FeedbackBlockHeatmapAttention (line 396) | class FeedbackBlockHeatmapAttention(FeedbackBlock): method __init__ (line 408) | def __init__(self, method forward (line 427) | def forward(self, x, heatmap): FILE: mmagic/models/editors/dic/feedback_hour_glass.py class FeedbackHourglass (line 10) | class FeedbackHourglass(BaseModule): method __init__ (line 26) | def __init__(self, mid_channels, num_keypoints): method forward (line 49) | def forward(self, x, last_hidden=None): class ResBlock (line 75) | class ResBlock(nn.Module): method __init__ (line 95) | def __init__(self, in_channels, out_channels): method forward (line 108) | def forward(self, x): class Hourglass (line 124) | class Hourglass(nn.Module): method __init__ (line 134) | def __init__(self, depth, mid_channels): method forward (line 145) | def forward(self, x): function reduce_to_five_heatmaps (line 164) | def reduce_to_five_heatmaps(ori_heatmap, detach): FILE: mmagic/models/editors/dic/light_cnn.py class LightCNN (line 12) | class LightCNN(BaseModule): method __init__ (line 21) | def __init__(self, in_channels): method forward (line 43) | def forward(self, x): method init_weights (line 58) | def init_weights(self, pretrained=None, strict=True): class MaxFeature (line 75) | class MaxFeature(nn.Module): method __init__ (line 92) | def __init__(self, method forward (line 115) | def forward(self, x): FILE: mmagic/models/editors/dim/dim.py class DIM (line 13) | class DIM(BaseMattor): method __init__ (line 44) | def __init__(self, method init_weights (line 93) | def init_weights(self): method with_refiner (line 100) | def with_refiner(self): method train (line 104) | def train(self, mode=True): method freeze_backbone (line 115) | def freeze_backbone(self): method _forward (line 121) | def _forward(self, method _forward_test (line 149) | def _forward_test(self, inputs): method _forward_train (line 157) | def _forward_train(self, inputs, data_samples): FILE: mmagic/models/editors/disco_diffusion/clip_wrapper.py class ClipWrapper (line 12) | class ClipWrapper(nn.Module): method __init__ (line 78) | def __init__(self, clip_type, *args, **kwargs): method get_embedding_layer (line 117) | def get_embedding_layer(self): method add_embedding (line 136) | def add_embedding(self, embeddings: Union[dict, List[dict]]): method set_only_embedding_trainable (line 148) | def set_only_embedding_trainable(self): method set_embedding_layer (line 164) | def set_embedding_layer(self): method unset_embedding_layer (line 175) | def unset_embedding_layer(self): method forward (line 182) | def forward(self, *args, **kwargs): class EmbeddingLayerWithFixes (line 187) | class EmbeddingLayerWithFixes(nn.Module): method __init__ (line 199) | def __init__(self, method weight (line 214) | def weight(self): method check_duplicate_names (line 218) | def check_duplicate_names(self, embeddings: List[dict]): method check_ids_overlap (line 230) | def check_ids_overlap(self, embeddings): method add_embeddings (line 246) | def add_embeddings(self, embeddings: Optional[Union[dict, List[dict]]]): method replace_input_ids (line 316) | def replace_input_ids(self, input_ids: torch.Tensor) -> torch.Tensor: method replace_embeddings (line 329) | def replace_embeddings(self, input_ids: torch.Tensor, method forward (line 386) | def forward(self, FILE: mmagic/models/editors/disco_diffusion/disco.py class DiscoDiffusion (line 22) | class DiscoDiffusion(nn.Module): method __init__ (line 48) | def __init__(self, method load_pretrained_models (line 83) | def load_pretrained_models(self, pretrained_cfgs): method device (line 106) | def device(self): method infer (line 115) | def infer(self, FILE: mmagic/models/editors/disco_diffusion/guider.py function sinc (line 27) | def sinc(x): function lanczos (line 44) | def lanczos(x, a): function ramp (line 51) | def ramp(ratio, width): function resample (line 70) | def resample(input, size, align_corners=True): function range_loss (line 104) | def range_loss(input): function spherical_dist_loss (line 109) | def spherical_dist_loss(x, y): class MakeCutouts (line 116) | class MakeCutouts(nn.Module): method __init__ (line 129) | def __init__(self, cut_size, cutn): method forward (line 144) | def forward(self, input, skip_augs=False): class MakeCutoutsDango (line 170) | class MakeCutoutsDango(nn.Module): method __init__ (line 200) | def __init__(self, method forward (line 231) | def forward(self, input, skip_augs=False): function parse_prompt (line 278) | def parse_prompt(prompt): function split_prompts (line 289) | def split_prompts(prompts, max_frames=1): class ImageTextGuider (line 299) | class ImageTextGuider(nn.Module): method __init__ (line 312) | def __init__(self, clip_models): method frame_prompt_from_text (line 322) | def frame_prompt_from_text(self, text_prompts, frame_num=0): method compute_prompt_stats (line 333) | def compute_prompt_stats(self, method cond_fn (line 385) | def cond_fn(self, method device (line 503) | def device(self): method forward (line 511) | def forward(self, x): FILE: mmagic/models/editors/disco_diffusion/secondary_model.py function append_dims (line 14) | def append_dims(x, n): function expand_to_planes (line 19) | def expand_to_planes(x, shape): function alpha_sigma_to_t (line 24) | def alpha_sigma_to_t(alpha, sigma): function t_to_alpha_sigma (line 29) | def t_to_alpha_sigma(t): class ConvBlock (line 34) | class ConvBlock(nn.Sequential): method __init__ (line 42) | def __init__(self, c_in, c_out): class SkipBlock (line 49) | class SkipBlock(nn.Module): method __init__ (line 59) | def __init__(self, main, skip=None): method forward (line 64) | def forward(self, input): class FourierFeatures (line 69) | class FourierFeatures(nn.Module): method __init__ (line 78) | def __init__(self, in_features, out_features, std=1.): method forward (line 84) | def forward(self, input): class SecondaryDiffusionImageNet2 (line 91) | class SecondaryDiffusionImageNet2(nn.Module): method __init__ (line 98) | def __init__(self): method forward (line 156) | def forward(self, input, t): FILE: mmagic/models/editors/dreambooth/dreambooth.py class DreamBooth (line 21) | class DreamBooth(StableDiffusion): method __init__ (line 66) | def __init__(self, method generate_class_prior_images (line 114) | def generate_class_prior_images(self, num_batches=None): method prepare_model (line 151) | def prepare_model(self): method set_lora (line 169) | def set_lora(self): method val_step (line 175) | def val_step(self, data: dict) -> SampleList: method test_step (line 205) | def test_step(self, data: dict) -> SampleList: method train_step (line 233) | def train_step(self, data, optim_wrapper): method forward (line 311) | def forward(self, FILE: mmagic/models/editors/duf/duf.py class DynamicUpsamplingFilter (line 8) | class DynamicUpsamplingFilter(BaseModule): method __init__ (line 20) | def __init__(self, filter_size=(5, 5)): method forward (line 36) | def forward(self, x, filters): FILE: mmagic/models/editors/edsr/edsr_net.py class EDSRNet (line 14) | class EDSRNet(BaseModule): method __init__ (line 36) | def __init__(self, method forward (line 66) | def forward(self, x): class UpsampleModule (line 90) | class UpsampleModule(nn.Sequential): method __init__ (line 98) | def __init__(self, scale, mid_channels): FILE: mmagic/models/editors/edvr/edvr.py class EDVR (line 9) | class EDVR(BaseEditModel): method __init__ (line 25) | def __init__(self, method forward_train (line 46) | def forward_train(self, inputs, data_samples=None): FILE: mmagic/models/editors/edvr/edvr_net.py class EDVRNet (line 16) | class EDVRNet(BaseModule): method __init__ (line 40) | def __init__(self, method forward (line 103) | def forward(self, x): method init_weights (line 163) | def init_weights(self): class ModulatedDCNPack (line 187) | class ModulatedDCNPack(ModulatedDeformConv2d): method __init__ (line 207) | def __init__(self, *args, **kwargs): method init_offset (line 219) | def init_offset(self): method forward (line 223) | def forward(self, x, extra_feat): class PCDAlignment (line 235) | class PCDAlignment(BaseModule): method __init__ (line 247) | def __init__(self, method forward (line 310) | def forward(self, neighbor_feats, ref_feats): class TSAFusion (line 364) | class TSAFusion(BaseModule): method __init__ (line 376) | def __init__(self, method forward (line 418) | def forward(self, aligned_feat): FILE: mmagic/models/editors/eg3d/camera.py class BaseCamera (line 16) | class BaseCamera(object): method __init__ (line 42) | def __init__(self, method _sample_in_range (line 68) | def _sample_in_range(self, mean: float, std: float, method sample_intrinsic (line 91) | def sample_intrinsic(self, method fov_to_intrinsic (line 130) | def fov_to_intrinsic(self, method focal_to_instrinsic (line 156) | def focal_to_instrinsic(self, method sample_theta (line 180) | def sample_theta(self, mean: float, std: float, method sample_phi (line 195) | def sample_phi(self, mean: float, std: float, method sample_camera2world (line 219) | def sample_camera2world(self, method interpolation_cam2world (line 286) | def interpolation_cam2world(self, method __repr__ (line 353) | def __repr__(self): class GaussianCamera (line 367) | class GaussianCamera(BaseCamera): method __init__ (line 387) | def __init__(self, class UniformCamera (line 403) | class UniformCamera(BaseCamera): method __init__ (line 423) | def __init__(self, function create_cam2world_matrix (line 438) | def create_cam2world_matrix(forward_vector: torch.Tensor, origin: torch.... FILE: mmagic/models/editors/eg3d/dual_discriminator.py class DualDiscriminator (line 18) | class DualDiscriminator(StyleGAN2Discriminator): method __init__ (line 35) | def __init__(self, method forward (line 47) | def forward(self, FILE: mmagic/models/editors/eg3d/eg3d.py class EG3D (line 21) | class EG3D(BaseConditionalGAN): method __init__ (line 55) | def __init__(self, method label_fn (line 76) | def label_fn(self, method data_sample_to_label (line 102) | def data_sample_to_label(self, data_sample: SampleList method pack_to_data_sample (line 119) | def pack_to_data_sample( method forward (line 151) | def forward(self, method interpolation (line 231) | def interpolation(self, FILE: mmagic/models/editors/eg3d/eg3d_generator.py class TriplaneGenerator (line 17) | class TriplaneGenerator(BaseModule): method __init__ (line 73) | def __init__(self, method sample_ray (line 147) | def sample_ray(self, cond: torch.Tensor) -> Tuple[Tensor]: method forward (line 163) | def forward(self, FILE: mmagic/models/editors/eg3d/eg3d_modules.py class TriPlaneBackbone (line 15) | class TriPlaneBackbone(StyleGAN2Generator): method __init__ (line 42) | def __init__(self, method mapping (line 68) | def mapping(self, method synthesis (line 128) | def synthesis(self, styles: torch.Tensor, *args, **kwargs) -> torch.Te... class SuperResolutionModule (line 143) | class SuperResolutionModule(BaseModule): method __init__ (line 161) | def __init__(self, method forward (line 210) | def forward(self, class SynthesisBlock (line 247) | class SynthesisBlock(BaseModule): method __init__ (line 261) | def __init__(self, method forward (line 296) | def forward(self, FILE: mmagic/models/editors/eg3d/eg3d_utils.py function get_ray_limits_box (line 7) | def get_ray_limits_box(rays_o: torch.Tensor, rays_d: torch.Tensor, function inverse_transform_sampling (line 87) | def inverse_transform_sampling(bins: torch.Tensor, function linspace_batch (line 146) | def linspace_batch(start: torch.Tensor, stop: torch.Tensor, FILE: mmagic/models/editors/eg3d/ray_sampler.py function sample_rays (line 7) | def sample_rays(cam2world: torch.Tensor, intrinsics: torch.Tensor, FILE: mmagic/models/editors/eg3d/renderer.py class EG3DRenderer (line 19) | class EG3DRenderer(BaseModule): method __init__ (line 49) | def __init__(self, method get_value (line 74) | def get_value(self, method forward (line 91) | def forward(self, method sample_stratified (line 197) | def sample_stratified(self, ray_origins: torch.Tensor, method neural_rendering (line 242) | def neural_rendering(self, planes: torch.Tensor, sample_coordinates: f... method sample_from_planes (line 268) | def sample_from_planes(self, method project_onto_planes (line 307) | def project_onto_planes(self, coordinates: torch.Tensor) -> torch.Tensor: method unify_samples (line 355) | def unify_samples(self, depths_c: torch.Tensor, colors_c: torch.Tensor, method volume_rendering (line 392) | def volume_rendering(self, colors: torch.Tensor, densities: torch.Tensor, method sample_importance (line 451) | def sample_importance(self, z_vals: torch.Tensor, weights: torch.Tensor, class EG3DDecoder (line 483) | class EG3DDecoder(BaseModule): method __init__ (line 496) | def __init__(self, method forward (line 512) | def forward(self, sampled_features: torch.Tensor) -> dict: FILE: mmagic/models/editors/esrgan/esrgan.py class ESRGAN (line 9) | class ESRGAN(SRGAN): method g_step (line 36) | def g_step(self, batch_outputs: torch.Tensor, batch_gt_data: torch.Ten... method d_step_real (line 78) | def d_step_real(self, batch_outputs: torch.Tensor, method d_step_fake (line 104) | def d_step_fake(self, batch_outputs: torch.Tensor, batch_gt_data): FILE: mmagic/models/editors/esrgan/rrdb_net.py class RRDBNet (line 13) | class RRDBNet(BaseModule): method __init__ (line 34) | def __init__(self, method forward (line 66) | def forward(self, x): method init_weights (line 93) | def init_weights(self): class ResidualDenseBlock (line 108) | class ResidualDenseBlock(nn.Module): method __init__ (line 119) | def __init__(self, mid_channels=64, growth_channels=32): method init_weights (line 131) | def init_weights(self): method forward (line 141) | def forward(self, x): class RRDB (line 159) | class RRDB(nn.Module): method __init__ (line 169) | def __init__(self, mid_channels, growth_channels=32): method forward (line 175) | def forward(self, x): FILE: mmagic/models/editors/fastcomposer/fastcomposer.py class FastComposer (line 21) | class FastComposer(StableDiffusion): method __init__ (line 23) | def __init__(self, method _tokenize_and_mask_noun_phrases_ends (line 89) | def _tokenize_and_mask_noun_phrases_ends(self, caption): method _encode_augmented_prompt (line 126) | def _encode_augmented_prompt(self, prompt: str, method infer (line 170) | def infer(self, FILE: mmagic/models/editors/fastcomposer/fastcomposer_util.py class FastComposerModel (line 24) | class FastComposerModel(nn.Module): method __init__ (line 28) | def __init__(self, text_encoder, image_encoder, vae, unet, cfg): method _clear_cross_attention_scores (line 60) | def _clear_cross_attention_scores(self): method from_pretrained (line 70) | def from_pretrained(cfg, vae, unet): method forward (line 98) | def forward(self, batch, noise_scheduler): class FastComposerTextEncoder (line 203) | class FastComposerTextEncoder(CLIPPreTrainedModel): method from_pretrained (line 207) | def from_pretrained(model_name_or_path, **kwargs): method __init__ (line 213) | def __init__(self, text_model): method forward (line 221) | def forward( class FastComposerCLIPImageEncoder (line 314) | class FastComposerCLIPImageEncoder(CLIPPreTrainedModel): method from_pretrained (line 318) | def from_pretrained(global_model_name_or_path): method __init__ (line 334) | def __init__( method forward (line 347) | def forward(self, object_pixel_values): function get_object_transforms (line 375) | def get_object_transforms(cfg): class FastComposerPostfuseModule (line 428) | class FastComposerPostfuseModule(nn.Module): method __init__ (line 431) | def __init__(self, embed_dim): method fuse_fn (line 438) | def fuse_fn(self, text_embeds, object_embeds): method forward (line 457) | def forward( function unet_store_cross_attention_scores (line 486) | def unet_store_cross_attention_scores(unet, attention_scores, layers=5): class BalancedL1Loss (line 530) | class BalancedL1Loss(nn.Module): method __init__ (line 533) | def __init__(self, threshold=1.0, normalize=False): method forward (line 538) | def forward(self, object_token_attn_prob, object_segmaps): function get_object_localization_loss (line 566) | def get_object_localization_loss( function get_object_localization_loss_for_one_layer (line 585) | def get_object_localization_loss_for_one_layer( class RandomZoomIn (line 635) | class RandomZoomIn(nn.Module): method __init__ (line 638) | def __init__(self, min_zoom=1.0, max_zoom=1.5): method forward (line 643) | def forward(self, image: torch.Tensor): class PadToSquare (line 663) | class PadToSquare(nn.Module): method __init__ (line 667) | def __init__(self, fill=0, padding_mode='constant'): method forward (line 672) | def forward(self, image: torch.Tensor): class CropTopSquare (line 703) | class CropTopSquare(nn.Module): method __init__ (line 707) | def __init__(self): method forward (line 710) | def forward(self, image: torch.Tensor): class MLP (line 725) | class MLP(nn.Module): method __init__ (line 728) | def __init__(self, in_dim, out_dim, hidden_dim, use_residual=True): method forward (line 738) | def forward(self, x): function fuse_object_embeddings (line 757) | def fuse_object_embeddings( function build_causal_attention_mask (line 795) | def build_causal_attention_mask(bsz, seq_len, dtype, device=None): FILE: mmagic/models/editors/fba/fba_decoder.py class FBADecoder (line 14) | class FBADecoder(nn.Module): method __init__ (line 28) | def __init__(self, method init_weights (line 138) | def init_weights(self, pretrained=None): method forward (line 158) | def forward(self, inputs): FILE: mmagic/models/editors/fba/fba_encoder.py class FBAResnetDilated (line 7) | class FBAResnetDilated(ResNet): method forward (line 10) | def forward(self, x): FILE: mmagic/models/editors/flavr/flavr.py class FLAVR (line 10) | class FLAVR(BasicInterpolator): method merge_frames (line 38) | def merge_frames(input_tensors, output_tensors): FILE: mmagic/models/editors/flavr/flavr_net.py class FLAVRNet (line 11) | class FLAVRNet(BaseModule): method __init__ (line 37) | def __init__(self, method forward (line 82) | def forward(self, images: torch.Tensor): class Encoder (line 120) | class Encoder(nn.Module): method __init__ (line 134) | def __init__(self, block, layers, stem_layer, mid_channels_list, norm_... method forward (line 174) | def forward(self, x): method _make_layer (line 192) | def _make_layer(self, method _initialize_weights (line 239) | def _initialize_weights(self): class Decoder (line 255) | class Decoder(nn.Module): method __init__ (line 268) | def __init__(self, method forward (line 318) | def forward(self, xs): method _join_tensors (line 345) | def _join_tensors(self, x1, x2): class UpConv3d (line 359) | class UpConv3d(nn.Module): method __init__ (line 378) | def __init__(self, method forward (line 417) | def forward(self, x): class Conv3d (line 422) | class Conv3d(nn.Module): method __init__ (line 441) | def __init__(self, method forward (line 467) | def forward(self, x): class BasicStem (line 472) | class BasicStem(ConvModule): method __init__ (line 483) | def __init__(self, out_channels=64, bias=False, norm_cfg=None): class BasicBlock (line 496) | class BasicBlock(nn.Module): method __init__ (line 514) | def __init__( method forward (line 549) | def forward(self, x): class SEGating (line 572) | class SEGating(nn.Module): method __init__ (line 579) | def __init__(self, in_channels): method forward (line 589) | def forward(self, x): FILE: mmagic/models/editors/gca/gca.py class GCA (line 10) | class GCA(BaseMattor): method __init__ (line 28) | def __init__(self, method _forward (line 44) | def _forward(self, inputs): method _forward_test (line 57) | def _forward_test(self, inputs): method _forward_train (line 68) | def _forward_train(self, inputs, data_samples): FILE: mmagic/models/editors/gca/gca_module.py class GCAModule (line 9) | class GCAModule(nn.Module): method __init__ (line 49) | def __init__(self, method init_weights (line 81) | def init_weights(self): method forward (line 87) | def forward(self, img_feat, alpha_feat, unknown=None, softmax_scale=1.): method extract_feature_maps_patches (line 160) | def extract_feature_maps_patches(self, img_feat, alpha_feat, unknown): method compute_similarity_map (line 198) | def compute_similarity_map(self, img_feat, img_ps): method compute_guided_attention_score (line 220) | def compute_guided_attention_score(self, similarity_map, unknown_ps, s... method propagate_alpha_feature (line 252) | def propagate_alpha_feature(self, gca_score, alpha_ps): method process_unknown_mask (line 276) | def process_unknown_mask(self, unknown, img_feat, softmax_scale): method extract_patches (line 317) | def extract_patches(self, x, kernel_size, stride): method pad (line 339) | def pad(self, x, kernel_size, stride): method get_self_correlation_mask (line 355) | def get_self_correlation_mask(self, img_feat): method l2_norm (line 375) | def l2_norm(x): FILE: mmagic/models/editors/gca/resgca_dec.py class BasicBlockDec (line 14) | class BasicBlockDec(BasicBlock): method build_conv1 (line 22) | def build_conv1(self, in_channels, out_channels, kernel_size, stride, method build_conv2 (line 60) | def build_conv2(self, in_channels, out_channels, kernel_size, conv_cfg, class ResNetDec (line 88) | class ResNetDec(BaseModule): method __init__ (line 110) | def __init__(self, method init_weights (line 160) | def init_weights(self): method _make_layer (line 178) | def _make_layer(self, block, planes, num_blocks, conv_cfg, norm_cfg, method forward (line 217) | def forward(self, x): class ResShortcutDec (line 237) | class ResShortcutDec(ResNetDec): method forward (line 268) | def forward(self, inputs): class ResGCADecoder (line 302) | class ResGCADecoder(ResShortcutDec): method __init__ (line 337) | def __init__(self, method forward (line 353) | def forward(self, inputs): FILE: mmagic/models/editors/gca/resgca_enc.py class BasicBlock (line 14) | class BasicBlock(nn.Module): method __init__ (line 33) | def __init__(self, method build_conv1 (line 60) | def build_conv1(self, in_channels, out_channels, kernel_size, stride, method build_conv2 (line 91) | def build_conv2(self, in_channels, out_channels, kernel_size, conv_cfg, method forward (line 122) | def forward(self, x): class ResNetEnc (line 146) | class ResNetEnc(BaseModule): method __init__ (line 170) | def __init__(self, method init_weights (line 235) | def init_weights(self): method _make_layer (line 257) | def _make_layer(self, block, planes, num_blocks, stride, conv_cfg, method forward (line 296) | def forward(self, x): class ResShortcutEnc (line 318) | class ResShortcutEnc(ResNetEnc): method __init__ (line 356) | def __init__(self, method _make_shortcut (line 390) | def _make_shortcut(self, in_channels, out_channels, conv_cfg, norm_cfg, method forward (line 414) | def forward(self, x): class ResGCAEncoder (line 449) | class ResGCAEncoder(ResShortcutEnc): method __init__ (line 490) | def __init__(self, method forward (line 541) | def forward(self, x): FILE: mmagic/models/editors/ggan/ggan.py class GGAN (line 15) | class GGAN(BaseGAN): method disc_loss (line 21) | def disc_loss(self, disc_pred_fake: Tensor, method gen_loss (line 48) | def gen_loss(self, disc_pred_fake): method train_discriminator (line 68) | def train_discriminator(self, inputs: dict, data_samples: List[DataSam... method train_generator (line 97) | def train_generator(self, inputs: dict, data_samples: List[DataSample], FILE: mmagic/models/editors/glean/glean_styleganv2.py class GLEANStyleGANv2 (line 14) | class GLEANStyleGANv2(BaseModule): method __init__ (line 88) | def __init__(self, method forward (line 196) | def forward(self, lq): class RRDBFeatureExtractor (line 274) | class RRDBFeatureExtractor(nn.Module): method __init__ (line 287) | def __init__(self, method forward (line 303) | def forward(self, x): FILE: mmagic/models/editors/global_local/gl_decoder.py class GLDecoder (line 13) | class GLDecoder(BaseModule): method __init__ (line 27) | def __init__(self, method forward (line 100) | def forward(self, x): FILE: mmagic/models/editors/global_local/gl_dilation.py class GLDilationNeck (line 11) | class GLDilationNeck(BaseModule): method __init__ (line 28) | def __init__(self, method forward (line 52) | def forward(self, x): FILE: mmagic/models/editors/global_local/gl_disc.py class GLDiscs (line 11) | class GLDiscs(BaseModule): method __init__ (line 23) | def __init__(self, global_disc_cfg, local_disc_cfg): method forward (line 30) | def forward(self, x): method init_weights (line 49) | def init_weights(self): FILE: mmagic/models/editors/global_local/gl_encoder.py class GLEncoder (line 9) | class GLEncoder(BaseModule): method __init__ (line 20) | def __init__(self, norm_cfg=None, act_cfg=dict(type='ReLU')): method forward (line 42) | def forward(self, x): FILE: mmagic/models/editors/global_local/gl_encoder_decoder.py class GLEncoderDecoder (line 8) | class GLEncoderDecoder(BaseModule): method __init__ (line 23) | def __init__(self, method forward (line 35) | def forward(self, x): FILE: mmagic/models/editors/global_local/gl_inpaintor.py class GLInpaintor (line 13) | class GLInpaintor(OneStageInpaintor): method __init__ (line 68) | def __init__(self, method generator_loss (line 102) | def generator_loss(self, fake_res, fake_img, fake_local, gt, mask, method train_step (line 150) | def train_step(self, data: List[dict], optim_wrapper): FILE: mmagic/models/editors/guided_diffusion/adm.py function classifier_grad (line 20) | def classifier_grad(classifier, x, t, y=None, classifier_scale=1.0): class AblatedDiffusionModel (line 35) | class AblatedDiffusionModel(BaseModel): method __init__ (line 51) | def __init__(self, method load_pretrained_models (line 78) | def load_pretrained_models(self, pretrained_cfgs): method device (line 98) | def device(self): method infer (line 107) | def infer(self, method forward (line 190) | def forward(self, method val_step (line 241) | def val_step(self, data: dict) -> SampleList: method test_step (line 259) | def test_step(self, data: dict) -> SampleList: method train_step (line 273) | def train_step(self, data: dict, optim_wrapper: OptimWrapperDict): method get_module (line 315) | def get_module(self, model: nn.Module, module_name: str) -> nn.Module: FILE: mmagic/models/editors/guided_diffusion/classifier.py function checkpoint (line 16) | def checkpoint(func, inputs, params, flag): class CheckpointFunction (line 33) | class CheckpointFunction(torch.autograd.Function): method forward (line 36) | def forward(ctx, run_function, length, *args): method backward (line 45) | def backward(ctx, *output_grads): function timestep_embedding (line 67) | def timestep_embedding(timesteps, dim, max_period=10000): function zero_module (line 89) | def zero_module(module): class Upsample (line 96) | class Upsample(nn.Module): method __init__ (line 105) | def __init__(self, channels, use_conv, dims=2, out_channels=None): method forward (line 115) | def forward(self, x): class TimestepBlock (line 136) | class TimestepBlock(nn.Module): method forward (line 141) | def forward(self, x, emb): class AttentionBlock (line 145) | class AttentionBlock(nn.Module): method __init__ (line 153) | def __init__( method forward (line 183) | def forward(self, x): method _forward (line 195) | def _forward(self, x): class TimestepEmbedSequential (line 212) | class TimestepEmbedSequential(nn.Sequential, TimestepBlock): method forward (line 216) | def forward(self, x, emb): class GroupNorm32 (line 235) | class GroupNorm32(nn.GroupNorm): method forward (line 237) | def forward(self, x): function normalization (line 249) | def normalization(channels): class Downsample (line 258) | class Downsample(nn.Module): method __init__ (line 267) | def __init__(self, channels, use_conv, dims=2, out_channels=None): method forward (line 281) | def forward(self, x): class ResBlock (line 294) | class ResBlock(TimestepBlock): method __init__ (line 310) | def __init__( method forward (line 373) | def forward(self, x, emb): method _forward (line 383) | def _forward(self, x, emb): class AttentionPool2d (line 415) | class AttentionPool2d(nn.Module): method __init__ (line 421) | def __init__( method forward (line 436) | def forward(self, x): class EncoderUNetModel (line 456) | class EncoderUNetModel(nn.Module): method __init__ (line 462) | def __init__( method convert_to_fp16 (line 623) | def convert_to_fp16(self): method convert_to_fp32 (line 628) | def convert_to_fp32(self): method forward (line 633) | def forward(self, x, timesteps): FILE: mmagic/models/editors/iconvsr/iconvsr_net.py class IconVSRNet (line 20) | class IconVSRNet(BaseModule): method __init__ (line 45) | def __init__(self, method spatial_padding (line 93) | def spatial_padding(self, lrs): method check_if_mirror_extended (line 117) | def check_if_mirror_extended(self, lrs): method compute_refill_features (line 133) | def compute_refill_features(self, lrs, keyframe_idx): method compute_flow (line 157) | def compute_flow(self, lrs): method forward (line 186) | def forward(self, lrs): class EDVRFeatureExtractor (line 265) | class EDVRFeatureExtractor(BaseModule): method __init__ (line 290) | def __init__(self, method forward (line 346) | def forward(self, x): FILE: mmagic/models/editors/indexnet/indexnet.py class IndexNet (line 8) | class IndexNet(BaseMattor): method __init__ (line 27) | def __init__(self, method _forward (line 47) | def _forward(self, inputs): method _forward_test (line 59) | def _forward_test(self, inputs): method _forward_train (line 70) | def _forward_train(self, inputs, data_samples): FILE: mmagic/models/editors/indexnet/indexnet_decoder.py class IndexedUpsample (line 16) | class IndexedUpsample(BaseModule): method __init__ (line 31) | def __init__(self, method init_weights (line 48) | def init_weights(self): method forward (line 57) | def forward(self, x, shortcut, dec_idx_feat=None): class IndexNetDecoder (line 79) | class IndexNetDecoder(BaseModule): method __init__ (line 94) | def __init__(self, method init_weights (line 131) | def init_weights(self): method forward (line 142) | def forward(self, inputs): FILE: mmagic/models/editors/indexnet/indexnet_encoder.py function build_index_block (line 17) | def build_index_block(in_channels, class HolisticIndexBlock (line 81) | class HolisticIndexBlock(BaseModule): method __init__ (line 96) | def __init__(self, method forward (line 123) | def forward(self, x): class DepthwiseIndexBlock (line 144) | class DepthwiseIndexBlock(BaseModule): method __init__ (line 162) | def __init__(self, method forward (line 194) | def forward(self, x): class InvertedResidual (line 222) | class InvertedResidual(BaseModule): method __init__ (line 241) | def __init__(self, method pad (line 285) | def pad(self, inputs, kernel_size, dilation): method forward (line 301) | def forward(self, x): class IndexNetEncoder (line 319) | class IndexNetEncoder(BaseModule): method __init__ (line 357) | def __init__(self, method _make_layer (line 462) | def _make_layer(self, layer_setting, norm_cfg): method train (line 489) | def train(self, mode=True): method init_weights (line 497) | def init_weights(self): method forward (line 516) | def forward(self, x): FILE: mmagic/models/editors/inst_colorization/color_utils.py function xyz2rgb (line 6) | def xyz2rgb(xyz): function lab2xyz (line 35) | def lab2xyz(lab): function lab2rgb (line 68) | def lab2rgb(lab_rs, color_data_opt): function encode_ab_ind (line 87) | def encode_ab_ind(data_ab, color_data_opt): function rgb2xyz (line 105) | def rgb2xyz(rgb): function xyz2lab (line 136) | def xyz2lab(xyz): function rgb2lab (line 169) | def rgb2lab(rgb, color_opt): function get_colorization_data (line 187) | def get_colorization_data(data_raw, color_opt, num_points=None): function add_color_patches_rand_gt (line 224) | def add_color_patches_rand_gt(data, FILE: mmagic/models/editors/inst_colorization/colorization_net.py class ColorizationNet (line 12) | class ColorizationNet(BaseModule): method __init__ (line 30) | def __init__(self, method forward (line 258) | def forward(self, input_A, input_B, mask_B): FILE: mmagic/models/editors/inst_colorization/fusion_net.py class FusionNet (line 11) | class FusionNet(BaseModule): method __init__ (line 29) | def __init__(self, method forward (line 285) | def forward(self, input_A, input_B, mask_B, instance_feature, FILE: mmagic/models/editors/inst_colorization/inst_colorization.py class InstColorization (line 15) | class InstColorization(BaseModel): method __init__ (line 39) | def __init__(self, method forward (line 70) | def forward(self, method convert_to_datasample (line 135) | def convert_to_datasample(self, inputs, data_samples): method forward_train (line 152) | def forward_train(self, inputs, data_samples=None, **kwargs): method train_step (line 157) | def train_step(self, data: List[dict], method forward_inference (line 172) | def forward_inference(self, inputs, data_samples=None, **kwargs): method forward_tensor (line 195) | def forward_tensor(self, inputs, data_samples): FILE: mmagic/models/editors/inst_colorization/weight_layer.py function get_norm_layer (line 11) | def get_norm_layer(norm_type='instance'): class WeightLayer (line 34) | class WeightLayer(BaseModule): method __init__ (line 45) | def __init__(self, input_ch, inner_ch=16): method resize_and_pad (line 67) | def resize_and_pad(self, feauture_maps, info_array): method forward (line 88) | def forward(self, instance_feature, bg_feature, box_info): FILE: mmagic/models/editors/liif/liif.py class LIIF (line 12) | class LIIF(BaseEditModel): method forward_tensor (line 26) | def forward_tensor(self, inputs, data_samples=None, **kwargs): method forward_inference (line 46) | def forward_inference(self, inputs, data_samples=None, **kwargs): FILE: mmagic/models/editors/liif/liif_net.py class LIIFNet (line 11) | class LIIFNet(BaseModule): method __init__ (line 31) | def __init__(self, method forward (line 56) | def forward(self, x, coord, cell, test_mode=False): method query_rgb (line 77) | def query_rgb(self, feature, coord, cell=None): method batched_predict (line 172) | def batched_predict(self, x, coord, cell): method gen_feature (line 197) | def gen_feature(self, x): class LIIFEDSRNet (line 209) | class LIIFEDSRNet(LIIFNet): method __init__ (line 224) | def __init__(self, method gen_feature (line 244) | def gen_feature(self, x): class LIIFRDNNet (line 263) | class LIIFRDNNet(LIIFNet): method __init__ (line 278) | def __init__(self, method gen_feature (line 300) | def gen_feature(self, x): FILE: mmagic/models/editors/liif/mlp_refiner.py class MLPRefiner (line 9) | class MLPRefiner(BaseModule): method __init__ (line 18) | def __init__(self, in_dim, out_dim, hidden_list): method forward (line 30) | def forward(self, x): FILE: mmagic/models/editors/lsgan/lsgan.py class LSGAN (line 15) | class LSGAN(BaseGAN): method disc_loss (line 26) | def disc_loss(self, disc_pred_fake: Tensor, method gen_loss (line 54) | def gen_loss(self, disc_pred_fake: Tensor) -> Tuple: method train_discriminator (line 74) | def train_discriminator(self, inputs: dict, data_samples: DataSample, method train_generator (line 103) | def train_generator(self, inputs: dict, data_samples: List[DataSample], FILE: mmagic/models/editors/lsgan/lsgan_discriminator.py class LSGANDiscriminator (line 11) | class LSGANDiscriminator(BaseModule): method __init__ (line 47) | def __init__(self, method forward (line 105) | def forward(self, x): FILE: mmagic/models/editors/lsgan/lsgan_generator.py class LSGANGenerator (line 13) | class LSGANGenerator(BaseModule): method __init__ (line 51) | def __init__(self, method forward (line 137) | def forward(self, noise, num_batches=0, return_noise=False): FILE: mmagic/models/editors/mspie/mspie_stylegan2.py class MSPIEStyleGAN2 (line 26) | class MSPIEStyleGAN2(StyleGAN2): method __init__ (line 38) | def __init__(self, *args, train_settings=dict(), **kwargs): method train_step (line 52) | def train_step(self, data: dict, method train_generator (line 128) | def train_generator(self, inputs: dict, data_samples: DataSample, method train_discriminator (line 154) | def train_discriminator(self, inputs: dict, data_samples: DataSample, FILE: mmagic/models/editors/mspie/mspie_stylegan2_discriminator.py class MSStyleGAN2Discriminator (line 12) | class MSStyleGAN2Discriminator(BaseModule): method __init__ (line 29) | def __init__(self, method forward (line 81) | def forward(self, x): FILE: mmagic/models/editors/mspie/mspie_stylegan2_generator.py class MSStyleGANv2Generator (line 22) | class MSStyleGANv2Generator(BaseModule): method __init__ (line 49) | def __init__(self, method train (line 192) | def train(self, mode=True): method make_injected_noise (line 212) | def make_injected_noise(self, chosen_scale=0): method get_mean_latent (line 242) | def get_mean_latent(self, num_samples=4096, **kwargs): method style_mixing (line 254) | def style_mixing(self, method forward (line 289) | def forward(self, FILE: mmagic/models/editors/mspie/mspie_stylegan2_modules.py class ModulatedPEConv2d (line 22) | class ModulatedPEConv2d(BaseModule): method __init__ (line 62) | def __init__(self, method forward (line 138) | def forward(self, x, style): class ModulatedPEStyleConv (line 207) | class ModulatedPEStyleConv(BaseModule): method __init__ (line 235) | def __init__(self, method forward (line 263) | def forward(self, x, style, noise=None, return_noise=False): FILE: mmagic/models/editors/mspie/pe_singan.py class PESinGAN (line 17) | class PESinGAN(SinGAN): method __init__ (line 24) | def __init__(self, method construct_fixed_noises (line 45) | def construct_fixed_noises(self): FILE: mmagic/models/editors/mspie/pe_singan_generator.py class SinGANMSGeneratorPE (line 16) | class SinGANMSGeneratorPE(SinGANMultiScaleGenerator): method __init__ (line 61) | def __init__(self, method forward (line 133) | def forward(self, FILE: mmagic/models/editors/mspie/positional_encoding.py class SinusoidalPositionalEmbedding (line 11) | class SinusoidalPositionalEmbedding(BaseModule): method __init__ (line 35) | def __init__(self, method get_embedding (line 55) | def get_embedding(num_embeddings, method forward (line 85) | def forward(self, input, **kwargs): method make_positions (line 111) | def make_positions(self, input, padding_idx): method make_grid2d (line 127) | def make_grid2d(self, height, width, num_batches=1, center_shift=None): method make_grid2d_like (line 188) | def make_grid2d_like(self, x, center_shift=None): class CatersianGrid (line 205) | class CatersianGrid(BaseModule): method forward (line 214) | def forward(self, x, **kwargs): method make_grid2d (line 218) | def make_grid2d(self, height, width, num_batches=1, requires_grad=False): method make_grid2d_like (line 231) | def make_grid2d_like(self, x, requires_grad=False): FILE: mmagic/models/editors/nafnet/naf_avgpool2d.py class NAFAvgPool2d (line 9) | class NAFAvgPool2d(BaseModule): method __init__ (line 19) | def __init__(self, method extra_repr (line 37) | def extra_repr(self) -> str: method forward (line 41) | def forward(self, x): function replace_layers (line 103) | def replace_layers(model, base_size, train_size, fast_imp, **kwargs): class Local_Base (line 117) | class Local_Base(): method convert (line 124) | def convert(self, *args, train_size, **kwargs): FILE: mmagic/models/editors/nafnet/naf_layerNorm2d.py class LayerNormFunction (line 7) | class LayerNormFunction(torch.autograd.Function): method forward (line 11) | def forward(ctx, x, weight, bias, eps): method backward (line 22) | def backward(ctx, grad_output): class LayerNorm2d (line 36) | class LayerNorm2d(nn.Module): method __init__ (line 45) | def __init__(self, channels, eps=1e-6): method forward (line 51) | def forward(self, x): FILE: mmagic/models/editors/nafnet/nafbaseline_net.py class NAFBaseline (line 14) | class NAFBaseline(BaseModule): method __init__ (line 26) | def __init__(self, method forward (line 89) | def forward(self, inp): method check_image_size (line 119) | def check_image_size(self, x): class NAFBaselineLocal (line 136) | class NAFBaselineLocal(Local_Base, NAFBaseline): method __init__ (line 148) | def __init__(self, class BaselineBlock (line 166) | class BaselineBlock(BaseModule): method __init__ (line 176) | def __init__(self, method forward (line 262) | def forward(self, inp): FILE: mmagic/models/editors/nafnet/nafnet_net.py class NAFNet (line 14) | class NAFNet(BaseModule): method __init__ (line 27) | def __init__(self, method forward (line 81) | def forward(self, inp): method check_image_size (line 111) | def check_image_size(self, x): class NAFNetLocal (line 128) | class NAFNetLocal(Local_Base, NAFNet): method __init__ (line 142) | def __init__(self, class NAFBlock (line 162) | class NAFBlock(BaseModule): method __init__ (line 176) | def __init__(self, method forward (line 264) | def forward(self, inp): class SimpleGate (line 294) | class SimpleGate(BaseModule): method forward (line 305) | def forward(self, x): FILE: mmagic/models/editors/pconv/mask_conv_module.py class MaskConvModule (line 5) | class MaskConvModule(ConvModule): method __init__ (line 38) | def __init__(self, *args, **kwargs): method forward (line 44) | def forward(self, FILE: mmagic/models/editors/pconv/partial_conv.py class PartialConv2d (line 11) | class PartialConv2d(nn.Conv2d): method __init__ (line 24) | def __init__(self, *args, multi_channel=False, eps=1e-8, **kwargs): method forward (line 44) | def forward(self, input, mask=None, return_mask=True): FILE: mmagic/models/editors/pconv/pconv_decoder.py class PConvDecoder (line 11) | class PConvDecoder(BaseModule): method __init__ (line 26) | def __init__(self, method forward (line 89) | def forward(self, input_dict): FILE: mmagic/models/editors/pconv/pconv_encoder.py class PConvEncoder (line 10) | class PConvEncoder(BaseModule): method __init__ (line 28) | def __init__(self, method train (line 92) | def train(self, mode=True): method forward (line 101) | def forward(self, x, mask): FILE: mmagic/models/editors/pconv/pconv_encoder_decoder.py class PConvEncoderDecoder (line 8) | class PConvEncoderDecoder(BaseModule): method __init__ (line 16) | def __init__(self, encoder, decoder): method forward (line 24) | def forward(self, x, mask_in): FILE: mmagic/models/editors/pconv/pconv_inpaintor.py class PConvInpaintor (line 9) | class PConvInpaintor(OneStageInpaintor): method forward_tensor (line 16) | def forward_tensor(self, inputs, data_samples): method train_step (line 35) | def train_step(self, data: List[dict], optim_wrapper): FILE: mmagic/models/editors/pggan/pggan.py class ProgressiveGrowingGAN (line 29) | class ProgressiveGrowingGAN(BaseGAN): method __init__ (line 57) | def __init__(self, method forward (line 113) | def forward(self, method train_discriminator (line 205) | def train_discriminator(self, inputs: Tensor, method disc_loss (line 246) | def disc_loss(self, disc_pred_fake: Tensor, disc_pred_real: Tensor, method train_generator (line 306) | def train_generator(self, inputs: Tensor, data_samples: List[DataSample], method gen_loss (line 338) | def gen_loss(self, disc_pred_fake: Tensor) -> Tuple[Tensor, dict]: method train_step (line 359) | def train_step(self, data: dict, optim_wrapper: OptimWrapperDict): FILE: mmagic/models/editors/pggan/pggan_discriminator.py class PGGANDiscriminator (line 16) | class PGGANDiscriminator(BaseModule): method __init__ (line 69) | def __init__(self, method _num_out_channels (line 147) | def _num_out_channels(self, log_scale: int) -> int: method _get_fromrgb_layer (line 161) | def _get_fromrgb_layer(self, in_channels: int, method _get_convdown_block (line 176) | def _get_convdown_block(self, in_channels: int, method forward (line 211) | def forward(self, x, transition_weight=1., curr_scale=-1): FILE: mmagic/models/editors/pggan/pggan_generator.py class PGGANGenerator (line 16) | class PGGANGenerator(BaseModule): method __init__ (line 61) | def __init__(self, method _get_torgb_layer (line 118) | def _get_torgb_layer(self, in_channels: int): method _num_out_channels (line 137) | def _num_out_channels(self, log_scale: int): method _get_upconv_block (line 151) | def _get_upconv_block(self, in_channels, log_scale): method forward (line 190) | def forward(self, FILE: mmagic/models/editors/pggan/pggan_modules.py class EqualizedLR (line 16) | class EqualizedLR: method __init__ (line 36) | def __init__(self, name='weight', gain=2**0.5, mode='fan_in', lr_mul=1... method compute_weight (line 42) | def compute_weight(self, module): method __call__ (line 64) | def __call__(self, module, inputs): method apply (line 69) | def apply(module, name, gain=2**0.5, mode='fan_in', lr_mul=1.): function equalized_lr (line 112) | def equalized_lr(module, name='weight', gain=2**0.5, mode='fan_in', lr_m... function pixel_norm (line 140) | def pixel_norm(x, eps=1e-6): class PixelNorm (line 165) | class PixelNorm(BaseModule): method __init__ (line 177) | def __init__(self, in_channels=None, eps=1e-6): method forward (line 181) | def forward(self, x): class EqualizedLRConvModule (line 194) | class EqualizedLRConvModule(ConvModule): method __init__ (line 210) | def __init__(self, *args, equalized_lr_cfg=dict(mode='fan_in'), **kwar... method _init_conv_weights (line 218) | def _init_conv_weights(self): class EqualizedLRConvUpModule (line 224) | class EqualizedLRConvUpModule(EqualizedLRConvModule): method __init__ (line 242) | def __init__(self, method forward (line 256) | def forward(self, x, **kwargs): method fused_nn_hook (line 270) | def fused_nn_hook(module, inputs): class EqualizedLRConvDownModule (line 281) | class EqualizedLRConvDownModule(EqualizedLRConvModule): method __init__ (line 300) | def __init__(self, *args, downsample=dict(type='fused_pool'), **kwargs): method forward (line 318) | def forward(self, x, **kwargs): method fused_avgpool_hook (line 333) | def fused_avgpool_hook(module, inputs): class EqualizedLRLinearModule (line 344) | class EqualizedLRLinearModule(nn.Linear): method __init__ (line 360) | def __init__(self, *args, equalized_lr_cfg=dict(mode='fan_in'), **kwar... method _init_linear_weights (line 373) | def _init_linear_weights(self): class PGGANNoiseTo2DFeat (line 381) | class PGGANNoiseTo2DFeat(BaseModule): method __init__ (line 383) | def __init__(self, method forward (line 417) | def forward(self, x): class PGGANDecisionHead (line 443) | class PGGANDecisionHead(BaseModule): method __init__ (line 445) | def __init__(self, method forward (line 484) | def forward(self, x): class MiniBatchStddevLayer (line 508) | class MiniBatchStddevLayer(BaseModule): method __init__ (line 520) | def __init__(self, group_size=4, eps=1e-8, gather_all_batch=False): method forward (line 529) | def forward(self, x): FILE: mmagic/models/editors/pix2pix/pix2pix.py class Pix2Pix (line 14) | class Pix2Pix(BaseTranslationModel): method __init__ (line 21) | def __init__(self, *args, **kwargs): method forward_test (line 25) | def forward_test(self, img, target_domain, **kwargs): method _get_disc_loss (line 43) | def _get_disc_loss(self, outputs): method _get_gen_loss (line 74) | def _get_gen_loss(self, outputs): method train_step (line 105) | def train_step(self, data, optim_wrapper=None): method test_step (line 168) | def test_step(self, data: dict) -> SampleList: method val_step (line 198) | def val_step(self, data: dict) -> SampleList: FILE: mmagic/models/editors/pix2pix/pix2pix_generator.py class UnetGenerator (line 10) | class UnetGenerator(BaseModule): method __init__ (line 31) | def __init__(self, method forward (line 96) | def forward(self, x): method init_weights (line 107) | def init_weights(self): FILE: mmagic/models/editors/pix2pix/pix2pix_modules.py class UnetSkipConnectionBlock (line 7) | class UnetSkipConnectionBlock(nn.Module): method __init__ (line 28) | def __init__(self, method forward (line 110) | def forward(self, x): FILE: mmagic/models/editors/plain/plain_decoder.py class MaxUnpool2dop (line 16) | class MaxUnpool2dop(Function): method forward (line 24) | def forward(ctx, input, indices, kernel_size, stride, padding, method symbolic (line 42) | def symbolic(g, input, indices, kernel_size, stride, padding, output_s... class MaxUnpool2d (line 121) | class MaxUnpool2d(_MaxUnpoolNd): method __init__ (line 132) | def __init__(self, kernel_size, stride=None, padding=0): method forward (line 138) | def forward(self, input, indices, output_size=None): class PlainDecoder (line 154) | class PlainDecoder(BaseModule): method __init__ (line 162) | def __init__(self, in_channels, init_cfg: Optional[dict] = None): method init_weights (line 178) | def init_weights(self): method forward (line 188) | def forward(self, inputs): FILE: mmagic/models/editors/plain/plain_refiner.py class PlainRefiner (line 11) | class PlainRefiner(BaseModule): method __init__ (line 20) | def __init__(self, conv_channels=64, init_cfg=None): method init_weights (line 36) | def init_weights(self): method forward (line 42) | def forward(self, x, raw_alpha): FILE: mmagic/models/editors/rdn/rdn_net.py class RDNNet (line 9) | class RDNNet(BaseModule): method __init__ (line 37) | def __init__(self, method forward (line 101) | def forward(self, x): class DenseLayer (line 127) | class DenseLayer(BaseModule): method __init__ (line 135) | def __init__(self, in_channels, out_channels): method forward (line 141) | def forward(self, x): class RDB (line 153) | class RDB(BaseModule): method __init__ (line 162) | def __init__(self, in_channels, channel_growth, num_layers): method forward (line 175) | def forward(self, x): FILE: mmagic/models/editors/real_basicvsr/real_basicvsr.py class RealBasicVSR (line 14) | class RealBasicVSR(RealESRGAN): method __init__ (line 54) | def __init__(self, method extract_gt_data (line 88) | def extract_gt_data(self, data_samples): method g_step (line 117) | def g_step(self, batch_outputs, batch_gt_data): method train_step (line 141) | def train_step(self, data: List[dict], method forward_train (line 199) | def forward_train(self, batch_inputs, data_samples=None): FILE: mmagic/models/editors/real_basicvsr/real_basicvsr_net.py class RealBasicVSRNet (line 11) | class RealBasicVSRNet(BaseModule): method __init__ (line 37) | def __init__(self, method forward (line 65) | def forward(self, lqs, return_lqs=False): FILE: mmagic/models/editors/real_esrgan/real_esrgan.py class RealESRGAN (line 11) | class RealESRGAN(SRGAN): method __init__ (line 54) | def __init__(self, method forward_tensor (line 95) | def forward_tensor(self, inputs, data_samples=None, training=False): method g_step (line 116) | def g_step(self, batch_outputs, batch_gt_data): method d_step_real (line 151) | def d_step_real(self, batch_outputs, batch_gt_data: torch.Tensor): method d_step_fake (line 171) | def d_step_fake(self, batch_outputs, batch_gt_data): method extract_gt_data (line 189) | def extract_gt_data(self, data_samples): FILE: mmagic/models/editors/real_esrgan/unet_disc.py class UNetDiscriminatorWithSpectralNorm (line 10) | class UNetDiscriminatorWithSpectralNorm(BaseModule): method __init__ (line 21) | def __init__(self, in_channels, mid_channels=64, skip_connection=True): method forward (line 57) | def forward(self, img): FILE: mmagic/models/editors/restormer/restormer_net.py function to_3d (line 14) | def to_3d(x): function to_4d (line 19) | def to_4d(x, h, w): class BiasFree_LayerNorm (line 24) | class BiasFree_LayerNorm(BaseModule): method __init__ (line 31) | def __init__(self, normalized_shape): method forward (line 42) | def forward(self, x): class WithBias_LayerNorm (line 55) | class WithBias_LayerNorm(BaseModule): method __init__ (line 62) | def __init__(self, normalized_shape): method forward (line 74) | def forward(self, x): class LayerNorm (line 88) | class LayerNorm(BaseModule): method __init__ (line 98) | def __init__(self, dim, LayerNorm_type): method forward (line 105) | def forward(self, x): class FeedForward (line 118) | class FeedForward(BaseModule): method __init__ (line 130) | def __init__(self, dim, ffn_expansion_factor, bias): method forward (line 150) | def forward(self, x): class Attention (line 166) | class Attention(BaseModule): method __init__ (line 178) | def __init__(self, dim, num_heads, bias): method forward (line 194) | def forward(self, x): class TransformerBlock (line 234) | class TransformerBlock(BaseModule): method __init__ (line 248) | def __init__(self, dim, num_heads, ffn_expansion_factor, bias, method forward (line 257) | def forward(self, x): class OverlapPatchEmbed (line 272) | class OverlapPatchEmbed(BaseModule): method __init__ (line 281) | def __init__(self, in_c=3, embed_dim=48, bias=False): method forward (line 287) | def forward(self, x): class Downsample (line 301) | class Downsample(BaseModule): method __init__ (line 308) | def __init__(self, n_feat): method forward (line 320) | def forward(self, x): class Upsample (line 332) | class Upsample(BaseModule): method __init__ (line 339) | def __init__(self, n_feat): method forward (line 351) | def forward(self, x): class Restormer (line 364) | class Restormer(BaseModule): method __init__ (line 391) | def __init__(self, method forward (line 506) | def forward(self, inp_img): FILE: mmagic/models/editors/sagan/sagan.py class SAGAN (line 21) | class SAGAN(BaseConditionalGAN): method __init__ (line 52) | def __init__(self, method disc_loss (line 65) | def disc_loss(self, disc_pred_fake: Tensor, method gen_loss (line 92) | def gen_loss(self, disc_pred_fake: Tensor) -> Tuple[Tensor, dict]: method train_discriminator (line 112) | def train_discriminator(self, inputs: dict, data_samples: DataSample, method train_generator (line 146) | def train_generator(self, inputs: dict, data_samples: DataSample, FILE: mmagic/models/editors/sagan/sagan_discriminator.py class ProjDiscriminator (line 19) | class ProjDiscriminator(BaseModule): method __init__ (line 120) | def __init__(self, method forward (line 248) | def forward(self, x, label=None): method init_weights (line 273) | def init_weights(self, pretrained=None, strict=True): FILE: mmagic/models/editors/sagan/sagan_generator.py class SNGANGenerator (line 23) | class SNGANGenerator(BaseModule): method __init__ (line 122) | def __init__(self, method forward (line 240) | def forward(self, noise, num_batches=0, label=None, return_noise=False): method init_weights (line 320) | def init_weights(self, pretrained=None, strict=True): FILE: mmagic/models/editors/sagan/sagan_modules.py class SNGANGenResBlock (line 19) | class SNGANGenResBlock(BaseModule): method __init__ (line 68) | def __init__(self, method forward (line 144) | def forward(self, x, y=None): method forward_shortcut (line 169) | def forward_shortcut(self, x): method init_weights (line 185) | def init_weights(self): class SNGANDiscResBlock (line 216) | class SNGANDiscResBlock(BaseModule): method __init__ (line 247) | def __init__(self, method forward (line 302) | def forward(self, x): method forward_shortcut (line 322) | def forward_shortcut(self, x: Tensor) -> Tensor: method init_weights (line 338) | def init_weights(self): class SNGANDiscHeadResBlock (line 369) | class SNGANDiscHeadResBlock(BaseModule): method __init__ (line 398) | def __init__(self, method forward (line 445) | def forward(self, x: Tensor) -> Tensor: method forward_shortcut (line 462) | def forward_shortcut(self, x: Tensor) -> Tensor: method init_weights (line 475) | def init_weights(self): class SNConditionNorm (line 499) | class SNConditionNorm(BaseModule): method __init__ (line 538) | def __init__(self, method forward (line 599) | def forward(self, x, y=None): method init_weights (line 621) | def init_weights(self): FILE: mmagic/models/editors/singan/singan.py class SinGAN (line 28) | class SinGAN(BaseGAN): method __init__ (line 79) | def __init__(self, method load_test_pkl (line 111) | def load_test_pkl(self): method _from_numpy (line 123) | def _from_numpy(self, method get_module (line 146) | def get_module(self, model: nn.Module, module_name: str) -> nn.Module: method construct_fixed_noises (line 162) | def construct_fixed_noises(self): method forward (line 173) | def forward(self, method gen_loss (line 323) | def gen_loss(self, disc_pred_fake: Tensor, method disc_loss (line 348) | def disc_loss(self, disc_pred_fake: Tensor, disc_pred_real: Tensor, method train_generator (line 402) | def train_generator(self, inputs: dict, data_samples: List[DataSample], method train_discriminator (line 436) | def train_discriminator(self, inputs: dict, data_samples: List[DataSam... method train_gan (line 467) | def train_gan(self, inputs_dict: dict, data_sample: List[DataSample], method train_step (line 543) | def train_step(self, data: dict, method test_step (line 640) | def test_step(self, data: dict) -> SampleList: FILE: mmagic/models/editors/singan/singan_discriminator.py class SinGANMultiScaleDiscriminator (line 12) | class SinGANMultiScaleDiscriminator(BaseModule): method __init__ (line 36) | def __init__(self, method forward (line 63) | def forward(self, x, curr_scale): method check_and_load_prev_weight (line 77) | def check_and_load_prev_weight(self, curr_scale): FILE: mmagic/models/editors/singan/singan_generator.py class SinGANMultiScaleGenerator (line 17) | class SinGANMultiScaleGenerator(BaseModule): method __init__ (line 50) | def __init__(self, method forward (line 91) | def forward(self, method check_and_load_prev_weight (line 169) | def check_and_load_prev_weight(self, curr_scale): FILE: mmagic/models/editors/singan/singan_modules.py class GeneratorBlock (line 10) | class GeneratorBlock(nn.Module): method __init__ (line 36) | def __init__(self, method forward (line 94) | def forward(self, x, prev): method init_weights (line 114) | def init_weights(self, pretrained=None): class DiscriminatorBlock (line 129) | class DiscriminatorBlock(nn.Module): method __init__ (line 149) | def __init__(self, method forward (line 202) | def forward(self, x): method init_weights (line 218) | def init_weights(self, pretrained=None): FILE: mmagic/models/editors/srcnn/srcnn_net.py class SRCNNNet (line 9) | class SRCNNNet(BaseModule): method __init__ (line 27) | def __init__(self, method forward (line 61) | def forward(self, x): FILE: mmagic/models/editors/srgan/modified_vgg.py class ModifiedVGG (line 9) | class ModifiedVGG(BaseModule): method __init__ (line 20) | def __init__(self, in_channels, mid_channels): method forward (line 62) | def forward(self, x): FILE: mmagic/models/editors/srgan/sr_resnet.py class MSRResNet (line 11) | class MSRResNet(BaseModule): method __init__ (line 31) | def __init__(self, method forward (line 83) | def forward(self, x): method init_weights (line 107) | def init_weights(self): FILE: mmagic/models/editors/srgan/srgan.py class SRGAN (line 13) | class SRGAN(BaseEditModel): method __init__ (line 35) | def __init__(self, method forward_train (line 76) | def forward_train(self, inputs, data_samples=None, **kwargs): method forward_tensor (line 92) | def forward_tensor(self, inputs, data_samples=None, training=False): method if_run_g (line 110) | def if_run_g(self): method if_run_d (line 116) | def if_run_d(self): method g_step (line 121) | def g_step(self, batch_outputs: torch.Tensor, batch_gt_data: torch.Ten... method d_step_real (line 155) | def d_step_real(self, batch_outputs, batch_gt_data: torch.Tensor): method d_step_fake (line 173) | def d_step_fake(self, batch_outputs: torch.Tensor, batch_gt_data): method g_step_with_optim (line 191) | def g_step_with_optim(self, batch_outputs: torch.Tensor, method d_step_with_optim (line 216) | def d_step_with_optim(self, batch_outputs: torch.Tensor, method extract_gt_data (line 258) | def extract_gt_data(self, data_samples): method train_step (line 272) | def train_step(self, data: List[dict], FILE: mmagic/models/editors/stable_diffusion/clip_wrapper.py function cosine_distance (line 21) | def cosine_distance(image_embeds, text_embeds): class StableDiffusionSafetyChecker (line 28) | class StableDiffusionSafetyChecker(PreTrainedModel): method __init__ (line 32) | def __init__(self, config: CLIPConfig): method forward (line 59) | def forward(self, clip_input, images): function load_clip_submodels (line 141) | def load_clip_submodels(init_cfg, submodels, requires_safety_checker): function load_clip_submodels (line 185) | def load_clip_submodels(init_cfg, submodels, requires_safety_checker): FILE: mmagic/models/editors/stable_diffusion/stable_diffusion.py class StableDiffusion (line 29) | class StableDiffusion(BaseModel): method __init__ (line 60) | def __init__(self, method set_xformers (line 121) | def set_xformers(self, module: Optional[nn.Module] = None) -> nn.Module: method set_tomesd (line 133) | def set_tomesd(self) -> nn.Module: method device (line 143) | def device(self): method train (line 146) | def train(self, mode: bool = True): method infer (line 165) | def infer(self, method output_to_pil (line 323) | def output_to_pil(self, image) -> List[Image.Image]: method _encode_prompt (line 339) | def _encode_prompt(self, prompt, device, num_images_per_prompt, method decode_latents (line 458) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 476) | def prepare_extra_step_kwargs(self, generator, eta): method prepare_test_scheduler_extra_step_kwargs (line 506) | def prepare_test_scheduler_extra_step_kwargs(self, generator, eta): method check_inputs (line 536) | def check_inputs(self, prompt, height, width): method prepare_latents (line 547) | def prepare_latents(self, method val_step (line 591) | def val_step(self, data: dict) -> SampleList: method test_step (line 610) | def test_step(self, data: dict) -> SampleList: method train_step (line 626) | def train_step(self, data, optim_wrapper_dict): method forward (line 694) | def forward(self, FILE: mmagic/models/editors/stable_diffusion/stable_diffusion_inpaint.py class StableDiffusionInpaint (line 25) | class StableDiffusionInpaint(StableDiffusion): method __init__ (line 27) | def __init__(self, *args, **kwargs): method infer (line 38) | def infer(self, method prepare_mask_latents (line 252) | def prepare_mask_latents(self, mask, masked_image, batch_size, method val_step (line 325) | def val_step(self, data: dict) -> SampleList: method test_step (line 344) | def test_step(self, data: dict) -> SampleList: method train_step (line 362) | def train_step(self, data, optim_wrapper_dict): function prepare_mask_and_masked_image (line 377) | def prepare_mask_and_masked_image(image: torch.Tensor, FILE: mmagic/models/editors/stable_diffusion/vae.py class Downsample2D (line 17) | class Downsample2D(nn.Module): method __init__ (line 27) | def __init__(self, method forward (line 54) | def forward(self, hidden_states): class Upsample2D (line 67) | class Upsample2D(nn.Module): method __init__ (line 77) | def __init__(self, method forward (line 98) | def forward(self, hidden_states, output_size=None): class ResnetBlock2D (line 121) | class ResnetBlock2D(nn.Module): method __init__ (line 142) | def __init__( method forward (line 220) | def forward(self, input_tensor, temb): class AttentionBlock (line 261) | class AttentionBlock(nn.Module): method __init__ (line 280) | def __init__( method transpose_for_scores (line 307) | def transpose_for_scores(self, projection: torch.Tensor) -> torch.Tensor: method forward (line 316) | def forward(self, hidden_states): class UNetMidBlock2D (line 384) | class UNetMidBlock2D(nn.Module): method __init__ (line 409) | def __init__( method forward (line 473) | def forward(self, hidden_states, temb=None, encoder_states=None): class DownEncoderBlock2D (line 486) | class DownEncoderBlock2D(nn.Module): method __init__ (line 511) | def __init__( method forward (line 559) | def forward(self, hidden_states): class Encoder (line 571) | class Encoder(nn.Module): method __init__ (line 574) | def __init__( method forward (line 646) | def forward(self, x): class UpDecoderBlock2D (line 666) | class UpDecoderBlock2D(nn.Module): method __init__ (line 669) | def __init__( method forward (line 713) | def forward(self, hidden_states): class Decoder (line 725) | class Decoder(nn.Module): method __init__ (line 728) | def __init__( method forward (line 799) | def forward(self, z): class DiagonalGaussianDistribution (line 819) | class DiagonalGaussianDistribution(object): method __init__ (line 822) | def __init__(self, parameters, deterministic=False): method sample (line 835) | def sample(self, generator: Optional[torch.Generator] = None) \ method kl (line 848) | def kl(self, other=None): method nll (line 864) | def nll(self, sample, dims=[1, 2, 3]): method mode (line 874) | def mode(self): class AutoencoderKL (line 880) | class AutoencoderKL(nn.Module): method __init__ (line 905) | def __init__( method dtype (line 952) | def dtype(self): method encode (line 956) | def encode(self, x: torch.FloatTensor, return_dict: bool = True) -> Dict: method decode (line 967) | def decode(self, z: torch.FloatTensor, return_dict: bool = True) \ method forward (line 978) | def forward( FILE: mmagic/models/editors/stable_diffusion_xl/stable_diffusion_xl.py class StableDiffusionXL (line 30) | class StableDiffusionXL(BaseModel): method __init__ (line 79) | def __init__(self, method prepare_model (line 163) | def prepare_model(self): method set_lora (line 183) | def set_lora(self): method set_xformers (line 188) | def set_xformers(self, module: Optional[nn.Module] = None) -> nn.Module: method set_tomesd (line 200) | def set_tomesd(self) -> nn.Module: method device (line 210) | def device(self): method train (line 213) | def train(self, mode: bool = True): method infer (line 232) | def infer(self, method _get_add_time_ids (line 517) | def _get_add_time_ids(self, original_size: Optional[Tuple[int, int]], method output_to_pil (line 563) | def output_to_pil(self, image) -> List[Image.Image]: method _encode_prompt (line 579) | def _encode_prompt(self, prompt, prompt_2, device, num_images_per_prompt, method decode_latents (line 736) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 754) | def prepare_extra_step_kwargs(self, generator, eta): method prepare_test_scheduler_extra_step_kwargs (line 784) | def prepare_test_scheduler_extra_step_kwargs(self, generator, eta): method check_inputs (line 814) | def check_inputs(self, prompt, height, width): method prepare_latents (line 825) | def prepare_latents(self, method val_step (line 869) | def val_step(self, data: dict) -> SampleList: method test_step (line 905) | def test_step(self, data: dict) -> SampleList: method encode_prompt_train (line 940) | def encode_prompt_train(self, text_one, text_two): method train_step (line 974) | def train_step(self, data: List[dict], optim_wrapper: OptimWrapperDict): method forward (line 1065) | def forward(self, FILE: mmagic/models/editors/stylegan1/stylegan1.py class StyleGAN1 (line 21) | class StyleGAN1(ProgressiveGrowingGAN): method __init__ (line 56) | def __init__(self, method disc_loss (line 87) | def disc_loss(self, disc_pred_fake: Tensor, disc_pred_real: Tensor, method gen_loss (line 140) | def gen_loss(self, disc_pred_fake: Tensor) -> Tuple[Tensor, dict]: FILE: mmagic/models/editors/stylegan1/stylegan1_discriminator.py class StyleGAN1Discriminator (line 15) | class StyleGAN1Discriminator(BaseModule): method __init__ (line 30) | def __init__(self, method forward (line 121) | def forward(self, input, transition_weight=1., curr_scale=-1): FILE: mmagic/models/editors/stylegan1/stylegan1_generator.py class StyleGAN1Generator (line 20) | class StyleGAN1Generator(BaseModule): method __init__ (line 46) | def __init__(self, method train (line 124) | def train(self, mode=True): method make_injected_noise (line 139) | def make_injected_noise(self): method get_mean_latent (line 156) | def get_mean_latent(self, num_samples=4096, **kwargs): method style_mixing (line 168) | def style_mixing(self, method forward (line 187) | def forward(self, FILE: mmagic/models/editors/stylegan1/stylegan1_modules.py class EqualLinearActModule (line 17) | class EqualLinearActModule(BaseModule): method __init__ (line 34) | def __init__(self, method forward (line 71) | def forward(self, x): class NoiseInjection (line 96) | class NoiseInjection(BaseModule): method __init__ (line 109) | def __init__(self, noise_weight_init=0., fixed_noise=False): method forward (line 114) | def forward(self, image, noise=None, return_noise=False): class ConstantInput (line 141) | class ConstantInput(BaseModule): method __init__ (line 153) | def __init__(self, channel, size=4): method forward (line 166) | def forward(self, x): function make_kernel (line 181) | def make_kernel(k): class Blur (line 191) | class Blur(BaseModule): method __init__ (line 202) | def __init__(self, kernel, pad, upsample_factor=1): method forward (line 212) | def forward(self, x): class AdaptiveInstanceNorm (line 226) | class AdaptiveInstanceNorm(BaseModule): method __init__ (line 236) | def __init__(self, in_channel, style_dim): method forward (line 245) | def forward(self, input, style): class StyleConv (line 264) | class StyleConv(BaseModule): method __init__ (line 266) | def __init__(self, method forward (line 343) | def forward(self, FILE: mmagic/models/editors/stylegan1/stylegan_utils.py function get_mean_latent (line 8) | def get_mean_latent(generator, num_samples=4096, bs_per_repeat=1024): function style_mixing (line 40) | def style_mixing(generator, FILE: mmagic/models/editors/stylegan2/ada/augment.py function matrix (line 113) | def matrix(*rows, device=None): function translate2d (line 136) | def translate2d(tx, ty, **kwargs): function translate3d (line 149) | def translate3d(tx, ty, tz, **kwargs): function scale2d (line 164) | def scale2d(sx, sy, **kwargs): function scale3d (line 177) | def scale3d(sx, sy, sz, **kwargs): function rotate2d (line 192) | def rotate2d(theta, **kwargs): function rotate3d (line 205) | def rotate3d(v, theta, **kwargs): function translate2d_inv (line 228) | def translate2d_inv(tx, ty, **kwargs): function scale2d_inv (line 241) | def scale2d_inv(sx, sy, **kwargs): function rotate2d_inv (line 254) | def rotate2d_inv(theta, **kwargs): class AugmentPipe (line 274) | class AugmentPipe(torch.nn.Module): method __init__ (line 282) | def __init__( method forward (line 403) | def forward(self, images, debug_percentile=None): FILE: mmagic/models/editors/stylegan2/ada/grid_sample_gradfix.py function grid_sample (line 30) | def grid_sample(input, grid): function _should_use_custom_op (line 44) | def _should_use_custom_op(): class _GridSample2dForward (line 60) | class _GridSample2dForward(torch.autograd.Function): method forward (line 63) | def forward(ctx, input, grid): method backward (line 76) | def backward(ctx, grad_output): class _GridSample2dBackward (line 86) | class _GridSample2dBackward(torch.autograd.Function): method forward (line 89) | def forward(ctx, grad_output, input, grid): method backward (line 96) | def backward(ctx, grad2_grad_input, grad2_grad_grid): FILE: mmagic/models/editors/stylegan2/ada/misc.py function constant (line 11) | def constant(value, shape=None, dtype=None, device=None, memory_format=N... FILE: mmagic/models/editors/stylegan2/ada/upfirdn2d.py function _parse_scaling (line 12) | def _parse_scaling(scaling): function _parse_padding (line 22) | def _parse_padding(padding): function _get_filter_size (line 34) | def _get_filter_size(f): function upsample2d (line 46) | def upsample2d(x, f, up=2, padding=0, flip_filter=False, gain=1, impl='c... function setup_filter (line 96) | def setup_filter(f, function downsample2d (line 146) | def downsample2d(x, FILE: mmagic/models/editors/stylegan2/stylegan2.py class StyleGAN2 (line 23) | class StyleGAN2(BaseGAN): method __init__ (line 47) | def __init__(self, method disc_loss (line 105) | def disc_loss(self, disc_pred_fake: Tensor, disc_pred_real: Tensor, method gen_loss (line 139) | def gen_loss(self, disc_pred_fake: Tensor, batch_size: int) -> Tuple: method train_discriminator (line 169) | def train_discriminator(self, inputs: dict, data_samples: DataSample, method train_generator (line 201) | def train_generator(self, inputs: dict, data_samples: DataSample, method train_step (line 226) | def train_step(self, data: dict, FILE: mmagic/models/editors/stylegan2/stylegan2_discriminator.py class StyleGAN2Discriminator (line 23) | class StyleGAN2Discriminator(BaseModule): method __init__ (line 97) | def __init__(self, method _load_pretrained_model (line 194) | def _load_pretrained_model(self, method forward (line 204) | def forward(self, x: Tensor, label: Optional[Tensor] = None): class ADAStyleGAN2Discriminator (line 246) | class ADAStyleGAN2Discriminator(StyleGAN2Discriminator): method __init__ (line 248) | def __init__(self, in_size, *args, data_aug=None, **kwargs): method forward (line 263) | def forward(self, x): class ADAAug (line 271) | class ADAAug(BaseModule): method __init__ (line 285) | def __init__(self, method update (line 303) | def update(self, iteration=0, num_batches=0): FILE: mmagic/models/editors/stylegan2/stylegan2_generator.py class StyleGAN2Generator (line 22) | class StyleGAN2Generator(BaseModule): method __init__ (line 103) | def __init__(self, method _load_pretrained_model (line 268) | def _load_pretrained_model(self, method train (line 278) | def train(self, mode=True): method make_injected_noise (line 293) | def make_injected_noise(self): method get_mean_latent (line 309) | def get_mean_latent(self, num_samples=4096, **kwargs): method style_mixing (line 324) | def style_mixing(self, method forward (line 340) | def forward(self, FILE: mmagic/models/editors/stylegan2/stylegan2_modules.py class _FusedBiasLeakyReLU (line 27) | class _FusedBiasLeakyReLU(FusedBiasLeakyReLU): method forward (line 30) | def forward(self, x): class UpsampleUpFIRDn (line 43) | class UpsampleUpFIRDn(BaseModule): method __init__ (line 54) | def __init__(self, kernel, factor=2): method forward (line 68) | def forward(self, x): class DownsampleUpFIRDn (line 87) | class DownsampleUpFIRDn(BaseModule): method __init__ (line 97) | def __init__(self, kernel, factor=2): method forward (line 111) | def forward(self, input): class ModulatedConv2d (line 130) | class ModulatedConv2d(BaseModule): method __init__ (line 160) | def __init__( method forward (line 227) | def forward(self, x, style, input_gain=None): class ModulatedStyleConv (line 288) | class ModulatedStyleConv(BaseModule): method __init__ (line 319) | def __init__(self, method forward (line 353) | def forward(self, class ModulatedToRGB (line 396) | class ModulatedToRGB(BaseModule): method __init__ (line 421) | def __init__(self, method forward (line 457) | def forward(self, x, style, skip=None): class ConvDownLayer (line 486) | class ConvDownLayer(nn.Sequential): method __init__ (line 506) | def __init__(self, method forward (line 558) | def forward(self, x): class ResBlock (line 566) | class ResBlock(BaseModule): method __init__ (line 581) | def __init__(self, method forward (line 616) | def forward(self, input): class ModMBStddevLayer (line 640) | class ModMBStddevLayer(BaseModule): method __init__ (line 664) | def __init__(self, method forward (line 682) | def forward(self, x): FILE: mmagic/models/editors/stylegan3/stylegan3.py class StyleGAN3 (line 25) | class StyleGAN3(StyleGAN2): method __init__ (line 37) | def __init__(self, method test_step (line 58) | def test_step(self, data: dict) -> SampleList: method val_step (line 82) | def val_step(self, data: dict) -> SampleList: method train_discriminator (line 106) | def train_discriminator(self, inputs: dict, data_samples: DataSample, method train_generator (line 139) | def train_generator(self, inputs: dict, data_samples: DataSample, method sample_equivarience_pairs (line 165) | def sample_equivarience_pairs(self, FILE: mmagic/models/editors/stylegan3/stylegan3_generator.py class StyleGAN3Generator (line 16) | class StyleGAN3Generator(BaseModule): method __init__ (line 46) | def __init__(self, method _load_pretrained_model (line 78) | def _load_pretrained_model(self, method forward (line 88) | def forward(self, method get_mean_latent (line 169) | def get_mean_latent(self, num_samples=4096, **kwargs): method get_training_kwargs (line 183) | def get_training_kwargs(self, phase): FILE: mmagic/models/editors/stylegan3/stylegan3_modules.py function modulated_conv2d (line 21) | def modulated_conv2d( class FullyConnectedLayer (line 76) | class FullyConnectedLayer(BaseModule): method __init__ (line 93) | def __init__(self, method forward (line 115) | def forward(self, x): class MappingNetwork (line 132) | class MappingNetwork(BaseModule): method __init__ (line 153) | def __init__(self, method forward (line 189) | def forward(self, class SynthesisInput (line 251) | class SynthesisInput(BaseModule): method __init__ (line 262) | def __init__(self, style_channels, channels, size, sampling_rate, method forward (line 288) | def forward(self, w): class SynthesisLayer (line 351) | class SynthesisLayer(BaseModule): method __init__ (line 388) | def __init__( method forward (line 493) | def forward(self, x, w, force_fp32=False, update_emas=False): method design_lowpass_filter (line 556) | def design_lowpass_filter(numtaps, cutoff, width, fs, radial=False): class SynthesisNetwork (line 596) | class SynthesisNetwork(BaseModule): method __init__ (line 625) | def __init__( method forward (line 710) | def forward(self, ws, **layer_kwargs): FILE: mmagic/models/editors/stylegan3/stylegan3_utils.py function apply_integer_translation (line 15) | def apply_integer_translation(x, tx, ty): function sinc (line 31) | def sinc(x): function apply_fractional_translation (line 37) | def apply_fractional_translation(x, tx, ty, a=3): function rotation_matrix (line 74) | def rotation_matrix(angle): function lanczos_window (line 84) | def lanczos_window(x, a): function construct_affine_bandlimit_filter (line 89) | def construct_affine_bandlimit_filter(mat, function apply_affine_transformation (line 129) | def apply_affine_transformation(x, mat, up=4, **filter_kwargs): function apply_fractional_rotation (line 162) | def apply_fractional_rotation(x, angle, a=3, **filter_kwargs): function apply_fractional_pseudo_rotation (line 169) | def apply_fractional_pseudo_rotation(x, angle, a=3, **filter_kwargs): FILE: mmagic/models/editors/swinir/swinir_modules.py class PatchEmbed (line 9) | class PatchEmbed(nn.Module): method __init__ (line 20) | def __init__(self, method forward (line 45) | def forward(self, x): class PatchUnEmbed (line 60) | class PatchUnEmbed(nn.Module): method __init__ (line 71) | def __init__(self, method forward (line 91) | def forward(self, x, x_size): class Upsample (line 107) | class Upsample(nn.Sequential): method __init__ (line 115) | def __init__(self, scale, num_feat): class UpsampleOneStep (line 130) | class UpsampleOneStep(nn.Sequential): method __init__ (line 142) | def __init__(self, scale, num_feat, num_out_ch, input_resolution=None): FILE: mmagic/models/editors/swinir/swinir_net.py class SwinIRNet (line 14) | class SwinIRNet(BaseModule): method __init__ (line 55) | def __init__(self, method _init_weights (line 202) | def _init_weights(self, m): method no_weight_decay (line 212) | def no_weight_decay(self): method no_weight_decay_keywords (line 216) | def no_weight_decay_keywords(self): method check_image_size (line 219) | def check_image_size(self, x): method forward_features (line 234) | def forward_features(self, x): method forward (line 257) | def forward(self, x): FILE: mmagic/models/editors/swinir/swinir_rstb.py class DropPath (line 13) | class DropPath(nn.Module): method __init__ (line 17) | def __init__(self, drop_prob: float = 0., scale_by_keep: bool = True): method forward (line 22) | def forward(self, x): method extra_repr (line 33) | def extra_repr(self): class Mlp (line 37) | class Mlp(nn.Module): method __init__ (line 50) | def __init__(self, method forward (line 64) | def forward(self, x): class WindowAttention (line 81) | class WindowAttention(nn.Module): method __init__ (line 98) | def __init__(self, method forward (line 147) | def forward(self, x, mask=None): method extra_repr (line 188) | def extra_repr(self) -> str: class SwinTransformerBlock (line 193) | class SwinTransformerBlock(nn.Module): method __init__ (line 214) | def __init__(self, method calculate_mask (line 270) | def calculate_mask(self, x_size): method forward (line 305) | def forward(self, x, x_size): method extra_repr (line 368) | def extra_repr(self) -> str: class BasicLayer (line 377) | class BasicLayer(nn.Module): method __init__ (line 403) | def __init__(self, method forward (line 450) | def forward(self, x, x_size): method extra_repr (line 469) | def extra_repr(self) -> str: class RSTB (line 475) | class RSTB(nn.Module): method __init__ (line 506) | def __init__(self, method forward (line 570) | def forward(self, x, x_size): FILE: mmagic/models/editors/swinir/swinir_utils.py function _ntuple (line 7) | def _ntuple(n): function drop_path (line 27) | def drop_path(x, function window_partition (line 54) | def window_partition(x, window_size): function window_reverse (line 70) | def window_reverse(windows, window_size, H, W): FILE: mmagic/models/editors/tdan/tdan.py class TDAN (line 7) | class TDAN(BaseEditModel): method __init__ (line 26) | def __init__(self, method forward_train (line 44) | def forward_train(self, inputs, data_samples=None, **kwargs): method forward_tensor (line 73) | def forward_tensor(self, FILE: mmagic/models/editors/tdan/tdan_net.py class TDANNet (line 16) | class TDANNet(BaseModule): method __init__ (line 36) | def __init__(self, method forward (line 74) | def forward(self, lrs): class AugmentedDeformConv2dPack (line 110) | class AugmentedDeformConv2dPack(DeformConv2d): method __init__ (line 134) | def __init__(self, *args, **kwargs): method init_offset (line 147) | def init_offset(self): method forward (line 151) | def forward(self, x, extra_feat): FILE: mmagic/models/editors/textual_inversion/textual_inversion.py class TextualInversion (line 20) | class TextualInversion(StableDiffusion): method __init__ (line 61) | def __init__(self, method prepare_models (line 91) | def prepare_models(self): method val_step (line 98) | def val_step(self, data: dict) -> SampleList: method test_step (line 134) | def test_step(self, data: dict) -> SampleList: method add_tokens (line 168) | def add_tokens(self, method train_step (line 200) | def train_step(self, data, optim_wrapper): FILE: mmagic/models/editors/tof/tof_vfi_net.py class TOFlowVFINet (line 15) | class TOFlowVFINet(BaseModule): method __init__ (line 34) | def __init__(self, method forward (line 51) | def forward(self, imgs): class BasicModule (line 72) | class BasicModule(nn.Module): method __init__ (line 82) | def __init__(self, norm_cfg): method forward (line 127) | def forward(self, tensor_input): class SPyNet (line 140) | class SPyNet(nn.Module): method __init__ (line 158) | def __init__(self, norm_cfg, pretrained=None): method forward (line 171) | def forward(self, ref, supp): class ToFResBlock (line 222) | class ToFResBlock(nn.Module): method __init__ (line 228) | def __init__(self): method forward (line 238) | def forward(self, frames): FILE: mmagic/models/editors/tof/tof_vsr_net.py class TOFlowVSRNet (line 13) | class TOFlowVSRNet(BaseModule): method __init__ (line 31) | def __init__(self, adapt_official_weights=False, init_cfg=None): method forward (line 49) | def forward(self, lrs): class BasicModule (line 84) | class BasicModule(nn.Module): method __init__ (line 91) | def __init__(self): method forward (line 136) | def forward(self, tensor_input): class SPyNet (line 149) | class SPyNet(nn.Module): method __init__ (line 163) | def __init__(self): method forward (line 168) | def forward(self, ref, supp): FILE: mmagic/models/editors/ttsr/lte.py class LTE (line 11) | class LTE(BaseModule): method __init__ (line 27) | def __init__(self, method forward (line 63) | def forward(self, x): FILE: mmagic/models/editors/ttsr/search_transformer.py class SearchTransformer (line 10) | class SearchTransformer(BaseModule): method gather (line 16) | def gather(self, inputs, dim, index): method forward (line 38) | def forward(self, img_lq, ref_lq, refs): FILE: mmagic/models/editors/ttsr/ttsr.py class TTSR (line 14) | class TTSR(SRGAN): method __init__ (line 37) | def __init__(self, method forward_tensor (line 76) | def forward_tensor(self, inputs, data_samples=None, training=False): method if_run_g (line 112) | def if_run_g(self): method if_run_d (line 117) | def if_run_d(self): method g_step (line 122) | def g_step(self, batch_outputs, batch_gt_data: DataSample): method g_step_with_optim (line 167) | def g_step_with_optim(self, batch_outputs: torch.Tensor, method train_step (line 199) | def train_step(self, data: List[dict], FILE: mmagic/models/editors/ttsr/ttsr_disc.py class TTSRDiscriminator (line 9) | class TTSRDiscriminator(BaseModule): method __init__ (line 18) | def __init__(self, in_channels=3, in_size=160, init_cfg=None): method forward (line 37) | def forward(self, x): FILE: mmagic/models/editors/ttsr/ttsr_net.py class TTSRNet (line 21) | class TTSRNet(BaseModule): method __init__ (line 43) | def __init__(self, method forward (line 132) | def forward(self, x, soft_attention, textures): class SFE (line 224) | class SFE(nn.Module): method __init__ (line 237) | def __init__(self, in_channels, mid_channels, num_blocks, res_scale): method forward (line 251) | def forward(self, x): class CSFI2 (line 268) | class CSFI2(nn.Module): method __init__ (line 282) | def __init__(self, mid_channels): method forward (line 290) | def forward(self, x1, x2): class CSFI3 (line 313) | class CSFI3(nn.Module): method __init__ (line 327) | def __init__(self, mid_channels): method forward (line 343) | def forward(self, x1, x2, x4): class MergeFeatures (line 380) | class MergeFeatures(nn.Module): method __init__ (line 390) | def __init__(self, mid_channels, out_channels): method forward (line 398) | def forward(self, x1, x2, x4): FILE: mmagic/models/editors/vico/vico.py class ViCo (line 22) | class ViCo(StableDiffusion): method __init__ (line 64) | def __init__(self, method prepare_models (line 107) | def prepare_models(self): method set_vico (line 118) | def set_vico(self, have_image_cross_attention: List[int]): method set_only_imca_trainable (line 122) | def set_only_imca_trainable(self): method add_tokens (line 132) | def add_tokens(self, method val_step (line 165) | def val_step(self, data: dict) -> SampleList: method test_step (line 196) | def test_step(self, data: dict) -> SampleList: method prepare_reference (line 227) | def prepare_reference(self, method train_step (line 246) | def train_step(self, data, optim_wrapper): method infer (line 332) | def infer(self, method forward (line 538) | def forward(self, FILE: mmagic/models/editors/vico/vico_utils.py class ViCoCrossAttnProcessor (line 14) | class ViCoCrossAttnProcessor: method __call__ (line 17) | def __call__(self, function replace_cross_attention (line 61) | def replace_cross_attention(unet): class ViCoTransformer2DModelOutput (line 70) | class ViCoTransformer2DModelOutput(BaseOutput): function otsu (line 76) | def otsu(mask_in): class ViCoTransformer2D (line 115) | class ViCoTransformer2D(nn.Module): method __init__ (line 118) | def __init__(self, org_transformer2d: Transformer2DModel, method forward (line 151) | def forward( function replace_transformer2d (line 298) | def replace_transformer2d(module: nn.Module, class ViCoBlockWrapper (line 315) | class ViCoBlockWrapper(nn.Module): method apply_to (line 318) | def apply_to(self, org_module): class ViCoCrossAttnDownBlock2D (line 323) | class ViCoCrossAttnDownBlock2D(ViCoBlockWrapper): method forward (line 325) | def forward( class ViCoUNetMidBlock2DCrossAttn (line 417) | class ViCoUNetMidBlock2DCrossAttn(ViCoBlockWrapper): method forward (line 419) | def forward( class ViCoCrossAttnUpBlock2D (line 465) | class ViCoCrossAttnUpBlock2D(ViCoBlockWrapper): method forward (line 467) | def forward( class ViCoUNet2DConditionOutput (line 570) | class ViCoUNet2DConditionOutput(BaseOutput): class ViCoUNet2DConditionModel (line 576) | class ViCoUNet2DConditionModel(ViCoBlockWrapper): method forward (line 579) | def forward( function set_vico_modules (line 830) | def set_vico_modules(unet, image_cross_layers): FILE: mmagic/models/editors/wgan_gp/wgan_discriminator.py class WGANGPDiscriminator (line 14) | class WGANGPDiscriminator(BaseModule): method __init__ (line 54) | def __init__(self, method forward (line 99) | def forward(self, x): FILE: mmagic/models/editors/wgan_gp/wgan_generator.py class WGANGPGenerator (line 16) | class WGANGPGenerator(BaseModule): method __init__ (line 59) | def __init__(self, method forward (line 98) | def forward(self, noise, num_batches=0, return_noise=False): FILE: mmagic/models/editors/wgan_gp/wgan_gp.py class WGANGP (line 15) | class WGANGP(BaseGAN): method __init__ (line 26) | def __init__(self, *args, **kwargs): method disc_loss (line 32) | def disc_loss(self, real_data: Tensor, fake_data: Tensor, method gen_loss (line 61) | def gen_loss(self, disc_pred_fake: Tensor) -> Tuple: method train_discriminator (line 76) | def train_discriminator(self, inputs: dict, data_samples: DataSample, method train_generator (line 106) | def train_generator(self, inputs: dict, data_samples: DataSample, FILE: mmagic/models/editors/wgan_gp/wgan_gp_module.py class WGANNoiseTo2DFeat (line 13) | class WGANNoiseTo2DFeat(nn.Module): method __init__ (line 30) | def __init__(self, method forward (line 59) | def forward(self, x): method _init_weight (line 82) | def _init_weight(self): class WGANDecisionHead (line 91) | class WGANDecisionHead(nn.Module): method __init__ (line 109) | def __init__(self, method forward (line 141) | def forward(self, x): method _init_weight (line 157) | def _init_weight(self): class ConvLNModule (line 164) | class ConvLNModule(ConvModule): method __init__ (line 176) | def __init__(self, *args, feature_shape=None, **kwargs): FILE: mmagic/models/losses/adv_loss.py class ImagePool (line 12) | class ImagePool: method __init__ (line 15) | def __init__(self, pool_size): method add (line 22) | def add(self, images): method query (line 34) | def query(self): class DiscLoss (line 42) | class DiscLoss(nn.Module): method name (line 45) | def name(self): method __init__ (line 49) | def __init__(self, gan_type='vanilla'): method forward (line 54) | def forward(self, net, fakeB, realB, model='discriminator'): class RelativisticDiscLoss (line 72) | class RelativisticDiscLoss(nn.Module): method name (line 75) | def name(self): method __init__ (line 79) | def __init__(self): method forward (line 86) | def forward(self, net, fakeB, realB, model='discriminator'): class RelativisticDiscLossLS (line 118) | class RelativisticDiscLossLS(nn.Module): method name (line 121) | def name(self): method __init__ (line 125) | def __init__(self): method forward (line 132) | def forward(self, net, fakeB, realB, model='discriminator'): class DiscLossWGANGP (line 164) | class DiscLossWGANGP(DiscLoss): method name (line 167) | def name(self): method __init__ (line 171) | def __init__(self): method forward (line 175) | def forward(self, net, fakeB, realB, model='discriminator'): class AdvLoss (line 195) | class AdvLoss: method __new__ (line 203) | def __new__(cls, loss_type: str): FILE: mmagic/models/losses/clip_loss.py class CLIPLossModel (line 13) | class CLIPLossModel(torch.nn.Module): method __init__ (line 29) | def __init__(self, method forward (line 48) | def forward(self, image: torch.Tensor, text: torch.Tensor) -> torch.Te... class CLIPLoss (line 58) | class CLIPLoss(nn.Module): method __init__ (line 89) | def __init__(self, method forward (line 101) | def forward(self, image: torch.Tensor, text: torch.Tensor) -> torch.Te... FILE: mmagic/models/losses/composition_loss.py class L1CompositionLoss (line 14) | class L1CompositionLoss(nn.Module): method __init__ (line 28) | def __init__(self, method forward (line 41) | def forward(self, class MSECompositionLoss (line 70) | class MSECompositionLoss(nn.Module): method __init__ (line 84) | def __init__(self, method forward (line 97) | def forward(self, class CharbonnierCompLoss (line 126) | class CharbonnierCompLoss(nn.Module): method __init__ (line 142) | def __init__(self, method forward (line 157) | def forward(self, FILE: mmagic/models/losses/face_id_loss.py class FaceIdLoss (line 11) | class FaceIdLoss(nn.Module): method __init__ (line 42) | def __init__(self, method forward (line 54) | def forward(self, pred: torch.Tensor, gt: torch.Tensor) -> torch.Tensor: FILE: mmagic/models/losses/feature_loss.py class LightCNNFeature (line 14) | class LightCNNFeature(nn.Module): method __init__ (line 20) | def __init__(self) -> None: method forward (line 27) | def forward(self, x: torch.Tensor) -> torch.Tensor: method init_weights (line 39) | def init_weights(self, class LightCNNFeatureLoss (line 59) | class LightCNNFeatureLoss(nn.Module): method __init__ (line 69) | def __init__(self, method forward (line 89) | def forward(self, pred: torch.Tensor, gt: torch.Tensor) -> torch.Tensor: FILE: mmagic/models/losses/gan_loss.py class GANLoss (line 18) | class GANLoss(nn.Module): method __init__ (line 30) | def __init__(self, method _wgan_loss (line 57) | def _wgan_loss(self, input: torch.Tensor, target: bool) -> torch.Tensor: method get_target_label (line 70) | def get_target_label(self, input: torch.Tensor, method forward (line 89) | def forward(self, class GaussianBlur (line 149) | class GaussianBlur(nn.Module): method __init__ (line 170) | def __init__( method compute_zero_padding (line 182) | def compute_zero_padding(kernel_size: Tuple[int, int]) -> tuple: method get_2d_gaussian_kernel (line 196) | def get_2d_gaussian_kernel(self, kernel_size: Tuple[int, int], method get_1d_gaussian_kernel (line 231) | def get_1d_gaussian_kernel(self, kernel_size: int, method gaussian (line 255) | def gaussian(self, kernel_size: int, sigma: float) -> torch.Tensor: method forward (line 276) | def forward(self, x: torch.Tensor) -> torch.Tensor: function gradient_penalty_loss (line 299) | def gradient_penalty_loss(discriminator: nn.Module, class GradientPenaltyLoss (line 351) | class GradientPenaltyLoss(nn.Module): method __init__ (line 358) | def __init__(self, loss_weight: float = 1.) -> None: method forward (line 362) | def forward(self, function disc_shift_loss (line 384) | def disc_shift_loss(pred: torch.Tensor) -> torch.Tensor: class DiscShiftLoss (line 399) | class DiscShiftLoss(nn.Module): method __init__ (line 406) | def __init__(self, loss_weight: float = 0.1) -> None: method forward (line 410) | def forward(self, x: torch.Tensor) -> torch.Tensor: function r1_gradient_penalty_loss (line 424) | def r1_gradient_penalty_loss(discriminator: nn.Module, function gen_path_regularizer (line 495) | def gen_path_regularizer(generator: nn.Module, FILE: mmagic/models/losses/gradient_loss.py class GradientLoss (line 15) | class GradientLoss(nn.Module): method __init__ (line 24) | def __init__(self, method forward (line 34) | def forward(self, FILE: mmagic/models/losses/loss_comps/clip_loss_comps.py class CLIPLossComps (line 12) | class CLIPLossComps(nn.Module): method __init__ (line 43) | def __init__(self, method forward (line 55) | def forward(self, *args, **kwargs) -> torch.Tensor: method loss_name (line 94) | def loss_name() -> str: FILE: mmagic/models/losses/loss_comps/disc_auxiliary_loss_comps.py class DiscShiftLossComps (line 13) | class DiscShiftLossComps(nn.Module): method __init__ (line 68) | def __init__(self, method forward (line 77) | def forward(self, *args, **kwargs) -> torch.Tensor: method loss_name (line 118) | def loss_name(self) -> str: class GradientPenaltyLossComps (line 134) | class GradientPenaltyLossComps(nn.Module): method __init__ (line 192) | def __init__(self, method forward (line 203) | def forward(self, *args, **kwargs) -> torch.Tensor: method loss_name (line 250) | def loss_name(self) -> str: class R1GradientPenaltyComps (line 266) | class R1GradientPenaltyComps(nn.Module): method __init__ (line 326) | def __init__(self, method forward (line 341) | def forward(self, *args, **kwargs) -> torch.Tensor: method loss_name (line 391) | def loss_name(self) -> str: FILE: mmagic/models/losses/loss_comps/face_id_loss_comps.py class FaceIdLossComps (line 11) | class FaceIdLossComps(nn.Module): method __init__ (line 42) | def __init__(self, method forward (line 54) | def forward(self, *args, **kwargs) -> torch.Tensor: method loss_name (line 94) | def loss_name(self) -> str: FILE: mmagic/models/losses/loss_comps/gan_loss_comps.py class GANLossComps (line 12) | class GANLossComps(nn.Module): method __init__ (line 25) | def __init__(self, method _wgan_loss (line 50) | def _wgan_loss(self, input: torch.Tensor, target: bool) -> torch.Tensor: method _wgan_logistic_ns_loss (line 62) | def _wgan_logistic_ns_loss(self, input: torch.Tensor, method get_target_label (line 79) | def get_target_label(self, input: torch.Tensor, method forward (line 98) | def forward(self, FILE: mmagic/models/losses/loss_comps/gen_auxiliary_loss_comps.py class GeneratorPathRegularizerComps (line 12) | class GeneratorPathRegularizerComps(nn.Module): method __init__ (line 78) | def __init__(self, method forward (line 101) | def forward(self, *args, **kwargs) -> torch.Tensor: method loss_name (line 160) | def loss_name(self) -> str: FILE: mmagic/models/losses/loss_wrapper.py function reduce_loss (line 9) | def reduce_loss(loss: torch.Tensor, reduction: str) -> torch.Tensor: function mask_reduce_loss (line 30) | def mask_reduce_loss(loss: torch.Tensor, function masked_loss (line 78) | def masked_loss(loss_func): FILE: mmagic/models/losses/perceptual_loss.py class PerceptualVGG (line 14) | class PerceptualVGG(nn.Module): method __init__ (line 34) | def __init__(self, method forward (line 67) | def forward(self, x: torch.Tensor) -> torch.Tensor: method init_weights (line 87) | def init_weights(self, model: nn.Module, pretrained: str) -> None: class PerceptualLoss (line 99) | class PerceptualLoss(nn.Module): method __init__ (line 130) | def __init__(self, method forward (line 174) | def forward(self, x: torch.Tensor, method _gram_mat (line 221) | def _gram_mat(self, x: torch.Tensor) -> torch.Tensor: class TransferalPerceptualLoss (line 238) | class TransferalPerceptualLoss(nn.Module): method __init__ (line 248) | def __init__(self, method forward (line 264) | def forward(self, maps: Tuple[torch.Tensor], soft_attention: torch.Ten... FILE: mmagic/models/losses/pixelwise_loss.py function l1_loss (line 15) | def l1_loss(pred: torch.Tensor, target: torch.Tensor) -> torch.Tensor: function mse_loss (line 29) | def mse_loss(pred: torch.Tensor, target: torch.Tensor) -> torch.Tensor: function charbonnier_loss (line 43) | def charbonnier_loss(pred: torch.Tensor, function tv_loss (line 60) | def tv_loss(input: torch.Tensor) -> torch.Tensor: class L1Loss (line 69) | class L1Loss(nn.Module): method __init__ (line 83) | def __init__(self, method forward (line 96) | def forward(self, class MSELoss (line 118) | class MSELoss(nn.Module): method __init__ (line 132) | def __init__(self, method forward (line 145) | def forward(self, class CharbonnierLoss (line 167) | class CharbonnierLoss(nn.Module): method __init__ (line 187) | def __init__(self, method forward (line 202) | def forward(self, class MaskedTVLoss (line 225) | class MaskedTVLoss(L1Loss): method __init__ (line 232) | def __init__(self, loss_weight: float = 1.0) -> None: method forward (line 235) | def forward(self, class PSNRLoss (line 259) | class PSNRLoss(nn.Module): method __init__ (line 269) | def __init__(self, loss_weight: float = 1.0, toY: bool = False) -> None: method forward (line 278) | def forward(self, pred: torch.Tensor, FILE: mmagic/models/utils/bbox_utils.py function extract_bbox_patch (line 6) | def extract_bbox_patch(bbox, img, channel_first=True): function scale_bbox (line 58) | def scale_bbox(bbox, target_size): function extract_around_bbox (line 105) | def extract_around_bbox(img, bbox, target_size, channel_first=True): FILE: mmagic/models/utils/diffusion_utils.py function betas_for_alpha_bar (line 7) | def betas_for_alpha_bar(num_diffusion_timesteps, max_beta=0.999): FILE: mmagic/models/utils/flow_warp.py function flow_warp (line 6) | def flow_warp(x, FILE: mmagic/models/utils/model_utils.py function default_init_weights (line 22) | def default_init_weights(module, scale=1): function make_layer (line 41) | def make_layer(block, num_blocks, **kwarg): function get_module_device (line 57) | def get_module_device(module): function set_requires_grad (line 77) | def set_requires_grad(nets, requires_grad=False): function generation_init_weights (line 93) | def generation_init_weights(module, init_type='normal', init_gain=0.02): function get_valid_noise_size (line 149) | def get_valid_noise_size(noise_size: Optional[int], function get_valid_num_batches (line 179) | def get_valid_num_batches(batch_inputs: Optional[ForwardInputs] = None, function build_module (line 249) | def build_module(module: Union[dict, nn.Module], builder: Registry, *args, function xformers_is_enable (line 270) | def xformers_is_enable(verbose: bool = False) -> bool: function set_xformers (line 285) | def set_xformers(module: nn.Module, prefix: str = '') -> nn.Module: function set_tomesd (line 315) | def set_tomesd(model: torch.nn.Module, function remove_tomesd (line 410) | def remove_tomesd(model: torch.nn.Module): FILE: mmagic/models/utils/sampling_utils.py function noise_sample_fn (line 10) | def noise_sample_fn(noise: Union[Tensor, Callable, None] = None, function label_sample_fn (line 74) | def label_sample_fn(label: Union[Tensor, Callable, List[int], None] = None, FILE: mmagic/models/utils/tensor_utils.py function get_unknown_tensor (line 5) | def get_unknown_tensor(trimap, unknown_value=128 / 255): function normalize_vecs (line 41) | def normalize_vecs(vectors: torch.Tensor) -> torch.Tensor: FILE: mmagic/models/utils/tome_utils.py function add_tome_cfg_hook (line 8) | def add_tome_cfg_hook(model: torch.nn.Module): function build_mmagic_wrapper_tomesd_block (line 22) | def build_mmagic_wrapper_tomesd_block(block_class: Type[torch.nn.Module] function build_mmagic_tomesd_block (line 124) | def build_mmagic_tomesd_block(block_class: Type[torch.nn.Module] function isinstance_str (line 176) | def isinstance_str(x: object, cls_name: str): function do_nothing (line 190) | def do_nothing(x: torch.Tensor, mode: str = None): function mps_gather_workaround (line 198) | def mps_gather_workaround(input, dim, index): function bipartite_soft_matching_random2d (line 211) | def bipartite_soft_matching_random2d(metric: torch.Tensor, function build_merge (line 359) | def build_merge(x: torch.Tensor, tome_info: Dict[str, FILE: mmagic/structures/data_sample.py function format_label (line 16) | def format_label(value: Union[torch.Tensor, np.ndarray, Sequence, int], function is_splitable_var (line 54) | def is_splitable_var(var: Any) -> bool: class DataSample (line 74) | class DataSample(BaseDataElement): method set_predefined_data (line 200) | def set_predefined_data(self, data: dict) -> None: method set_tensor_data (line 221) | def set_tensor_data(self, data: dict) -> None: method set_gt_label (line 239) | def set_gt_label( method gt_label (line 251) | def gt_label(self): method gt_label (line 260) | def gt_label(self, value: LabelData): method gt_label (line 269) | def gt_label(self): method stack (line 274) | def stack(cls, data_samples: Sequence['DataSample']) -> 'DataSample': method split (line 320) | def split(self, method __len__ (line 364) | def __len__(self): FILE: mmagic/utils/cli.py function modify_args (line 7) | def modify_args(): FILE: mmagic/utils/collect_env.py function collect_env (line 8) | def collect_env(): FILE: mmagic/utils/img_utils.py function can_convert_to_image (line 11) | def can_convert_to_image(value): function image_to_tensor (line 32) | def image_to_tensor(img): function all_to_tensor (line 50) | def all_to_tensor(value): function tensor2img (line 80) | def tensor2img(tensor, out_type=np.uint8, min_max=(0, 1)): function reorder_image (line 148) | def reorder_image(img, input_order='HWC'): function to_numpy (line 180) | def to_numpy(img, dtype=np.float64): function get_box_info (line 201) | def get_box_info(pred_bbox, original_shape, final_size): FILE: mmagic/utils/io_utils.py function get_content_from_url (line 15) | def get_content_from_url(url, timeout=15, stream=False): function download_from_url (line 35) | def download_from_url(url, FILE: mmagic/utils/logger.py function print_colored_log (line 8) | def print_colored_log(msg, level=logging.INFO, color='magenta'): FILE: mmagic/utils/sampler.py function _check_keys (line 10) | def _check_keys(sample_kwargs: dict, key: str) -> None: function get_sampler (line 17) | def get_sampler(sample_kwargs: dict, runner: Optional[Runner]): class ArgumentsSampler (line 34) | class ArgumentsSampler: method __init__ (line 37) | def __init__(self, method __iter__ (line 52) | def __iter__(self): method __next__ (line 56) | def __next__(self): class NoiseSampler (line 63) | class NoiseSampler: method __init__ (line 66) | def __init__(self, sample_kwargs: dict, runner: Runner) -> None: method __iter__ (line 81) | def __iter__(self): method __next__ (line 85) | def __next__(self): class DataSampler (line 97) | class DataSampler: method __init__ (line 100) | def __init__(self, sample_kwargs: dict, runner: Runner) -> None: method __iter__ (line 114) | def __iter__(self): method __next__ (line 118) | def __next__(self): class ValDataSampler (line 126) | class ValDataSampler: method __init__ (line 129) | def __init__(self, sample_kwargs: dict, runner: Runner) -> None: method __iter__ (line 150) | def __iter__(self): method __next__ (line 154) | def __next__(self): FILE: mmagic/utils/setup_env.py function register_all_modules (line 11) | def register_all_modules(init_default_scope: bool = True) -> None: function try_import (line 47) | def try_import(name: str) -> Optional[ModuleType]: FILE: mmagic/utils/trans_utils.py function make_coord (line 14) | def make_coord(shape, ranges=None, flatten=True): function bbox2mask (line 45) | def bbox2mask(img_shape, bbox, dtype='uint8'): function brush_stroke_mask (line 72) | def brush_stroke_mask(img_shape, function random_bbox (line 179) | def random_bbox(img_shape, max_bbox_shape, max_bbox_delta=40, min_margin... function random_irregular_mask (line 247) | def random_irregular_mask(img_shape, function get_irregular_mask (line 335) | def get_irregular_mask(img_shape, area_ratio_range=(0.15, 0.5), **kwargs): function dtype_limits (line 384) | def dtype_limits(image, clip_negative=False): function adjust_gamma (line 406) | def adjust_gamma(image, gamma=1, gain=1): function add_gaussian_noise (line 442) | def add_gaussian_noise(img: np.ndarray, mu, sigma): function random_choose_unknown (line 460) | def random_choose_unknown(unknown, crop_size): FILE: mmagic/version.py function parse_version_info (line 6) | def parse_version_info(version_str): FILE: mmagic/visualization/concat_visualizer.py class ConcatImageVisualizer (line 16) | class ConcatImageVisualizer(Visualizer): method __init__ (line 42) | def __init__(self, method add_datasample (line 56) | def add_datasample(self, data_sample: DataSample, step=0) -> None: FILE: mmagic/visualization/vis_backend.py class VisBackend (line 23) | class VisBackend(BaseVisBackend): method __init__ (line 55) | def __init__(self, method _init_env (line 75) | def _init_env(self): method experiment (line 118) | def experiment(self) -> 'VisBackend': method add_config (line 123) | def add_config(self, config: Config, **kwargs) -> None: method add_image (line 136) | def add_image(self, method add_scalar (line 178) | def add_scalar(self, method add_scalars (line 195) | def add_scalars(self, method _dump (line 236) | def _dump(self, value_dict: dict, file_path: str, method _upload (line 249) | def _upload(self, path: str, delete_local=False) -> None: class TensorboardVisBackend (line 264) | class TensorboardVisBackend(BaseTensorboardVisBackend): method add_image (line 267) | def add_image(self, name: str, image: np.array, step: int = 0, **kwargs): class PaviVisBackend (line 300) | class PaviVisBackend(BaseVisBackend): method __init__ (line 303) | def __init__(self, method _init_env (line 318) | def _init_env(self): method experiment (line 335) | def experiment(self) -> 'VisBackend': method add_image (line 341) | def add_image(self, method add_scalar (line 359) | def add_scalar(self, method add_scalars (line 376) | def add_scalars(self, class WandbVisBackend (line 402) | class WandbVisBackend(BaseWandbVisBackend): method _init_env (line 405) | def _init_env(self): method add_image (line 428) | def add_image(self, name: str, image: np.array, step: int = 0, **kwargs): FILE: mmagic/visualization/visualizer.py class Visualizer (line 20) | class Visualizer(BaseVisualizer): method __init__ (line 44) | def __init__(self, method _post_process_image (line 51) | def _post_process_image(image: Tensor) -> Tensor: method _get_n_row_and_padding (line 69) | def _get_n_row_and_padding(samples: Tuple[dict, Tensor], method _vis_gif_sample (line 104) | def _vis_gif_sample(self, gen_samples: SampleList, method _vis_image_sample (line 170) | def _vis_image_sample(self, gen_samples: SampleList, method _get_vis_data_by_key (line 226) | def _get_vis_data_by_key(self, sample: DataSample, key: str) -> Tensor: method add_datasample (line 264) | def add_datasample(self, method add_image (line 316) | def add_image(self, FILE: projects/animated_drawings/tools/generate_character.py function draw_pose (line 16) | def draw_pose(pose, H, W, draw_body=True, draw_hand=True, draw_face=True): class OpenposeDetectorPoint (line 36) | class OpenposeDetectorPoint(OpenposeDetector): method __call__ (line 38) | def __call__(self, function parse_args (line 105) | def parse_args(): function main (line 127) | def main(): FILE: projects/example_project/models/example_net.py class ExampleNet (line 7) | class ExampleNet(ResNet): method __init__ (line 13) | def __init__(self, **kwargs) -> None: method forward (line 19) | def forward(self, x): FILE: projects/flow_style_vton/models/afwm.py class AFWM (line 11) | class AFWM(nn.Module): method __init__ (line 13) | def __init__(self, input_nc): method forward (line 22) | def forward(self, cond_input, image_input): function apply_offset (line 35) | def apply_offset(offset): function TVLoss (line 54) | def TVLoss(x): class EqualLR (line 62) | class EqualLR: method __init__ (line 64) | def __init__(self, name): method compute_weight (line 67) | def compute_weight(self, module): method apply (line 74) | def apply(module, name): method __call__ (line 84) | def __call__(self, module, input): function equal_lr (line 89) | def equal_lr(module, name='weight'): class EqualLinear (line 95) | class EqualLinear(nn.Module): method __init__ (line 97) | def __init__(self, in_dim, out_dim): method forward (line 106) | def forward(self, input): class ModulatedConv2d (line 110) | class ModulatedConv2d(nn.Module): method __init__ (line 112) | def __init__(self, method forward (line 146) | def forward(self, input, latent): class StyledConvBlock (line 174) | class StyledConvBlock(nn.Module): method __init__ (line 176) | def __init__(self, method forward (line 239) | def forward(self, input, latent=None): class Styled_F_ConvBlock (line 257) | class Styled_F_ConvBlock(nn.Module): method __init__ (line 259) | def __init__(self, method forward (line 320) | def forward(self, input, latent=None): class ResBlock (line 336) | class ResBlock(nn.Module): method __init__ (line 338) | def __init__(self, in_channels): method forward (line 350) | def forward(self, x): class DownSample (line 354) | class DownSample(nn.Module): method __init__ (line 356) | def __init__(self, in_channels, out_channels): method forward (line 368) | def forward(self, x): class FeatureEncoder (line 372) | class FeatureEncoder(nn.Module): method __init__ (line 374) | def __init__(self, in_channels, chns=[64, 128, 256, 256, 256]): method forward (line 391) | def forward(self, x): class RefinePyramid (line 399) | class RefinePyramid(nn.Module): method __init__ (line 401) | def __init__(self, chns=[64, 128, 256, 256, 256], fpn_dim=256): method forward (line 419) | def forward(self, x): class AFlowNet (line 439) | class AFlowNet(nn.Module): method __init__ (line 441) | def __init__(self, num_pyramid, fpn_dim=256): method forward (line 520) | def forward(self, x, x_warps, x_conds, warp_feature=True): FILE: projects/flow_style_vton/models/flow_style_vton_model.py class FlowStyleVTON (line 13) | class FlowStyleVTON(BaseModel): method __init__ (line 15) | def __init__(self, warp_model, gen_model, pretrained_cfgs=None): method load_pretrained_models (line 22) | def load_pretrained_models(self, pretrained_cfgs): method device (line 37) | def device(self): method infer (line 45) | def infer(self, inputs): method forward (line 81) | def forward(self, inputs: ForwardInputs): function make_colorwheel (line 85) | def make_colorwheel(): class flow2color (line 130) | class flow2color(): method __init__ (line 146) | def __init__(self): method flow_compute_color (line 149) | def flow_compute_color(self, u, v, convert_to_bgr=False): method __call__ (line 188) | def __call__(self, flow_uv, clip_flow=None, convert_to_bgr=False): function de_offset (line 221) | def de_offset(s_grid): FILE: projects/flow_style_vton/models/generator.py class ResUnetGenerator (line 10) | class ResUnetGenerator(nn.Module): method __init__ (line 12) | def __init__(self, method forward (line 65) | def forward(self, input): class ResidualBlock (line 69) | class ResidualBlock(nn.Module): method __init__ (line 71) | def __init__(self, in_features=64, norm_layer=nn.BatchNorm2d): method forward (line 87) | def forward(self, x): class ResUnetSkipConnectionBlock (line 98) | class ResUnetSkipConnectionBlock(nn.Module): method __init__ (line 100) | def __init__(self, method forward (line 188) | def forward(self, x): function load_checkpoint (line 195) | def load_checkpoint(model, checkpoint_path): FILE: projects/flow_style_vton/vton_dataset.py class AlignedDataset (line 10) | class AlignedDataset(Dataset): method __init__ (line 12) | def __init__(self, opt): method get_file_name (line 36) | def get_file_name(self): method __getitem__ (line 45) | def __getitem__(self, index): method __len__ (line 72) | def __len__(self): function get_params (line 76) | def get_params(opt, size): function get_transform_resize (line 93) | def get_transform_resize(opt, params, method=Image.BICUBIC, normalize=Tr... function get_transform (line 125) | def get_transform(opt, params, method=Image.BICUBIC, normalize=True): function normalize (line 159) | def normalize(): function __make_power_2 (line 163) | def __make_power_2(img, base, method=Image.BICUBIC): function __scale_width (line 172) | def __scale_width(img, target_width, method=Image.BICUBIC): function __crop (line 181) | def __crop(img, pos, size): function __flip (line 190) | def __flip(img, flip): FILE: projects/glide/models/glide.py function classifier_grad (line 22) | def classifier_grad(classifier, x, t, y=None, classifier_scale=1.0): class Glide (line 35) | class Glide(BaseModel): method __init__ (line 63) | def __init__(self, method load_pretrained_models (line 107) | def load_pretrained_models(self, pretrained_cfgs): method device (line 124) | def device(self): method infer (line 133) | def infer(self, method infer_up (line 242) | def infer_up(self, method forward (line 302) | def forward(self, method val_step (line 363) | def val_step(self, data: dict) -> SampleList: method test_step (line 382) | def test_step(self, data: dict) -> SampleList: method train_step (line 396) | def train_step(self, data: dict, optim_wrapper: OptimWrapperDict): FILE: projects/glide/models/glide_modules.py class QKVMultiheadAttention (line 7) | class QKVMultiheadAttention(nn.Module): method __init__ (line 9) | def __init__(self, n_heads: int, n_ctx: int): method forward (line 14) | def forward(self, qkv): class MultiheadAttention (line 29) | class MultiheadAttention(nn.Module): method __init__ (line 31) | def __init__(self, n_ctx, width, heads): method forward (line 40) | def forward(self, x): class MLP (line 47) | class MLP(nn.Module): method __init__ (line 49) | def __init__(self, width): method forward (line 56) | def forward(self, x): class ResidualAttentionBlock (line 60) | class ResidualAttentionBlock(nn.Module): method __init__ (line 62) | def __init__( method forward (line 81) | def forward(self, x: torch.Tensor): class Transformer (line 87) | class Transformer(nn.Module): method __init__ (line 89) | def __init__( method forward (line 108) | def forward(self, x: torch.Tensor): FILE: projects/glide/models/glide_tokenizer/bpe.py function bytes_to_unicode (line 16) | def bytes_to_unicode(): function get_pairs (line 44) | def get_pairs(word): class Encoder (line 58) | class Encoder: method __init__ (line 60) | def __init__(self, encoder, bpe_merges, errors='replace'): method n_vocab (line 76) | def n_vocab(self) -> int: method end_token (line 80) | def end_token(self) -> int: method padded_tokens_and_mask (line 83) | def padded_tokens_and_mask(self, tokens: List[int], method bpe (line 91) | def bpe(self, token): method encode (line 134) | def encode(self, text): method decode (line 144) | def decode(self, tokens): function get_encoder (line 151) | def get_encoder(): FILE: projects/glide/models/glide_tokenizer/simple_tokenizer.py function default_bpe (line 15) | def default_bpe(): function bytes_to_unicode (line 22) | def bytes_to_unicode(): function get_pairs (line 50) | def get_pairs(word): function basic_clean (line 64) | def basic_clean(text): function whitespace_clean (line 70) | def whitespace_clean(text): class SimpleTokenizer (line 76) | class SimpleTokenizer(object): method __init__ (line 78) | def __init__(self, bpe_path: str = default_bpe()): method start_token (line 103) | def start_token(self): method end_token (line 107) | def end_token(self): method padded_tokens_and_len (line 110) | def padded_tokens_and_len(self, tokens: List[int], method bpe (line 118) | def bpe(self, token): method encode (line 161) | def encode(self, text): method decode (line 171) | def decode(self, tokens): FILE: projects/glide/models/text2im_unet.py class Text2ImUNet (line 12) | class Text2ImUNet(DenoisingUnet): method __init__ (line 34) | def __init__( method get_text_emb (line 89) | def get_text_emb(self, tokens, mask): method del_cache (line 122) | def del_cache(self): method forward (line 125) | def forward(self, x, timesteps, tokens=None, mask=None): class SuperResText2ImUNet (line 157) | class SuperResText2ImUNet(Text2ImUNet): method __init__ (line 163) | def __init__(self, *args, **kwargs): method forward (line 172) | def forward(self, x, timesteps, low_res=None, **kwargs): FILE: projects/powerpaint/gradio_PowerPaint.py function set_seed (line 53) | def set_seed(seed): function get_depth_map (line 61) | def get_depth_map(image): function add_task (line 83) | def add_task(prompt, negative_prompt, control_type): function predict (line 109) | def predict(input_image, prompt, fitting_degree, ddim_steps, scale, seed, function predict_controlnet (line 212) | def predict_controlnet(input_image, input_control_image, control_type, p... function infer (line 315) | def infer(input_image, text_guided_prompt, text_guided_negative_prompt, function select_tab_text_guided (line 352) | def select_tab_text_guided(): function select_tab_object_removal (line 356) | def select_tab_object_removal(): function select_tab_image_outpainting (line 360) | def select_tab_image_outpainting(): function select_tab_shape_guided (line 364) | def select_tab_shape_guided(): FILE: projects/powerpaint/pipeline/pipeline_PowerPaint.py function prepare_mask_and_masked_image (line 41) | def prepare_mask_and_masked_image(image, class StableDiffusionInpaintPipeline (line 188) | class StableDiffusionInpaintPipeline(DiffusionPipeline, method __init__ (line 235) | def __init__( method enable_model_cpu_offload (line 379) | def enable_model_cpu_offload(self, gpu_id=0): method _encode_prompt (line 419) | def _encode_prompt( method run_safety_checker (line 651) | def run_safety_checker(self, image, device, dtype): method prepare_extra_step_kwargs (line 671) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 692) | def check_inputs( method prepare_latents (line 750) | def prepare_latents( method _encode_vae_image (line 814) | def _encode_vae_image(self, image: torch.Tensor, method prepare_mask_latents (line 830) | def prepare_mask_latents(self, mask, masked_image, batch_size, height, method get_timesteps (line 887) | def get_timesteps(self, num_inference_steps, strength, device): method __call__ (line 898) | def __call__( FILE: projects/powerpaint/pipeline/pipeline_PowerPaint_ControlNet.py function prepare_mask_and_masked_image (line 109) | def prepare_mask_and_masked_image(image, class StableDiffusionControlNetInpaintPipeline (line 254) | class StableDiffusionControlNetInpaintPipeline(DiffusionPipeline, method __init__ (line 324) | def __init__( method enable_vae_slicing (line 387) | def enable_vae_slicing(self): method disable_vae_slicing (line 398) | def disable_vae_slicing(self): method enable_vae_tiling (line 408) | def enable_vae_tiling(self): method disable_vae_tiling (line 420) | def disable_vae_tiling(self): method enable_model_cpu_offload (line 428) | def enable_model_cpu_offload(self, gpu_id=0): method _encode_prompt (line 466) | def _encode_prompt( method run_safety_checker (line 697) | def run_safety_checker(self, image, device, dtype): method decode_latents (line 716) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 734) | def prepare_extra_step_kwargs(self, generator, eta): method get_timesteps (line 758) | def get_timesteps(self, num_inference_steps, strength, device): method check_inputs (line 768) | def check_inputs( method check_image (line 923) | def check_image(self, image, prompt, prompt_embeds): method prepare_control_image (line 963) | def prepare_control_image( method prepare_latents (line 997) | def prepare_latents( method _default_height_width (line 1060) | def _default_height_width(self, height, width, image): method prepare_mask_latents (line 1088) | def prepare_mask_latents(self, mask, masked_image, batch_size, height, method _encode_vae_image (line 1144) | def _encode_vae_image(self, image: torch.Tensor, method predict_woControl (line 1161) | def predict_woControl( method __call__ (line 1604) | def __call__( FILE: projects/powerpaint/utils/utils.py function try_import (line 13) | def try_import(name: str): class TokenizerWrapper (line 29) | class TokenizerWrapper: method __init__ (line 49) | def __init__(self, method __getattr__ (line 77) | def __getattr__(self, name: str) -> Any: method try_adding_tokens (line 92) | def try_adding_tokens(self, tokens: Union[str, List[str]], *args, method get_token_info (line 105) | def get_token_info(self, token: str) -> dict: method add_placeholder_token (line 120) | def add_placeholder_token(self, method replace_placeholder_tokens_in_text (line 152) | def replace_placeholder_tokens_in_text(self, method replace_text_with_placeholder_tokens (line 188) | def replace_text_with_placeholder_tokens(self, text: Union[str, List[s... method __call__ (line 212) | def __call__(self, method encode (line 235) | def encode(self, text: Union[str, List[str]], *args, **kwargs): method decode (line 245) | def decode(self, method __repr__ (line 267) | def __repr__(self): class EmbeddingLayerWithFixes (line 278) | class EmbeddingLayerWithFixes(nn.Module): method __init__ (line 290) | def __init__(self, method weight (line 305) | def weight(self): method check_duplicate_names (line 309) | def check_duplicate_names(self, embeddings: List[dict]): method check_ids_overlap (line 321) | def check_ids_overlap(self, embeddings): method add_embeddings (line 337) | def add_embeddings(self, embeddings: Optional[Union[dict, List[dict]]]): method replace_input_ids (line 407) | def replace_input_ids(self, input_ids: torch.Tensor) -> torch.Tensor: method replace_embeddings (line 420) | def replace_embeddings(self, input_ids: torch.Tensor, method forward (line 477) | def forward(self, function add_tokens (line 519) | def add_tokens(tokenizer, FILE: projects/prompt_to_prompt/inversions/ddim_inversion.py class DDIMInversion (line 27) | class DDIMInversion: method __init__ (line 29) | def __init__(self, model, **kwargs): method prev_step (line 45) | def prev_step(self, model_output: Union[torch.FloatTensor, np.ndarray], method next_step (line 62) | def next_step(self, model_output: Union[torch.FloatTensor, np.ndarray], method get_noise_pred_single (line 78) | def get_noise_pred_single(self, latents, t, context): method get_noise_pred (line 83) | def get_noise_pred(self, latents, t, is_forward=True, context=None): method latent2image (line 100) | def latent2image(self, latents, return_type='np'): method image2latent (line 110) | def image2latent(self, image): method init_prompt (line 125) | def init_prompt(self, prompt: str): method ddim_loop (line 146) | def ddim_loop(self, latent): method scheduler (line 159) | def scheduler(self): method ddim_inversion (line 163) | def ddim_inversion(self, image): FILE: projects/prompt_to_prompt/inversions/null_text_inversion.py class NullTextInversion (line 8) | class NullTextInversion(DDIMInversion): method null_optimization (line 13) | def null_optimization(self, latents, num_inner_steps, epsilon): FILE: projects/prompt_to_prompt/models/ptp.py function make_controller (line 18) | def make_controller(prompts: List[str], class LocalBlend (line 60) | class LocalBlend: method __call__ (line 62) | def __call__(self, x_t, attention_store): method __init__ (line 81) | def __init__(self, prompts: List[str], words, threshold=.3, model=None): class AttentionControl (line 94) | class AttentionControl(abc.ABC): method step_callback (line 96) | def step_callback(self, x_t): method between_steps (line 99) | def between_steps(self): method num_uncond_att_layers (line 103) | def num_uncond_att_layers(self): method forward (line 107) | def forward(self, attn, is_cross: bool, place_in_unet: str): method __call__ (line 110) | def __call__(self, attn, is_cross: bool, place_in_unet: str): method reset (line 126) | def reset(self): method __init__ (line 130) | def __init__(self): class EmptyControl (line 136) | class EmptyControl: method step_callback (line 138) | def step_callback(self, x_t): method between_steps (line 141) | def between_steps(self): method __call__ (line 144) | def __call__(self, attn, is_cross: bool, place_in_unet: str): class AttentionStore (line 148) | class AttentionStore(AttentionControl): method get_empty_store (line 151) | def get_empty_store(): method forward (line 161) | def forward(self, attn, is_cross: bool, place_in_unet: str): method between_steps (line 167) | def between_steps(self): method get_average_attention (line 176) | def get_average_attention(self): method reset (line 183) | def reset(self): method __init__ (line 188) | def __init__(self): class AttentionControlEdit (line 194) | class AttentionControlEdit(AttentionStore, abc.ABC): method step_callback (line 196) | def step_callback(self, x_t): method replace_self_attention (line 201) | def replace_self_attention(self, attn_base, att_replace): method replace_cross_attention (line 209) | def replace_cross_attention(self, attn_base, att_replace): method forward (line 212) | def forward(self, attn, is_cross: bool, place_in_unet: str): method __init__ (line 231) | def __init__(self, prompts, num_steps: int, class AttentionReplace (line 248) | class AttentionReplace(AttentionControlEdit): method replace_cross_attention (line 250) | def replace_cross_attention(self, attn_base, att_replace): method __init__ (line 253) | def __init__(self, class AttentionRefine (line 271) | class AttentionRefine(AttentionControlEdit): method replace_cross_attention (line 273) | def replace_cross_attention(self, attn_base, att_replace): method __init__ (line 279) | def __init__(self, class AttentionReweight (line 300) | class AttentionReweight(AttentionControlEdit): method replace_cross_attention (line 302) | def replace_cross_attention(self, attn_base, att_replace): method __init__ (line 310) | def __init__(self, function get_equalizer (line 330) | def get_equalizer(text: str, function aggregate_attention (line 344) | def aggregate_attention(attention_store: AttentionStore, function show_cross_attention (line 365) | def show_cross_attention(attention_store: AttentionStore, function show_self_attention_comp (line 387) | def show_self_attention_comp(attention_store: AttentionStore, function run_and_display (line 410) | def run_and_display(model, FILE: projects/prompt_to_prompt/models/ptp_utils.py function tensor_to_nparray (line 28) | def tensor_to_nparray(image: torch.Tensor): function text_under_image (line 35) | def text_under_image(image: np.ndarray, function view_images (line 49) | def view_images(images, num_rows=1, offset_ratio=0.02): function diffusion_step (line 80) | def diffusion_step(model, function latent2image (line 104) | def latent2image(vae, latents): function init_latent (line 113) | def init_latent(latent, model, height, width, generator, batch_size): function text2image_ldm_stable (line 125) | def text2image_ldm_stable(model, function register_attention_control (line 187) | def register_attention_control(model, controller): function get_word_inds (line 276) | def get_word_inds(text: str, word_place: int, tokenizer): function update_alpha_time_word (line 302) | def update_alpha_time_word(alpha, function get_time_words_attention_alpha (line 318) | def get_time_words_attention_alpha( function load_512 (line 349) | def load_512(image_path, left=0, right=0, top=0, bottom=0, device=None): FILE: projects/prompt_to_prompt/models/seq_aligner.py class ScoreParams (line 21) | class ScoreParams: method __init__ (line 23) | def __init__(self, gap, match, mismatch): method mis_match_char (line 28) | def mis_match_char(self, x, y): function get_matrix (line 35) | def get_matrix(size_x, size_y, gap): function get_traceback_matrix (line 56) | def get_traceback_matrix(size_x, size_y): function global_align (line 64) | def global_align(x, y, score): function get_aligned_sequences (line 83) | def get_aligned_sequences(x, y, trace_back): function get_mapper (line 111) | def get_mapper(x: str, y: str, tokenizer, max_len=77): function get_refinement_mapper (line 126) | def get_refinement_mapper(prompts, tokenizer, max_len=77): function get_word_inds (line 136) | def get_word_inds(text: str, word_place: int, tokenizer): function get_replacement_mapper_ (line 162) | def get_replacement_mapper_(x: str, y: str, tokenizer, max_len=77): function get_replacement_mapper (line 198) | def get_replacement_mapper(prompts, tokenizer, max_len=77): FILE: setup.py function readme (line 14) | def readme(): function get_git_hash (line 23) | def get_git_hash(): function get_hash (line 49) | def get_hash(): function get_version (line 64) | def get_version(): function parse_requirements (line 70) | def parse_requirements(fname='requirements.txt', with_version=True): function make_cuda_ext (line 148) | def make_cuda_ext(name, module, sources, sources_cuda=[]): function add_mim_extension (line 173) | def add_mim_extension(): FILE: tests/configs/aot_test.py function teardown_module (line 58) | def teardown_module(): FILE: tests/configs/deepfillv1_test.py function teardown_module (line 70) | def teardown_module(): FILE: tests/configs/gl_test.py function teardown_module (line 135) | def teardown_module(): FILE: tests/configs/one_stage_gl.py function teardown_module (line 46) | def teardown_module(): FILE: tests/configs/pconv_test.py function teardown_module (line 48) | def teardown_module(): FILE: tests/configs/two_stage_test.py function teardown_module (line 111) | def teardown_module(): FILE: tests/test_apis/test_inferencers/test_base_mmagic_inferencer.py function test_base_mmagic_inferencer (line 12) | def test_base_mmagic_inferencer(): function teardown_module (line 28) | def teardown_module(): FILE: tests/test_apis/test_inferencers/test_colorization_inferencer.py function test_colorization_inferencer (line 14) | def test_colorization_inferencer(): function teardown_module (line 49) | def teardown_module(): FILE: tests/test_apis/test_inferencers/test_conditional_inferencer.py function test_conditional_inferencer (line 11) | def test_conditional_inferencer(): function teardown_module (line 29) | def teardown_module(): FILE: tests/test_apis/test_inferencers/test_diffusers_pipeline_inferencer.py function test_diffusers_pipeline_inferencer (line 20) | def test_diffusers_pipeline_inferencer(): function teardown_module (line 30) | def teardown_module(): FILE: tests/test_apis/test_inferencers/test_eg3d_inferencer.py function test_eg3d_inferencer (line 51) | def test_eg3d_inferencer(): function teardown_module (line 162) | def teardown_module(): FILE: tests/test_apis/test_inferencers/test_image_super_resolution_inferencer.py function test_image_super_resolution_inferencer (line 18) | def test_image_super_resolution_inferencer(): function teardown_module (line 35) | def teardown_module(): FILE: tests/test_apis/test_inferencers/test_inference_functions.py function test_init_model (line 9) | def test_init_model(): function test_calculate_grid_size (line 16) | def test_calculate_grid_size(): function teardown_module (line 30) | def teardown_module(): FILE: tests/test_apis/test_inferencers/test_inpainting_inferencer.py function test_inpainting_inferencer (line 10) | def test_inpainting_inferencer(): function teardown_module (line 35) | def teardown_module(): FILE: tests/test_apis/test_inferencers/test_matting_inferencer.py function test_matting_inferencer (line 10) | def test_matting_inferencer(): function teardown_module (line 27) | def teardown_module(): FILE: tests/test_apis/test_inferencers/test_mmedit_inferencer.py function test_mmagic_inferencer (line 12) | def test_mmagic_inferencer(): function teardown_module (line 61) | def teardown_module(): FILE: tests/test_apis/test_inferencers/test_text2image_inferencers.py class clip_mock (line 20) | class clip_mock(nn.Module): method __init__ (line 22) | def __init__(self, device='cuda'): method encode_image (line 26) | def encode_image(self, inputs): method encode_text (line 30) | def encode_text(self, inputs): method forward (line 33) | def forward(self, x): class clip_mock_wrapper (line 37) | class clip_mock_wrapper(nn.Module): method __init__ (line 39) | def __init__(self): method forward (line 43) | def forward(self, x): class TestTranslationInferencer (line 47) | class TestTranslationInferencer(TestCase): method setUp (line 49) | def setUp(self): method test_translation (line 89) | def test_translation(self): function teardown_module (line 111) | def teardown_module(): FILE: tests/test_apis/test_inferencers/test_translation_inferencer.py function test_translation_inferencer (line 11) | def test_translation_inferencer(): function teardown_module (line 31) | def teardown_module(): FILE: tests/test_apis/test_inferencers/test_unconditional_inferencer.py function test_unconditional_inferencer (line 13) | def test_unconditional_inferencer(): function teardown_module (line 55) | def teardown_module(): FILE: tests/test_apis/test_inferencers/test_video_interpolation_inferencer.py function test_video_interpolation_inferencer (line 11) | def test_video_interpolation_inferencer(): function test_video_interpolation_inferencer_input_dir (line 29) | def test_video_interpolation_inferencer_input_dir(): function test_video_interpolation_inferencer_fps_multiplier (line 44) | def test_video_interpolation_inferencer_fps_multiplier(): function teardown_module (line 61) | def teardown_module(): FILE: tests/test_apis/test_inferencers/test_video_restoration_inferencer.py function test_video_restoration_inferencer (line 11) | def test_video_restoration_inferencer(): function test_video_restoration_inferencer_input_dir (line 30) | def test_video_restoration_inferencer_input_dir(): function test_video_restoration_inferencer_window_size (line 50) | def test_video_restoration_inferencer_window_size(): function test_video_restoration_inferencer_max_seq_len (line 72) | def test_video_restoration_inferencer_max_seq_len(): function teardown_module (line 94) | def teardown_module(): FILE: tests/test_apis/test_mmagic_inferencer.py function test_edit (line 12) | def test_edit(): function teardown_module (line 55) | def teardown_module(): FILE: tests/test_datasets/test_basic_conditional_dataset.py class TestBasicConditonalDataset (line 16) | class TestBasicConditonalDataset(TestCase): method test_init (line 18) | def test_init(self): function teardown_module (line 100) | def teardown_module(): FILE: tests/test_datasets/test_basic_frames_dataset.py class TestFramesDatasets (line 8) | class TestFramesDatasets: method setup_class (line 13) | def setup_class(cls): method test_version_1_method (line 16) | def test_version_1_method(self): method test_vsr_folder_dataset (line 201) | def test_vsr_folder_dataset(self): method test_vsr_ann_dataset (line 427) | def test_vsr_ann_dataset(self): method test_vfi_ann_dataset (line 592) | def test_vfi_ann_dataset(self): function teardown_module (line 703) | def teardown_module(): FILE: tests/test_datasets/test_basic_image_dataset.py class TestImageDatasets (line 11) | class TestImageDatasets: method setup_class (line 14) | def setup_class(cls): method test_version_1_method (line 17) | def test_version_1_method(self): method test_sisr_annotation_dataset (line 109) | def test_sisr_annotation_dataset(self): method test_sisr_folder_dataset (line 131) | def test_sisr_folder_dataset(self): method test_refsr_folder_dataset (line 151) | def test_refsr_folder_dataset(self): function teardown_module (line 175) | def teardown_module(): FILE: tests/test_datasets/test_categories.py function test_cifar10_categories (line 5) | def test_cifar10_categories(): function test_imagenet_categories (line 9) | def test_imagenet_categories(): function teardown_module (line 13) | def teardown_module(): FILE: tests/test_datasets/test_cifar10_dataset.py class TestCIFAR10 (line 19) | class TestCIFAR10(TestCase): method setUpClass (line 23) | def setUpClass(cls) -> None: method test_initialize (line 66) | def test_initialize(self): method test_load_data_list (line 90) | def test_load_data_list(self): method test_extra_repr (line 164) | def test_extra_repr(self): method tearDownClass (line 173) | def tearDownClass(cls): function teardown_module (line 177) | def teardown_module(): FILE: tests/test_datasets/test_comp1k_dataset.py class TestMattingDatasets (line 9) | class TestMattingDatasets: method test_comp1k_dataset (line 18) | def test_comp1k_dataset(self): function teardown_module (line 78) | def teardown_module(): FILE: tests/test_datasets/test_controlnet_dataset.py function test_controlnet_dataset (line 13) | def test_controlnet_dataset(): function teardown_module (line 27) | def teardown_module(): FILE: tests/test_datasets/test_data_utils.py function test_infer_io_backend (line 5) | def test_infer_io_backend(): function teardown_module (line 25) | def teardown_module(): FILE: tests/test_datasets/test_dreambooth_dataset.py function test_dreambooth_dataset (line 11) | def test_dreambooth_dataset(): function teardown_module (line 23) | def teardown_module(): FILE: tests/test_datasets/test_grow_scale_image_dataset.py class TestGrowScaleImgDataset (line 12) | class TestGrowScaleImgDataset: method setup_class (line 15) | def setup_class(cls): method test_dynamic_unconditional_img_dataset (line 26) | def test_dynamic_unconditional_img_dataset(self): function teardown_module (line 104) | def teardown_module(): FILE: tests/test_datasets/test_imagenet_dataset.py class TestImageNetDataset (line 10) | class TestImageNetDataset(TestCase): method test_load_data_list (line 12) | def test_load_data_list(self): function teardown_module (line 19) | def teardown_module(): FILE: tests/test_datasets/test_mscoco_dataset.py class TestMSCoCoDatasets (line 8) | class TestMSCoCoDatasets: method setup_class (line 11) | def setup_class(cls): method test_mscoco (line 14) | def test_mscoco(self): function teardown_module (line 34) | def teardown_module(): FILE: tests/test_datasets/test_paired_image_dataset.py class TestPairedImageDataset (line 10) | class TestPairedImageDataset(object): method setup_class (line 13) | def setup_class(cls): method test_paired_image_dataset (line 38) | def test_paired_image_dataset(self): function teardown_module (line 56) | def teardown_module(): FILE: tests/test_datasets/test_singan_dataset.py class TestSinGANDataset (line 10) | class TestSinGANDataset(object): method setup_class (line 13) | def setup_class(cls): method test_singan_dataset (line 26) | def test_singan_dataset(self): function teardown_module (line 45) | def teardown_module(): FILE: tests/test_datasets/test_textual_inversion_dataset.py function test_textual_inversion_dataset (line 14) | def test_textual_inversion_dataset(): FILE: tests/test_datasets/test_transforms/test_albumentations.py function test_albumentations (line 7) | def test_albumentations(): function teardown_module (line 18) | def teardown_module(): FILE: tests/test_datasets/test_transforms/test_alpha.py function assert_keys_contain (line 9) | def assert_keys_contain(result_keys, target_keys): function test_generate_seg (line 14) | def test_generate_seg(): function test_generate_soft_seg (line 44) | def test_generate_soft_seg(): function teardown_module (line 89) | def teardown_module(): FILE: tests/test_datasets/test_transforms/test_aug_frames.py class TestAugmentations (line 8) | class TestAugmentations: method setup_class (line 11) | def setup_class(cls): method assert_img_equal (line 33) | def assert_img_equal(img, ref_img, ratio_thr=0.999): method check_keys_contain (line 43) | def check_keys_contain(result_keys, target_keys): method test_mirror_sequence (line 48) | def test_mirror_sequence(self): method test_temporal_reverse (line 72) | def test_temporal_reverse(self): function teardown_module (line 99) | def teardown_module(): FILE: tests/test_datasets/test_transforms/test_aug_pixel.py class TestAugmentations (line 12) | class TestAugmentations: method setup_class (line 15) | def setup_class(cls): method check_keys_contain (line 37) | def check_keys_contain(result_keys, target_keys): method test_binarize (line 42) | def test_binarize(self): method test_clip (line 70) | def test_clip(self): method test_color_jitter (line 78) | def test_color_jitter(self): method test_random_affine (line 128) | def test_random_affine(self): method test_random_dilation (line 228) | def test_random_dilation(self): method test_unsharp_masking (line 244) | def test_unsharp_masking(self): function teardown_module (line 269) | def teardown_module(): FILE: tests/test_datasets/test_transforms/test_aug_shape.py class TestAugmentations (line 12) | class TestAugmentations: method setup_class (line 15) | def setup_class(cls): method check_flip (line 37) | def check_flip(origin_img, result_img, flip_direction): method check_keys_contain (line 58) | def check_keys_contain(result_keys, target_keys): method check_transposehw (line 64) | def check_transposehw(origin_img, result_img): method test_flip (line 75) | def test_flip(self): method test_random_rotation (line 164) | def test_random_rotation(self): method test_random_transposehw (line 199) | def test_random_transposehw(self): method test_resize (line 243) | def test_resize(self): function test_random_long_edge_crop (line 341) | def test_random_long_edge_crop(): function test_center_long_edge_crop (line 353) | def test_center_long_edge_crop(): function test_numpy_pad (line 360) | def test_numpy_pad(): function teardown_module (line 374) | def teardown_module(): FILE: tests/test_datasets/test_transforms/test_blur_kernels.py function test_blur_kernels (line 5) | def test_blur_kernels(): function teardown_module (line 15) | def teardown_module(): FILE: tests/test_datasets/test_transforms/test_crop.py class TestAugmentations (line 16) | class TestAugmentations: method setup_class (line 19) | def setup_class(cls): method test_crop (line 36) | def test_crop(self): method test_random_resized_crop (line 81) | def test_random_resized_crop(self): method test_fixed_crop (line 144) | def test_fixed_crop(self): method test_modcrop (line 252) | def test_modcrop(self): method test_paired_random_crop (line 272) | def test_paired_random_crop(self): function test_crop_like (line 327) | def test_crop_like(): function test_instance_crop (line 360) | def test_instance_crop(): function teardown_module (line 388) | def teardown_module(): FILE: tests/test_datasets/test_transforms/test_fgbg.py function assert_keys_contain (line 15) | def assert_keys_contain(result_keys, target_keys): function test_composite_fg (line 20) | def test_composite_fg(): function test_merge_fg_and_bg (line 72) | def test_merge_fg_and_bg(): function test_perturb_bg (line 87) | def test_perturb_bg(): function test_random_jitter (line 118) | def test_random_jitter(): function test_random_load_resize_bg (line 147) | def test_random_load_resize_bg(): function teardown_module (line 170) | def teardown_module(): FILE: tests/test_datasets/test_transforms/test_formatting.py function assert_tensor_equal (line 10) | def assert_tensor_equal(img, ref_img, ratio_thr=0.999): function test_pack_inputs (line 19) | def test_pack_inputs(): function teardown_module (line 110) | def teardown_module(): FILE: tests/test_datasets/test_transforms/test_generate_assistant.py function test_generate_coordinate_and_cell (line 9) | def test_generate_coordinate_and_cell(): function test_generate_facial_heatmap (line 38) | def test_generate_facial_heatmap(): function teardown_module (line 79) | def teardown_module(): FILE: tests/test_datasets/test_transforms/test_generate_frame_indices.py class TestAugmentations (line 13) | class TestAugmentations: method setup_class (line 16) | def setup_class(cls): method check_keys_contain (line 38) | def check_keys_contain(result_keys, target_keys): method test_frame_index_generator (line 43) | def test_frame_index_generator(self): method test_frame_index_generation_with_padding (line 70) | def test_frame_index_generation_with_padding(self): method test_frame_index_generation_for_recurrent (line 189) | def test_frame_index_generation_for_recurrent(self): function teardown_module (line 238) | def teardown_module(): FILE: tests/test_datasets/test_transforms/test_get_masked_image.py function test_masked_img (line 7) | def test_masked_img(): function teardown_module (line 37) | def teardown_module(): FILE: tests/test_datasets/test_transforms/test_loading.py function test_load_image_from_file (line 13) | def test_load_image_from_file(): function test_dct_mask (line 182) | def test_dct_mask(): class TestInpaintLoading (line 211) | class TestInpaintLoading: method setup_class (line 214) | def setup_class(cls): method test_load_mask (line 219) | def test_load_mask(self): function teardown_module (line 301) | def teardown_module(): FILE: tests/test_datasets/test_transforms/test_matlab_like_resize.py function test_matlab_like_resize (line 8) | def test_matlab_like_resize(): function teardown_module (line 40) | def teardown_module(): FILE: tests/test_datasets/test_transforms/test_normalization.py class TestAugmentations (line 8) | class TestAugmentations: method assert_img_equal (line 11) | def assert_img_equal(img, ref_img, ratio_thr=0.999): method check_keys_contain (line 20) | def check_keys_contain(result_keys, target_keys): method check_normalize (line 24) | def check_normalize(self, origin_img, result_img, norm_cfg): method test_normalize (line 34) | def test_normalize(self): method test_rescale_to_zero_one (line 109) | def test_rescale_to_zero_one(self): function teardown_module (line 138) | def teardown_module(): FILE: tests/test_datasets/test_transforms/test_random_degradations.py function test_random_noise (line 10) | def test_random_noise(): function test_random_jpeg_compression (line 52) | def test_random_jpeg_compression(): function test_random_video_compression (line 73) | def test_random_video_compression(): function test_random_resize (line 100) | def test_random_resize(): function test_random_blur (line 203) | def test_random_blur(): function test_degradations_with_shuffle (line 341) | def test_degradations_with_shuffle(): function teardown_module (line 456) | def teardown_module(): FILE: tests/test_datasets/test_transforms/test_random_down_sampling.py function test_random_down_sampling (line 7) | def test_random_down_sampling(): function teardown_module (line 46) | def teardown_module(): FILE: tests/test_datasets/test_transforms/test_trimap.py function assert_keys_contain (line 12) | def assert_keys_contain(result_keys, target_keys): function generate_ref_trimap (line 17) | def generate_ref_trimap(alpha, kernel_size, iterations, random): function test_format_trimap (line 84) | def test_format_trimap(): function test_generate_trimap (line 114) | def test_generate_trimap(): function test_generate_trimap_with_dist_transform (line 178) | def test_generate_trimap_with_dist_transform(): function test_transform_trimap (line 207) | def test_transform_trimap(): function teardown_module (line 234) | def teardown_module(): FILE: tests/test_datasets/test_transforms/test_values.py class TestAugmentations (line 8) | class TestAugmentations: method setup_class (line 11) | def setup_class(cls): method test_copy_value (line 32) | def test_copy_value(self): method test_set_value (line 47) | def test_set_value(self): function teardown_module (line 66) | def teardown_module(): FILE: tests/test_datasets/test_unpaired_image_dataset.py class TestUnpairedImageDataset (line 10) | class TestUnpairedImageDataset(object): method setup_class (line 13) | def setup_class(cls): method test_unpaired_image_dataset (line 39) | def test_unpaired_image_dataset(self): function teardown_module (line 64) | def teardown_module(): FILE: tests/test_engine/test_hooks/test_ema.py class SimpleModule (line 14) | class SimpleModule(nn.Module): method __init__ (line 16) | def __init__(self): class SimpleModel (line 27) | class SimpleModel(nn.Module): method __init__ (line 29) | def __init__(self) -> None: class SimpleModelNoEMA (line 38) | class SimpleModelNoEMA(nn.Module): method __init__ (line 40) | def __init__(self) -> None: class SimpleRunner (line 46) | class SimpleRunner: method __init__ (line 48) | def __init__(self): class TestEMA (line 53) | class TestEMA: method setup_class (line 56) | def setup_class(cls): method test_ema_hook (line 64) | def test_ema_hook(self): method test_ema_hook_cuda (line 173) | def test_ema_hook_cuda(self): function teardown_module (line 257) | def teardown_module(): FILE: tests/test_engine/test_hooks/test_iter_time_hook.py function time_patch (line 10) | def time_patch(): class TestIterTimerHook (line 18) | class TestIterTimerHook(TestCase): method setUp (line 20) | def setUp(self) -> None: method test_init (line 23) | def test_init(self): method test_before_train (line 27) | def test_before_train(self): method test_before_epoch (line 33) | def test_before_epoch(self): method test_before_iter (line 39) | def test_before_iter(self): method test_after_iter (line 49) | def test_after_iter(self): function teardown_module (line 74) | def teardown_module(): FILE: tests/test_engine/test_hooks/test_pggan_fetch_data_hook.py class TestPGGANFetchDataHook (line 18) | class TestPGGANFetchDataHook(TestCase): method test_before_train_iter (line 56) | def test_before_train_iter(self): function teardown_module (line 136) | def teardown_module(): FILE: tests/test_engine/test_hooks/test_pickle_data_hook.py class ToyModel (line 11) | class ToyModel(nn.Module): method __init__ (line 13) | def __init__(self): function test_PickleDataHook (line 19) | def test_PickleDataHook(): function teardown_module (line 46) | def teardown_module(): FILE: tests/test_engine/test_hooks/test_reduce_lr_scheduler_hook.py class ToyModel (line 12) | class ToyModel(torch.nn.Module): method __init__ (line 14) | def __init__(self): method forward (line 19) | def forward(self, x): function test_reduce_lr_scheduler_hook (line 23) | def test_reduce_lr_scheduler_hook(): function teardown_module (line 118) | def teardown_module(): FILE: tests/test_engine/test_hooks/test_visualization_hook.py class TestBasicVisualizationHook (line 25) | class TestBasicVisualizationHook(TestCase): method setUp (line 27) | def setUp(self) -> None: method test_after_iter (line 55) | def test_after_iter(self): class TestVisualizationHook (line 86) | class TestVisualizationHook(TestCase): method test_init (line 91) | def test_init(self): method test_vis_sample_with_gan_alias (line 109) | def test_vis_sample_with_gan_alias(self): method test_vis_sample_with_translation_alias (line 154) | def test_vis_sample_with_translation_alias(self): method test_after_val_iter (line 342) | def test_after_val_iter(self): method test_after_train_iter (line 356) | def test_after_train_iter(self): method test_after_train_iter_contain_mul_elements (line 473) | def test_after_train_iter_contain_mul_elements(self): method test_after_test_iter (line 516) | def test_after_test_iter(self): function teardown_module (line 621) | def teardown_module(): FILE: tests/test_engine/test_optimizers/test_multi_optimizer_constructor.py class ToyModel (line 12) | class ToyModel(nn.Module): method __init__ (line 14) | def __init__(self) -> None: class TextEncoder (line 21) | class TextEncoder(nn.Module): method __init__ (line 23) | def __init__(self): class ToyModel2 (line 28) | class ToyModel2(nn.Module): method __init__ (line 30) | def __init__(self) -> None: function test_optimizer_constructor (line 39) | def test_optimizer_constructor(): function teardown_module (line 142) | def teardown_module(): FILE: tests/test_engine/test_optimizers/test_pggan_optimizer_constructor.py class TestPGGANOptimWrapperConstructor (line 15) | class TestPGGANOptimWrapperConstructor(TestCase): method test (line 39) | def test(self): function teardown_module (line 95) | def teardown_module(): FILE: tests/test_engine/test_optimizers/test_singan_optimizer_constructor.py class TestSinGANOptimWrapperConstructor (line 12) | class TestSinGANOptimWrapperConstructor(TestCase): method test (line 36) | def test(self): function teardown_module (line 65) | def teardown_module(): FILE: tests/test_engine/test_runner/test_log_processor.py class TestLogProcessor (line 7) | class TestLogProcessor: method setup (line 9) | def setup(self): method test_get_dataloader_size (line 23) | def test_get_dataloader_size(self): function teardown_module (line 31) | def teardown_module(): FILE: tests/test_engine/test_runner/test_loop_utils.py function test_is_evaluator (line 12) | def test_is_evaluator(): function test_update_and_check_evaluator (line 32) | def test_update_and_check_evaluator(): function teardown_module (line 67) | def teardown_module(): FILE: tests/test_engine/test_runner/test_multi_loops.py function build_dataloader (line 11) | def build_dataloader(loader, **kwargs): function build_metrics (line 21) | def build_metrics(metrics): function build_evaluator (line 30) | def build_evaluator(evaluator): function build_mock_runner (line 64) | def build_mock_runner(): class TestLoop (line 71) | class TestLoop(TestCase): method _test_init (line 73) | def _test_init(self, is_val): method test_init (line 119) | def test_init(self): method _test_run (line 123) | def _test_run(self, is_val): method test_run (line 205) | def test_run(self): function teardown_module (line 210) | def teardown_module(): FILE: tests/test_engine/test_schedulers/test_linear_lr_scheduler_with_interval.py class ToyModel (line 13) | class ToyModel(torch.nn.Module): method __init__ (line 15) | def __init__(self): method forward (line 20) | def forward(self, x): class TestLinearLrInterval (line 24) | class TestLinearLrInterval(TestCase): method setUp (line 26) | def setUp(self): method test_step (line 41) | def test_step(self): function teardown_module (line 59) | def teardown_module(): FILE: tests/test_engine/test_schedulers/test_reduce_lr_scheduler.py class ToyModel (line 13) | class ToyModel(torch.nn.Module): method __init__ (line 15) | def __init__(self): method forward (line 20) | def forward(self, x): class TestLRScheduler (line 24) | class TestLRScheduler(TestCase): method setUp (line 26) | def setUp(self): method test_reduce_lr_scheduler (line 36) | def test_reduce_lr_scheduler(self): function teardown_module (line 110) | def teardown_module(): FILE: tests/test_evaluation/test_evaluator.py class TestEvaluator (line 19) | class TestEvaluator(TestCase): method setUpClass (line 22) | def setUpClass(cls): method test_init (line 39) | def test_init(self): method test_prepare_metric (line 45) | def test_prepare_metric(self): method test_prepare_samplers (line 62) | def test_prepare_samplers(self): method test_process (line 145) | def test_process(self): method test_evaluate (line 166) | def test_evaluate(self): class TestNonMetricEvaluator (line 187) | class TestNonMetricEvaluator(TestCase): method test_init (line 189) | def test_init(self): method test_prepare_metrics (line 193) | def test_prepare_metrics(self): method test_prepare_samplers (line 198) | def test_prepare_samplers(self): method test_process (line 203) | def test_process(self): method test_evalute (line 207) | def test_evalute(self): function teardown_module (line 213) | def teardown_module(): FILE: tests/test_evaluation/test_functional/test_fid_inception.py class TestFIDInception (line 9) | class TestFIDInception: method setup_class (line 12) | def setup_class(cls): method test_fid_inception (line 15) | def test_fid_inception(self): method test_fid_inception_cuda (line 26) | def test_fid_inception_cuda(self): function test_load_fid_inception (line 38) | def test_load_fid_inception(): function teardown_module (line 46) | def teardown_module(): FILE: tests/test_evaluation/test_functional/test_gaussian_funcs.py function test_gauss_gradient (line 7) | def test_gauss_gradient(): function teardown_module (line 13) | def teardown_module(): FILE: tests/test_evaluation/test_functional/test_inception_utils.py function test_inception_feat_cache_name_args (line 11) | def test_inception_feat_cache_name_args(): function test_vgg_feat_cache_name_args (line 44) | def test_vgg_feat_cache_name_args(): function teardown_module (line 69) | def teardown_module(): FILE: tests/test_evaluation/test_metrics/test_base_gen_metric.py function mock_collect_fn (line 12) | def mock_collect_fn(results, *args, **kwargs): class ToyMetric (line 18) | class ToyMetric(GenMetric): method process (line 20) | def process(self, data_batch, data_samples): method compute_metrics (line 23) | def compute_metrics(self, results): class ToyGenerativeMetric (line 29) | class ToyGenerativeMetric(GenerativeMetric): method process (line 31) | def process(self, data_batch, data_samples): method compute_metrics (line 34) | def compute_metrics(self, results): function test_GenMetric (line 38) | def test_GenMetric(): function test_GenerativeMetric (line 68) | def test_GenerativeMetric(): function teardown_module (line 122) | def teardown_module(): FILE: tests/test_evaluation/test_metrics/test_base_sample_wise_metric.py class BaseSampleWiseMetricMock (line 14) | class BaseSampleWiseMetricMock(BaseSampleWiseMetric): method __init__ (line 18) | def __init__(self, *args, **kwargs): method process_image (line 21) | def process_image(self, *args, **kwargs): function test_compute_metrics (line 25) | def test_compute_metrics(): function test_process (line 40) | def test_process(): function test_prepare (line 69) | def test_prepare(): function teardown_module (line 93) | def teardown_module(): FILE: tests/test_evaluation/test_metrics/test_connectivity_error.py class TestMattingMetrics (line 13) | class TestMattingMetrics: method setup_class (line 16) | def setup_class(cls): method test_connectivity_error (line 72) | def test_connectivity_error(self): function teardown_module (line 109) | def teardown_module(): FILE: tests/test_evaluation/test_metrics/test_equivariance.py function process_fn (line 18) | def process_fn(data_batch, predictions): class TestEquivariance (line 29) | class TestEquivariance: method setup_class (line 32) | def setup_class(cls): method test_eq_cuda (line 54) | def test_eq_cuda(self): function teardown_module (line 72) | def teardown_module(): FILE: tests/test_evaluation/test_metrics/test_fid.py function process_fn (line 23) | def process_fn(data_batch, predictions): function construct_inception_pkl (line 31) | def construct_inception_pkl(inception_path): class inception_mock (line 42) | class inception_mock(nn.Module): method __init__ (line 44) | def __init__(self, style): method forward (line 48) | def forward(self, x, *args, **kwargs): class TestFID (line 56) | class TestFID(TestCase): method test_init (line 67) | def test_init(self): method test_prepare (line 92) | def test_prepare(self): method test_process_and_compute (line 120) | def test_process_and_compute(self): class TestTransFID (line 174) | class TestTransFID: method setup_class (line 185) | def setup_class(cls): method test_trans_fid_cuda (line 240) | def test_trans_fid_cuda(self): method test_trans_fid_cpu (line 261) | def test_trans_fid_cpu(self): function teardown_module (line 282) | def teardown_module(): FILE: tests/test_evaluation/test_metrics/test_gradient_error.py class TestMattingMetrics (line 13) | class TestMattingMetrics: method setup_class (line 16) | def setup_class(cls): method test_gradient_error (line 72) | def test_gradient_error(self): function teardown_module (line 106) | def teardown_module(): FILE: tests/test_evaluation/test_metrics/test_inception_score.py function process_fn (line 20) | def process_fn(data_batch, predictions): class inception_mock (line 28) | class inception_mock(nn.Module): method __init__ (line 30) | def __init__(self, style): method forward (line 34) | def forward(self, x, *args, **kwargs): class TestIS (line 42) | class TestIS(TestCase): method test_init (line 49) | def test_init(self): method test_process_and_compute (line 77) | def test_process_and_compute(self): class TestTransIS (line 129) | class TestTransIS: method setup_class (line 140) | def setup_class(cls): method test_trans_is_cuda (line 195) | def test_trans_is_cuda(self): method test_trans_is_cpu (line 215) | def test_trans_is_cpu(self): function teardown_module (line 235) | def teardown_module(): FILE: tests/test_evaluation/test_metrics/test_mae.py class TestPixelMetrics (line 10) | class TestPixelMetrics: method setup_class (line 13) | def setup_class(cls): method test_mae (line 37) | def test_mae(self): function teardown_module (line 54) | def teardown_module(): FILE: tests/test_evaluation/test_metrics/test_matting_mse.py class TestMattingMetrics (line 13) | class TestMattingMetrics: method setup_class (line 16) | def setup_class(cls): method test_mse (line 72) | def test_mse(self): function teardown_module (line 109) | def teardown_module(): FILE: tests/test_evaluation/test_metrics/test_metrics_utils.py function test_average (line 9) | def test_average(): function test_img_transform (line 22) | def test_img_transform(): function test_obtain_data (line 28) | def test_obtain_data(): function test_reorder_image (line 36) | def test_reorder_image(): function teardown_module (line 54) | def teardown_module(): FILE: tests/test_evaluation/test_metrics/test_ms_ssim.py class TestMS_SSIM (line 13) | class TestMS_SSIM(TestCase): method test_init (line 15) | def test_init(self): method test_process_and_evaluate (line 23) | def test_process_and_evaluate(self): function teardown_module (line 67) | def teardown_module(): FILE: tests/test_evaluation/test_metrics/test_mse.py class TestPixelMetrics (line 10) | class TestPixelMetrics: method setup_class (line 13) | def setup_class(cls): method test_mse (line 37) | def test_mse(self): function teardown_module (line 54) | def teardown_module(): FILE: tests/test_evaluation/test_metrics/test_niqe.py function test_niqe (line 12) | def test_niqe(): function test_calculate_niqe (line 51) | def test_calculate_niqe(): function teardown_module (line 85) | def teardown_module(): FILE: tests/test_evaluation/test_metrics/test_ppl.py function process_fn (line 19) | def process_fn(data_batch, predictions): class LPIPS_mock (line 27) | class LPIPS_mock: method __init__ (line 29) | def __init__(self, *args, **kwargs): method to (line 32) | def to(self, *args, **kwargs): method __call__ (line 35) | def __call__(self, x1, x2, *args, **kwargs): class TestPPL (line 40) | class TestPPL: method setup_class (line 43) | def setup_class(cls): method test_ppl_cuda (line 64) | def test_ppl_cuda(self): method test_ppl_cpu (line 99) | def test_ppl_cpu(self): function teardown_module (line 130) | def teardown_module(): FILE: tests/test_evaluation/test_metrics/test_precision_and_recall.py class vgg_pytorch_classifier (line 19) | class vgg_pytorch_classifier(nn.Module): method __init__ (line 21) | def __init__(self): method forward (line 24) | def forward(self, x): class vgg_mock (line 28) | class vgg_mock(nn.Module): method __init__ (line 30) | def __init__(self, style): method forward (line 37) | def forward(self, x, *args, **kwargs): class TestPR (line 44) | class TestPR: method setup_class (line 47) | def setup_class(cls): method test_pr_cuda (line 74) | def test_pr_cuda(self): method test_pr_cpu (line 87) | def test_pr_cpu(self): function teardown_module (line 102) | def teardown_module(): FILE: tests/test_evaluation/test_metrics/test_psnr.py class TestPixelMetrics (line 11) | class TestPixelMetrics: method setup_class (line 14) | def setup_class(cls): method test_psnr (line 38) | def test_psnr(self): function test_psnr (line 47) | def test_psnr(): function teardown_module (line 91) | def teardown_module(): FILE: tests/test_evaluation/test_metrics/test_sad.py class TestMattingMetrics (line 13) | class TestMattingMetrics: method setup_class (line 16) | def setup_class(cls): method test_sad (line 72) | def test_sad(self): function teardown_module (line 109) | def teardown_module(): FILE: tests/test_evaluation/test_metrics/test_snr.py class TestPixelMetrics (line 11) | class TestPixelMetrics: method setup_class (line 14) | def setup_class(cls): method test_snr (line 38) | def test_snr(self): function test_snr (line 47) | def test_snr(): function teardown_module (line 93) | def teardown_module(): FILE: tests/test_evaluation/test_metrics/test_ssim.py function test_ssim (line 11) | def test_ssim(): function test_calculate_ssim (line 45) | def test_calculate_ssim(): function teardown_module (line 79) | def teardown_module(): FILE: tests/test_evaluation/test_metrics/test_swd.py class TestSWD (line 13) | class TestSWD(TestCase): method test_init (line 15) | def test_init(self): method test_prosess (line 19) | def test_prosess(self): function teardown_module (line 90) | def teardown_module(): FILE: tests/test_models/test_archs/test_aspp.py function test_aspp (line 7) | def test_aspp(): function teardown_module (line 36) | def teardown_module(): FILE: tests/test_models/test_archs/test_conv.py function test_conv (line 5) | def test_conv(): function teardown_module (line 9) | def teardown_module(): FILE: tests/test_models/test_archs/test_downsample.py function test_pixel_unshuffle (line 8) | def test_pixel_unshuffle(): function teardown_module (line 26) | def teardown_module(): FILE: tests/test_models/test_archs/test_ensemble.py function test_ensemble_cpu (line 10) | def test_ensemble_cpu(): function test_ensemble_cuda (line 38) | def test_ensemble_cuda(): function teardown_module (line 70) | def teardown_module(): FILE: tests/test_models/test_archs/test_gated_conv_module.py function test_gated_conv (line 9) | def test_gated_conv(): function teardown_module (line 38) | def teardown_module(): FILE: tests/test_models/test_archs/test_img_normalize.py function test_normalize_layer (line 7) | def test_normalize_layer(): function teardown_module (line 25) | def teardown_module(): FILE: tests/test_models/test_archs/test_linear_module.py function test_linear_module (line 8) | def test_linear_module(): function teardown_module (line 51) | def teardown_module(): FILE: tests/test_models/test_archs/test_lora.py class ToyAttn (line 12) | class ToyAttn(nn.Module): method __init__ (line 14) | def __init__(self, in_dim, context_dim): method forward (line 20) | def forward(self, x, context=None): class ToySubModule (line 35) | class ToySubModule(nn.Module): method __init__ (line 37) | def __init__(self): method forward (line 42) | def forward(self, x, context=None): class ToyModel (line 48) | class ToyModel(nn.Module): method __init__ (line 50) | def __init__(self): method forward (line 55) | def forward(self, x, context=None): function test_set_lora (line 64) | def test_set_lora(): function teardown_module (line 131) | def teardown_module(): FILE: tests/test_models/test_archs/test_multi_layer_disc.py function test_multi_layer_disc (line 9) | def test_multi_layer_disc(): function teardown_module (line 90) | def teardown_module(): FILE: tests/test_models/test_archs/test_patch_disc.py function test_patch_discriminator (line 13) | def test_patch_discriminator(): function teardown_module (line 64) | def teardown_module(): FILE: tests/test_models/test_archs/test_resnet.py function test_resnet (line 7) | def test_resnet(): function teardown_module (line 21) | def teardown_module(): FILE: tests/test_models/test_archs/test_separable_conv_module.py function test_depthwise_separable_conv (line 9) | def test_depthwise_separable_conv(): function teardown_module (line 75) | def teardown_module(): FILE: tests/test_models/test_archs/test_simple_encoder_decoder.py function assert_dict_keys_equal (line 8) | def assert_dict_keys_equal(dictionary, target_keys): function assert_tensor_with_shape (line 14) | def assert_tensor_with_shape(tensor, shape): function test_encoder_decoder (line 20) | def test_encoder_decoder(): function _demo_inputs_pair (line 68) | def _demo_inputs_pair(img_shape=(64, 64), batch_size=1, cuda=False): function teardown_module (line 92) | def teardown_module(): FILE: tests/test_models/test_archs/test_smpatch_disc.py function test_smpatch_discriminator (line 10) | def test_smpatch_discriminator(): function teardown_module (line 50) | def teardown_module(): FILE: tests/test_models/test_archs/test_sr_backbone.py function test_sr_backbone_utils (line 8) | def test_sr_backbone_utils(): function teardown_module (line 15) | def teardown_module(): FILE: tests/test_models/test_archs/test_tokenizer.py class TestTokenizerWrapper (line 10) | class TestTokenizerWrapper(TestCase): method setUp (line 12) | def setUp(self): method test_encode_and_decode_and_call (line 26) | def test_encode_and_decode_and_call(self): function teardown_module (line 51) | def teardown_module(): FILE: tests/test_models/test_archs/test_upsample.py function test_pixel_shuffle (line 7) | def test_pixel_shuffle(): function teardown_module (line 24) | def teardown_module(): FILE: tests/test_models/test_archs/test_vgg.py function check_norm_state (line 12) | def check_norm_state(modules, train_state): function assert_tensor_with_shape (line 21) | def assert_tensor_with_shape(tensor, shape): function assert_mid_feat_shape (line 27) | def assert_mid_feat_shape(mid_feat, target_shape): function _demo_inputs (line 33) | def _demo_inputs(input_shape=(2, 4, 64, 64)): function test_vgg16_encoder (line 49) | def test_vgg16_encoder(): function teardown_module (line 134) | def teardown_module(): FILE: tests/test_models/test_archs/test_wrapper.py class TestWrapper (line 24) | class TestWrapper(TestCase): method test_build (line 26) | def test_build(self): function teardown_module (line 117) | def teardown_module(): FILE: tests/test_models/test_base_models/test_average_model.py class ToyModule (line 14) | class ToyModule(nn.Module): method __init__ (line 16) | def __init__(self): method update_buffer (line 21) | def update_buffer(self): method update_params (line 25) | def update_params(self): method update (line 29) | def update(self): method forward (line 33) | def forward(self, x): class ToyModel_old (line 37) | class ToyModel_old(BaseModel): method __init__ (line 39) | def __init__(self): method forward (line 44) | def forward(self, x): class ToyEMAModel (line 48) | class ToyEMAModel(nn.Module): method __init__ (line 50) | def __init__(self): method forward (line 54) | def forward(self, x): class ToyModel (line 58) | class ToyModel(BaseModel): method __init__ (line 60) | def __init__(self): method forward (line 65) | def forward(self, x): class TestExponentialMovingAverage (line 69) | class TestExponentialMovingAverage(TestCase): method setUpClass (line 72) | def setUpClass(cls): method test_init (line 76) | def test_init(self): method test_avg_func (line 100) | def test_avg_func(self): method test_sync_buffer_and_parameters (line 111) | def test_sync_buffer_and_parameters(self): method test_load_from_state_dict (line 131) | def test_load_from_state_dict(self): class TestRamUpEMA (line 148) | class TestRamUpEMA(TestCase): method setUpClass (line 151) | def setUpClass(cls): method test_init (line 156) | def test_init(self): method test_avg_func (line 161) | def test_avg_func(self): method test_sync_buffer_and_parameters (line 186) | def test_sync_buffer_and_parameters(self): method test_load_from_state_dict (line 206) | def test_load_from_state_dict(self): function teardown_module (line 222) | def teardown_module(): FILE: tests/test_models/test_base_models/test_base_conditional_gan.py class ToyCGAN (line 34) | class ToyCGAN(BaseConditionalGAN): method __init__ (line 36) | def __init__(self, *args, **kwargs): method train_generator (line 39) | def train_generator(self, inputs, data_samples, optimizer_wrapper): method train_discriminator (line 42) | def train_discriminator(self, inputs, data_samples, optimizer_wrapper): class TestBaseGAN (line 46) | class TestBaseGAN(TestCase): method test_val_step_and_test_step (line 48) | def test_val_step_and_test_step(self): method test_forward (line 102) | def test_forward(self): method test_custom_loss (line 171) | def test_custom_loss(self): function teardown_module (line 292) | def teardown_module(): FILE: tests/test_models/test_base_models/test_base_edit_model.py class ToyBaseModel (line 17) | class ToyBaseModel(nn.Module): method __init__ (line 20) | def __init__(self): method forward (line 24) | def forward(self, x): method init_weights (line 27) | def init_weights(self, pretrained=None): function test_base_edit_model (line 31) | def test_base_edit_model(): function teardown_module (line 68) | def teardown_module(): FILE: tests/test_models/test_base_models/test_base_gan.py class ToyGAN (line 29) | class ToyGAN(BaseGAN): method __init__ (line 31) | def __init__(self, *args, **kwargs): method train_generator (line 34) | def train_generator(self, inputs, data_samples, optimizer_wrapper): method train_discriminator (line 37) | def train_discriminator(self, inputs, data_samples, optimizer_wrapper): class TestBaseGAN (line 41) | class TestBaseGAN(TestCase): method test_init (line 43) | def test_init(self): method test_train_step (line 83) | def test_train_step(self): method test_update_ema (line 131) | def test_update_ema(self): method test_val_step_and_test_step (line 187) | def test_val_step_and_test_step(self): method test_forward (line 232) | def test_forward(self): method test_custom_loss (line 297) | def test_custom_loss(self): method test_gather_log_vars (line 407) | def test_gather_log_vars(self): function teardown_module (line 432) | def teardown_module(): FILE: tests/test_models/test_base_models/test_base_mattor.py function _get_model_cfg (line 20) | def _get_model_cfg(fname): function _demo_input_train (line 34) | def _demo_input_train(img_shape, batch_size=1, cuda=False, meta={}): function _demo_input_test (line 73) | def _demo_input_test(img_shape, batch_size=1, cuda=False, meta={}): function assert_pred_alpha (line 109) | def assert_pred_alpha(predictions, batch_size): function assert_dict_keys_equal (line 118) | def assert_dict_keys_equal(dictionary, target_keys): function test_base_mattor (line 125) | def test_base_mattor(): function test_dim_config (line 154) | def test_dim_config(): function test_dim (line 211) | def test_dim(): function test_indexnet (line 318) | def test_indexnet(): function test_gca (line 391) | def test_gca(): function teardown_module (line 466) | def teardown_module(): FILE: tests/test_models/test_base_models/test_base_translation_model.py class ToyTranslationModel (line 11) | class ToyTranslationModel(BaseTranslationModel): method __init__ (line 13) | def __init__(self, generator, discriminator=None): class TestBaseTranslationModel (line 23) | class TestBaseTranslationModel(TestCase): method setUpClass (line 26) | def setUpClass(cls): method test_init (line 45) | def test_init(self): method test_get_module (line 56) | def test_get_module(self): method test_forward (line 66) | def test_forward(self): function teardown_module (line 75) | def teardown_module(): FILE: tests/test_models/test_base_models/test_basic_interpolator.py class InterpolateExample (line 11) | class InterpolateExample(nn.Module): method __init__ (line 14) | def __init__(self): method forward (line 18) | def forward(self, x): method init_weights (line 21) | def init_weights(self, pretrained=None): function test_basic_interpolator (line 25) | def test_basic_interpolator(): function teardown_module (line 44) | def teardown_module(): FILE: tests/test_models/test_base_models/test_one_stage.py function test_one_stage_inpaintor (line 16) | def test_one_stage_inpaintor(): function teardown_module (line 106) | def teardown_module(): FILE: tests/test_models/test_base_models/test_two_stage.py function test_two_stage_inpaintor (line 21) | def test_two_stage_inpaintor(): function teardown_module (line 114) | def teardown_module(): FILE: tests/test_models/test_data_preprocessors/test_data_preprocessor.py class TestBaseDataPreprocessor (line 12) | class TestBaseDataPreprocessor(TestCase): method test_init (line 14) | def test_init(self): method test_parse_channel_index (line 42) | def test_parse_channel_index(self): method test_parse_channel_order (line 61) | def test_parse_channel_order(self): method test_parse_batch_channel_order (line 139) | def test_parse_batch_channel_order(self): method test_do_conversion (line 160) | def test_do_conversion(self): method test_update_metainfo (line 220) | def test_update_metainfo(self): method test_preprocess_image_tensor (line 252) | def test_preprocess_image_tensor(self): method test_preprocess_image_list (line 344) | def test_preprocess_image_list(self): method test_preprocess_dict_inputs (line 468) | def test_preprocess_dict_inputs(self): method test_prerprocess_data_sample (line 525) | def test_prerprocess_data_sample(self): method test_destruct_tensor_norm_and_conversion (line 583) | def test_destruct_tensor_norm_and_conversion(self): method test_destruct_tensor_padding (line 632) | def test_destruct_tensor_padding(self): method test_forward (line 718) | def test_forward(self): method test_destruct (line 832) | def test_destruct(self): function teardown_module (line 881) | def teardown_module(): FILE: tests/test_models/test_data_preprocessors/test_mattor_preprocessor.py function test_mattor_preprocessor (line 10) | def test_mattor_preprocessor(): function teardown_module (line 59) | def teardown_module(): FILE: tests/test_models/test_diffusion_schedulers/test_ddim_scheduler.py function test_ddim (line 8) | def test_ddim(): function test_ddim_init (line 24) | def test_ddim_init(): function test_ddim_step (line 37) | def test_ddim_step(): function teardown_module (line 51) | def teardown_module(): FILE: tests/test_models/test_diffusion_schedulers/test_init.py class TestWrapper (line 12) | class TestWrapper(TestCase): method test_build (line 14) | def test_build(self): function teardown_module (line 51) | def teardown_module(): FILE: tests/test_models/test_editors/test_animatediff/test_animatediff.py class TestAnimateDiff (line 71) | class TestAnimateDiff(TestCase): method setUp (line 73) | def setUp(self): method test_infer (line 85) | def test_infer(self): FILE: tests/test_models/test_editors/test_animatediff/test_attention3d.py function test_crossattention (line 11) | def test_crossattention(): function test_Transformer3DModel_init (line 24) | def test_Transformer3DModel_init(): FILE: tests/test_models/test_editors/test_animatediff/test_motion_module.py function test_VanillaTemporalModule (line 14) | def test_VanillaTemporalModule(): function test_FeedForward (line 23) | def test_FeedForward(): FILE: tests/test_models/test_editors/test_animatediff/test_res_blocks3d.py function test_resnetblock3d (line 15) | def test_resnetblock3d(): function test_Downsample3D (line 25) | def test_Downsample3D(): function test_Upsample3D (line 35) | def test_Upsample3D(): FILE: tests/test_models/test_editors/test_animatediff/test_unet3d.py function test_Unet3D (line 37) | def test_Unet3D(): FILE: tests/test_models/test_editors/test_animatediff/test_unet_blocks3d.py function test_UNetMidBlock3DCrossAttn (line 15) | def test_UNetMidBlock3DCrossAttn(): function test_CrossAttnDownBlock3D (line 27) | def test_CrossAttnDownBlock3D(): function test_CrossAttnUpBlock3D (line 40) | def test_CrossAttnUpBlock3D(): function test_get_down_block (line 54) | def test_get_down_block(): function test_get_up_block (line 59) | def test_get_up_block(): FILE: tests/test_models/test_editors/test_aotgan/test_aot_decoder.py function test_gl_dec (line 10) | def test_gl_dec(): function teardown_module (line 21) | def teardown_module(): FILE: tests/test_models/test_editors/test_aotgan/test_aot_encoder.py function test_gl_enc (line 10) | def test_gl_enc(): function teardown_module (line 21) | def teardown_module(): FILE: tests/test_models/test_editors/test_aotgan/test_aot_encoder_decoder.py function test_gl_encdec (line 10) | def test_gl_encdec(): function teardown_module (line 39) | def teardown_module(): FILE: tests/test_models/test_editors/test_aotgan/test_aot_inpaintor.py function test_aot_inpaintor (line 14) | def test_aot_inpaintor(): function teardown_module (line 79) | def teardown_module(): FILE: tests/test_models/test_editors/test_aotgan/test_aot_neck.py function test_aot_dilation_neck (line 7) | def test_aot_dilation_neck(): function teardown_module (line 23) | def teardown_module(): FILE: tests/test_models/test_editors/test_arcface/test_arcface_modules.py function test_get_blocks (line 14) | def test_get_blocks(): function teardown_module (line 24) | def teardown_module(): FILE: tests/test_models/test_editors/test_arcface/test_id_loss.py class TestArcFace (line 10) | class TestArcFace: method setup_class (line 13) | def setup_class(cls): method test_arcface_cpu (line 24) | def test_arcface_cpu(self): method test_arcface_cuda (line 33) | def test_arcface_cuda(self): function teardown_module (line 42) | def teardown_module(): FILE: tests/test_models/test_editors/test_arcface/test_model_irse.py class TestIRSEModel (line 11) | class TestIRSEModel: method setup_class (line 14) | def setup_class(cls): method test_arcface_cpu (line 25) | def test_arcface_cpu(self): method test_arcface_cuda (line 72) | def test_arcface_cuda(self): function teardown_module (line 119) | def teardown_module(): FILE: tests/test_models/test_editors/test_basicvsr/test_basicvsr.py function test_basicvsr (line 12) | def test_basicvsr(): function teardown_module (line 84) | def teardown_module(): FILE: tests/test_models/test_editors/test_basicvsr/test_basicvsr_net.py function test_basicvsr_net (line 7) | def test_basicvsr_net(): function teardown_module (line 32) | def teardown_module(): FILE: tests/test_models/test_editors/test_basicvsr_plusplus_net/test_basicvsr_plusplus_net.py function test_basicvsr_plusplus_cpu (line 13) | def test_basicvsr_plusplus_cpu(): function test_basicvsr_plusplus_cuda (line 57) | def test_basicvsr_plusplus_cuda(): function teardown_module (line 97) | def teardown_module(): FILE: tests/test_models/test_editors/test_biggan/test_biggan.py class TestBigGAN (line 39) | class TestBigGAN(TestCase): method test_init (line 41) | def test_init(self): method test_train_step (line 90) | def test_train_step(self): function teardown_module (line 137) | def teardown_module(): FILE: tests/test_models/test_editors/test_biggan/test_biggan_deep_discriminator.py class TestBigGANDeepDiscriminator (line 11) | class TestBigGANDeepDiscriminator(object): method setup_class (line 14) | def setup_class(cls): method test_biggan_deep_discriminator (line 24) | def test_biggan_deep_discriminator(self): method test_biggan_deep_discriminator_cuda (line 66) | def test_biggan_deep_discriminator_cuda(self): function teardown_module (line 108) | def teardown_module(): FILE: tests/test_models/test_editors/test_biggan/test_biggan_deep_generator.py class TestBigGANDeepGenerator (line 15) | class TestBigGANDeepGenerator(object): method setup_class (line 18) | def setup_class(cls): method test_biggan_deep_generator (line 28) | def test_biggan_deep_generator(self): method test_biggan_deep_generator_cuda (line 141) | def test_biggan_deep_generator_cuda(self): function teardown_module (line 233) | def teardown_module(): FILE: tests/test_models/test_editors/test_biggan/test_biggan_discriminator.py class TestBigGANDiscriminator (line 11) | class TestBigGANDiscriminator(object): method setup_class (line 14) | def setup_class(cls): method test_biggan_discriminator (line 24) | def test_biggan_discriminator(self): method test_biggan_discriminator_cuda (line 75) | def test_biggan_discriminator_cuda(self): function teardown_module (line 125) | def teardown_module(): FILE: tests/test_models/test_editors/test_biggan/test_biggan_generator.py class TestBigGANGenerator (line 15) | class TestBigGANGenerator(object): method setup_class (line 18) | def setup_class(cls): method test_biggan_generator (line 28) | def test_biggan_generator(self): method test_biggan_generator_cuda (line 142) | def test_biggan_generator_cuda(self): function teardown_module (line 237) | def teardown_module(): FILE: tests/test_models/test_editors/test_biggan/test_biggan_modules.py class TestBigGANDeepGenResBlock (line 19) | class TestBigGANDeepGenResBlock: method setup_class (line 22) | def setup_class(cls): method test_biggan_deep_gen_res_block (line 40) | def test_biggan_deep_gen_res_block(self): method test_biggan_deep_gen_res_block_cuda (line 69) | def test_biggan_deep_gen_res_block_cuda(self): class TestBigGANDeepDiscResBlock (line 98) | class TestBigGANDeepDiscResBlock: method setup_class (line 101) | def setup_class(cls): method test_biggan_deep_disc_res_block (line 113) | def test_biggan_deep_disc_res_block(self): method test_biggan_deep_disc_res_block_cuda (line 142) | def test_biggan_deep_disc_res_block_cuda(self): class TestBigGANConditionBN (line 171) | class TestBigGANConditionBN: method setup_class (line 174) | def setup_class(cls): method test_biggan_condition_bn (line 183) | def test_biggan_condition_bn(self): method test_biggan_condition_bn_cuda (line 220) | def test_biggan_condition_bn_cuda(self): class TestSelfAttentionBlock (line 250) | class TestSelfAttentionBlock: method setup_class (line 253) | def setup_class(cls): method test_self_attention_block (line 257) | def test_self_attention_block(self): method test_self_attention_block_cuda (line 280) | def test_self_attention_block_cuda(self): class TestBigGANGenResBlock (line 303) | class TestBigGANGenResBlock: method setup_class (line 306) | def setup_class(cls): method test_biggan_gen_res_block (line 322) | def test_biggan_gen_res_block(self): method test_biggan_gen_res_block_cuda (line 351) | def test_biggan_gen_res_block_cuda(self): class TestBigGANDiscResBlock (line 380) | class TestBigGANDiscResBlock: method setup_class (line 383) | def setup_class(cls): method test_biggan_disc_res_block (line 395) | def test_biggan_disc_res_block(self): method test_biggan_disc_res_block_cuda (line 417) | def test_biggan_disc_res_block_cuda(self): function teardown_module (line 439) | def teardown_module(): FILE: tests/test_models/test_editors/test_biggan/test_biggan_snmodule.py class MyBlock (line 8) | class MyBlock(nn.Module): method __init__ (line 10) | def __init__(self, num_channels): method forward (line 14) | def forward(self, x): class MySNBlock (line 18) | class MySNBlock(MyBlock, SpectralNorm): method __init__ (line 20) | def __init__(self, num_channels): method forward (line 25) | def forward(self, x): function test_SpectralNorm (line 30) | def test_SpectralNorm(): function teardown_module (line 37) | def teardown_module(): FILE: tests/test_models/test_editors/test_cain/test_cain.py function test_cain_net_cpu (line 19) | def test_cain_net_cpu(): function test_cain_net_cuda (line 57) | def test_cain_net_cuda(): function test_cain (line 95) | def test_cain(): function teardown_module (line 131) | def teardown_module(): FILE: tests/test_models/test_editors/test_cain/test_cain_net.py function test_cain_net_cpu (line 13) | def test_cain_net_cpu(): function test_cain_net_cuda (line 51) | def test_cain_net_cuda(): function teardown_module (line 86) | def teardown_module(): FILE: tests/test_models/test_editors/test_controlnet/test_controlnet.py class TestControlStableDiffusion (line 64) | class TestControlStableDiffusion(TestCase): method setUp (line 66) | def setUp(self): method test_init_weights (line 78) | def test_init_weights(self): method test_infer (line 93) | def test_infer(self): method _test_infer (line 124) | def _test_infer(self, control_sd, num_prompt, num_control, num_repeat, method test_val_step (line 139) | def test_val_step(self): method test_test_step (line 169) | def test_test_step(self): method test_train_step (line 199) | def test_train_step(self): function teardown_module (line 229) | def teardown_module(): FILE: tests/test_models/test_editors/test_controlnet/test_controlnet_utils.py function make_state_dict (line 12) | def make_state_dict(d): function check_state_dict (line 19) | def check_state_dict(s1, s2): function parameters (line 26) | def parameters(model): function test_change_base_model (line 32) | def test_change_base_model(): function teardown_module (line 72) | def teardown_module(): FILE: tests/test_models/test_editors/test_cyclegan/test_cyclegan.py function obj_from_dict (line 15) | def obj_from_dict(info: dict, parent=None, default_args=None): function test_cyclegan (line 51) | def test_cyclegan(): function teardown_module (line 335) | def teardown_module(): FILE: tests/test_models/test_editors/test_cyclegan/test_cyclegan_generator.py class TestResnetGenerator (line 14) | class TestResnetGenerator: method setup_class (line 17) | def setup_class(cls): method test_cyclegan_generator_cpu (line 28) | def test_cyclegan_generator_cpu(self): method test_cyclegan_generator_cuda (line 43) | def test_cyclegan_generator_cuda(self): function teardown_module (line 58) | def teardown_module(): FILE: tests/test_models/test_editors/test_cyclegan/test_cyclegan_modules.py function test_residual_block_with_dropout (line 9) | def test_residual_block_with_dropout(): function test_gan_image_buffer (line 19) | def test_gan_image_buffer(): function teardown_module (line 79) | def teardown_module(): FILE: tests/test_models/test_editors/test_dcgan/test_dcgan.py class TestDCGAN (line 20) | class TestDCGAN(TestCase): method test_init (line 22) | def test_init(self): method test_train_step (line 58) | def test_train_step(self): function teardown_module (line 100) | def teardown_module(): FILE: tests/test_models/test_editors/test_dcgan/test_dcgan_discriminator.py class TestDCGANDiscriminator (line 9) | class TestDCGANDiscriminator(object): method setup_class (line 12) | def setup_class(cls): method test_dcgan_discriminator (line 20) | def test_dcgan_discriminator(self): function teardown_module (line 60) | def teardown_module(): FILE: tests/test_models/test_editors/test_dcgan/test_dcgan_generator.py class TestDCGANGenerator (line 9) | class TestDCGANGenerator(object): method setup_class (line 12) | def setup_class(cls): method test_dcgan_generator (line 17) | def test_dcgan_generator(self): function teardown_module (line 100) | def teardown_module(): FILE: tests/test_models/test_editors/test_ddpm/test_attention.py function test_ApproximateGELU (line 10) | def test_ApproximateGELU(): function test_crossattention (line 17) | def test_crossattention(): function test_Transformer2DModel_init (line 25) | def test_Transformer2DModel_init(): function test_FeedForward (line 35) | def test_FeedForward(): function teardown_module (line 42) | def teardown_module(): FILE: tests/test_models/test_editors/test_ddpm/test_ddpm_scheduler.py function test_ddpm (line 8) | def test_ddpm(): function test_ddpm_init (line 34) | def test_ddpm_init(): function teardown_module (line 45) | def teardown_module(): FILE: tests/test_models/test_editors/test_ddpm/test_denoising_unet.py function test_DenoisingUnet (line 8) | def test_DenoisingUnet(): function test_NormWithEmbedding (line 15) | def test_NormWithEmbedding(): function teardown_module (line 23) | def teardown_module(): FILE: tests/test_models/test_editors/test_ddpm/test_embeddings.py function test_TimestepEmbedding (line 7) | def test_TimestepEmbedding(): function test_Timesteps (line 21) | def test_Timesteps(): function teardown_module (line 28) | def teardown_module(): FILE: tests/test_models/test_editors/test_ddpm/test_res_blocks.py function test_resnetblock2d (line 8) | def test_resnetblock2d(): function test_Downsample2D (line 19) | def test_Downsample2D(): function test_Upsample2D (line 26) | def test_Upsample2D(): function teardown_module (line 37) | def teardown_module(): FILE: tests/test_models/test_editors/test_ddpm/test_unet_blocks.py function test_UNetMidBlock2DCrossAttn (line 12) | def test_UNetMidBlock2DCrossAttn(): function test_CrossAttnDownBlock2D (line 23) | def test_CrossAttnDownBlock2D(): function test_CrossAttnUpBlock2D (line 34) | def test_CrossAttnUpBlock2D(): function test_get_down_block (line 39) | def test_get_down_block(): function get_get_up_block (line 44) | def get_get_up_block(): function teardown_module (line 49) | def teardown_module(): FILE: tests/test_models/test_editors/test_deblurganv2/test_deblurganv2.py class TestDeblurGanV2 (line 37) | class TestDeblurGanV2(TestCase): method test_init (line 39) | def test_init(self): method test_train_step (line 79) | def test_train_step(self): function teardown_module (line 129) | def teardown_module(): FILE: tests/test_models/test_editors/test_deblurganv2/test_deblurganv2_discriminator.py class TestDeblurGanv2Discriminator (line 16) | class TestDeblurGanv2Discriminator(object): method setup_class (line 19) | def setup_class(cls): method test_deblurganv2_discriminator (line 27) | def test_deblurganv2_discriminator(self): function teardown_module (line 61) | def teardown_module(): FILE: tests/test_models/test_editors/test_deblurganv2/test_deblurganv2_generator.py class TestDeblurGanv2Generator (line 16) | class TestDeblurGanv2Generator(object): method setup_class (line 19) | def setup_class(cls): method test_deblurganv2_generator (line 29) | def test_deblurganv2_generator(self): function teardown_module (line 69) | def teardown_module(): FILE: tests/test_models/test_editors/test_deepfillv1/test_contextual_attention.py function test_deepfill_contextual_attention_module (line 7) | def test_deepfill_contextual_attention_module(): function teardown_module (line 17) | def teardown_module(): FILE: tests/test_models/test_editors/test_deepfillv1/test_contextual_attention_neck.py function test_deepfill_contextual_attention_neck (line 8) | def test_deepfill_contextual_attention_neck(): function teardown_module (line 35) | def teardown_module(): FILE: tests/test_models/test_editors/test_deepfillv1/test_deepfill_decoder.py function test_deepfill_dec (line 7) | def test_deepfill_dec(): function teardown_module (line 45) | def teardown_module(): FILE: tests/test_models/test_editors/test_deepfillv1/test_deepfill_disc.py function test_deepfillv1_disc (line 9) | def test_deepfillv1_disc(): function teardown_module (line 54) | def teardown_module(): FILE: tests/test_models/test_editors/test_deepfillv1/test_deepfill_encoder.py function test_deepfill_enc (line 8) | def test_deepfill_enc(): function teardown_module (line 86) | def teardown_module(): FILE: tests/test_models/test_editors/test_deepfillv1/test_deepfill_refiner.py function test_deepfill_refiner (line 9) | def test_deepfill_refiner(): function teardown_module (line 44) | def teardown_module(): FILE: tests/test_models/test_editors/test_deepfillv1/test_deepfillv1.py function test_deepfill_encdec (line 15) | def test_deepfill_encdec(): function test_deepfillv1_inpaintor (line 34) | def test_deepfillv1_inpaintor(): function teardown_module (line 104) | def teardown_module(): FILE: tests/test_models/test_editors/test_deepfillv2/test_two_stage_encoder_decoder.py function test_two_stage_inpaintor (line 19) | def test_two_stage_inpaintor(): function teardown_module (line 110) | def teardown_module(): FILE: tests/test_models/test_editors/test_dic/test_dic.py function test_dic (line 15) | def test_dic(init_weights): function teardown_module (line 84) | def teardown_module(): FILE: tests/test_models/test_editors/test_dic/test_dic_net.py function test_feedback_block (line 13) | def test_feedback_block(): function test_feedback_block_custom (line 23) | def test_feedback_block_custom(): function test_feedback_block_heatmap_attention (line 31) | def test_feedback_block_heatmap_attention(): function test_dic_net_cpu (line 45) | def test_dic_net_cpu(): function test_dic_net_cuda (line 90) | def test_dic_net_cuda(): function teardown_module (line 129) | def teardown_module(): FILE: tests/test_models/test_editors/test_dic/test_feedback_hour_glass.py function test_res_block (line 10) | def test_res_block(): function test_hour_glass (line 23) | def test_hour_glass(): function test_feedback_hour_glass (line 30) | def test_feedback_hour_glass(): function test_reduce_to_five_heatmaps (line 46) | def test_reduce_to_five_heatmaps(): function teardown_module (line 70) | def teardown_module(): FILE: tests/test_models/test_editors/test_dic/test_light_cnn.py function test_max_feature (line 14) | def test_max_feature(): function test_light_cnn (line 42) | def test_light_cnn(): function teardown_module (line 56) | def teardown_module(): FILE: tests/test_models/test_editors/test_dim/test_dim.py function _demo_input_train (line 21) | def _demo_input_train(img_shape, batch_size=1, cuda=False, meta={}): function _demo_input_test (line 68) | def _demo_input_test(img_shape, batch_size=1, cuda=False, meta={}): function assert_pred_alpha (line 107) | def assert_pred_alpha(predictions, batch_size): function assert_dict_keys_equal (line 116) | def assert_dict_keys_equal(dictionary, target_keys): function test_dim_config (line 125) | def test_dim_config(): function test_dim (line 182) | def test_dim(): function teardown_module (line 289) | def teardown_module(): FILE: tests/test_models/test_editors/test_disco_diffusion/test_disco_diffusion.py class clip_mock (line 19) | class clip_mock(nn.Module): method __init__ (line 21) | def __init__(self, device='cuda'): method encode_image (line 25) | def encode_image(self, inputs): method encode_text (line 29) | def encode_text(self, inputs): method forward (line 32) | def forward(self, x): class clip_mock_wrapper (line 36) | class clip_mock_wrapper(nn.Module): method __init__ (line 38) | def __init__(self): method forward (line 42) | def forward(self, x): class TestDiscoDiffusion (line 46) | class TestDiscoDiffusion(TestCase): method setUp (line 48) | def setUp(self): method test_init (line 75) | def test_init(self): method test_infer (line 90) | def test_infer(self): function teardown_module (line 251) | def teardown_module(): FILE: tests/test_models/test_editors/test_disco_diffusion/test_disco_diffusion_clip_wrapper.py class TestClipWrapper (line 14) | class TestClipWrapper(TestCase): method test_clip_not_installed (line 16) | def test_clip_not_installed(self): method test_open_clip_not_installed (line 21) | def test_open_clip_not_installed(self): method test_transformers_not_installed (line 26) | def test_transformers_not_installed(self): method test_clip_load (line 32) | def test_clip_load(self, mock_clip_load): method test_open_clip_load (line 41) | def test_open_clip_load(self): method test_huggingface_load (line 55) | def test_huggingface_load(self, mock_from_pretrained): function test_embedding_layer_with_fixes (line 71) | def test_embedding_layer_with_fixes(): function teardown_module (line 120) | def teardown_module(): FILE: tests/test_models/test_editors/test_dreambooth/test_dreambooth.py class TestControlStableDiffusion (line 61) | class TestControlStableDiffusion(TestCase): method setUp (line 63) | def setUp(self): method test_val_step (line 74) | def test_val_step(self): method test_test_step (line 99) | def test_test_step(self): method test_train_step (line 124) | def test_train_step(self): function teardown_module (line 150) | def teardown_module(): FILE: tests/test_models/test_editors/test_duf/test_duf.py function test_dynamic_upsampling_filter (line 8) | def test_dynamic_upsampling_filter(): function teardown_module (line 38) | def teardown_module(): FILE: tests/test_models/test_editors/test_edsr/test_edsr_net.py function test_edsr_cpu (line 10) | def test_edsr_cpu(): function test_edsr_cuda (line 59) | def test_edsr_cuda(): function teardown_module (line 88) | def teardown_module(): FILE: tests/test_models/test_editors/test_edvr/test_edvr.py function test_edvr (line 15) | def test_edvr(): function teardown_module (line 75) | def teardown_module(): FILE: tests/test_models/test_editors/test_edvr/test_edvr_net.py function test_pcd_alignment (line 9) | def test_pcd_alignment(): function test_tsa_fusion (line 42) | def test_tsa_fusion(): function test_edvr_net (line 60) | def test_edvr_net(): function teardown_module (line 138) | def teardown_module(): FILE: tests/test_models/test_editors/test_eg3d/test_camera.py class TestBaseCamera (line 14) | class TestBaseCamera(TestCase): method setUp (line 16) | def setUp(self): method test_init (line 25) | def test_init(self): method test_repr (line 48) | def test_repr(self): method test_sample_intrinsic (line 69) | def test_sample_intrinsic(self): method test_sample_camera2world (line 109) | def test_sample_camera2world(self): method test_sample_in_range (line 123) | def test_sample_in_range(self): class TestUniformCamera (line 131) | class TestUniformCamera(TestCase): method setUp (line 133) | def setUp(self): method test_init (line 142) | def test_init(self): method test_repr (line 147) | def test_repr(self): class TestGaussianCamera (line 154) | class TestGaussianCamera(TestCase): method setUp (line 156) | def setUp(self): method test_init (line 165) | def test_init(self): method test_repr (line 170) | def test_repr(self): function teardown_module (line 177) | def teardown_module(): FILE: tests/test_models/test_editors/test_eg3d/test_dual_discriminator.py class TestEG3DDiscriminator (line 12) | class TestEG3DDiscriminator(TestCase): method setUp (line 14) | def setUp(self): method test_init (line 17) | def test_init(self): method test_forward (line 33) | def test_forward(self): function teardown_module (line 89) | def teardown_module(): FILE: tests/test_models/test_editors/test_eg3d/test_eg3d.py class TestEG3D (line 16) | class TestEG3D(TestCase): method setUp (line 18) | def setUp(self): method test_init (line 55) | def test_init(self): method test_label_fn (line 74) | def test_label_fn(self): method _check_datasample_output (line 85) | def _check_datasample_output(self, outputs, out_size, n_points): method _check_dict_output (line 97) | def _check_dict_output(self, outputs, out_size, n_points, bz): method test_forward (line 110) | def test_forward(self): method test_interpolation (line 145) | def test_interpolation(self): function teardown_module (line 173) | def teardown_module(): FILE: tests/test_models/test_editors/test_eg3d/test_eg3d_generator.py class TestEG3DGenerator (line 11) | class TestEG3DGenerator(TestCase): method setUp (line 13) | def setUp(self): method test_init (line 35) | def test_init(self): method test_forward (line 55) | def test_forward(self): function teardown_module (line 80) | def teardown_module(): FILE: tests/test_models/test_editors/test_eg3d/test_eg3d_modules.py class TestTriPlaneBackbone (line 11) | class TestTriPlaneBackbone(TestCase): method setUp (line 13) | def setUp(self): method test_init (line 25) | def test_init(self): method test_mapping (line 31) | def test_mapping(self): method test_synthesis (line 64) | def test_synthesis(self): class TestSuperResolutionModule (line 75) | class TestSuperResolutionModule(TestCase): method setUp (line 77) | def setUp(self): method test_init (line 86) | def test_init(self): method test_forward (line 98) | def test_forward(self): function teardown_module (line 128) | def teardown_module(): FILE: tests/test_models/test_editors/test_eg3d/test_eg3d_utils.py function test_get_ray_limits_box_and_linspace_batch (line 9) | def test_get_ray_limits_box_and_linspace_batch(): function test_inverse_transform_sampling (line 21) | def test_inverse_transform_sampling(): function teardown_module (line 37) | def teardown_module(): FILE: tests/test_models/test_editors/test_eg3d/test_ray_sampler.py function test_sample_rays (line 7) | def test_sample_rays(): function teardown_module (line 37) | def teardown_module(): FILE: tests/test_models/test_editors/test_eg3d/test_renderer.py class TestEG3DRenderer (line 11) | class TestEG3DRenderer(TestCase): method setUp (line 13) | def setUp(self) -> None: method test_init (line 33) | def test_init(self): method test_forward (line 40) | def test_forward(self): function teardown_module (line 113) | def teardown_module(): FILE: tests/test_models/test_editors/test_esrgan/test_esrgan.py function test_esrgan (line 14) | def test_esrgan(init_weights): function teardown_module (line 84) | def teardown_module(): FILE: tests/test_models/test_editors/test_esrgan/test_rrdb_net.py function test_rrdbnet_backbone (line 9) | def test_rrdbnet_backbone(): function teardown_module (line 56) | def teardown_module(): FILE: tests/test_models/test_editors/test_fastcomposer/test_fastcomposer.py class TestFastComposer (line 86) | class TestFastComposer(TestCase): method setUp (line 88) | def setUp(self): method test_infer (line 91) | def test_infer(self): function teardown_module (line 152) | def teardown_module(): FILE: tests/test_models/test_editors/test_fba/test_fba_decoder.py function assert_tensor_with_shape (line 9) | def assert_tensor_with_shape(tensor, shape): function _demo_inputs (line 15) | def _demo_inputs(input_shape=(1, 4, 64, 64)): function test_fba_decoder (line 28) | def test_fba_decoder(): function teardown_module (line 57) | def teardown_module(): FILE: tests/test_models/test_editors/test_fba/test_fba_encoder.py function _demo_inputs (line 9) | def _demo_inputs(input_shape=(1, 4, 64, 64)): function assert_tensor_with_shape (line 22) | def assert_tensor_with_shape(tensor, shape): function test_fba_encoder (line 28) | def test_fba_encoder(): function teardown_module (line 138) | def teardown_module(): FILE: tests/test_models/test_editors/test_flavr/test_flavr.py function test_flavr (line 7) | def test_flavr(): function teardown_module (line 36) | def teardown_module(): FILE: tests/test_models/test_editors/test_flavr/test_flavr_net.py function test_flavr_net (line 8) | def test_flavr_net(): function teardown_module (line 55) | def teardown_module(): FILE: tests/test_models/test_editors/test_gca/test_gca.py function _demo_input_train (line 15) | def _demo_input_train(img_shape, batch_size=1, cuda=False, meta={}): function _demo_input_test (line 59) | def _demo_input_test(img_shape, batch_size=1, cuda=False, meta={}): function assert_pred_alpha (line 97) | def assert_pred_alpha(predictions, batch_size): function assert_dict_keys_equal (line 106) | def assert_dict_keys_equal(dictionary, target_keys): function test_gca (line 112) | def test_gca(): function teardown_module (line 184) | def teardown_module(): FILE: tests/test_models/test_editors/test_gca/test_gca_module.py function _demo_inputs (line 9) | def _demo_inputs(input_shape=(1, 4, 64, 64)): function assert_tensor_with_shape (line 22) | def assert_tensor_with_shape(tensor, shape): function test_res_gca_encoder (line 28) | def test_res_gca_encoder(): function test_gca_module (line 120) | def test_gca_module(): function teardown_module (line 136) | def teardown_module(): FILE: tests/test_models/test_editors/test_gca/test_resgca_dec.py function assert_tensor_with_shape (line 11) | def assert_tensor_with_shape(tensor, shape): function _demo_inputs (line 17) | def _demo_inputs(input_shape=(1, 4, 64, 64)): function test_resnet_decoder (line 30) | def test_resnet_decoder(): function test_res_shortcut_decoder (line 82) | def test_res_shortcut_decoder(): function test_res_gca_decoder (line 111) | def test_res_gca_decoder(): function teardown_module (line 140) | def teardown_module(): FILE: tests/test_models/test_editors/test_gca/test_resgca_enc.py function _demo_inputs (line 9) | def _demo_inputs(input_shape=(1, 4, 64, 64)): function assert_tensor_with_shape (line 22) | def assert_tensor_with_shape(tensor, shape): function test_resnet_encoder (line 28) | def test_resnet_encoder(): function test_res_shortcut_encoder (line 79) | def test_res_shortcut_encoder(): function teardown_module (line 181) | def teardown_module(): FILE: tests/test_models/test_editors/test_ggan/test_ggan.py class TestGGAN (line 20) | class TestGGAN(TestCase): method test_init (line 22) | def test_init(self): method test_train_step (line 58) | def test_train_step(self): function teardown_module (line 100) | def teardown_module(): FILE: tests/test_models/test_editors/test_glean/test_glean_styleganv2.py function test_glean (line 21) | def test_glean(init_weights): function teardown_module (line 87) | def teardown_module(): FILE: tests/test_models/test_editors/test_glide/test_glide.py class TestGLIDE (line 15) | class TestGLIDE(TestCase): method setUp (line 17) | def setUp(self): method test_init (line 90) | def test_init(self): method test_infer (line 101) | def test_infer(self): function teardown_module (line 110) | def teardown_module(): FILE: tests/test_models/test_editors/test_global_local/test_gl_decoder.py function test_gl_decoder (line 9) | def test_gl_decoder(): function teardown_module (line 38) | def teardown_module(): FILE: tests/test_models/test_editors/test_global_local/test_gl_dilation.py function test_gl_dilation_neck (line 12) | def test_gl_dilation_neck(): function teardown_module (line 32) | def teardown_module(): FILE: tests/test_models/test_editors/test_global_local/test_gl_disc.py function test_gl_discs (line 8) | def test_gl_discs(): function teardown_module (line 46) | def teardown_module(): FILE: tests/test_models/test_editors/test_global_local/test_gl_encoder.py function test_gl_encoder (line 8) | def test_gl_encoder(): function teardown_module (line 24) | def teardown_module(): FILE: tests/test_models/test_editors/test_global_local/test_gl_encoder_decoder.py function test_gl_encdec (line 9) | def test_gl_encdec(): function teardown_module (line 41) | def teardown_module(): FILE: tests/test_models/test_editors/test_global_local/test_gl_inpaintor.py function test_gl_inpaintor (line 13) | def test_gl_inpaintor(): function teardown_module (line 74) | def teardown_module(): FILE: tests/test_models/test_editors/test_guided_diffusion/test_adm.py class TestAdm (line 13) | class TestAdm(TestCase): method setup_class (line 15) | def setup_class(cls): method test_infer (line 45) | def test_infer(self): function teardown_module (line 92) | def teardown_module(): FILE: tests/test_models/test_editors/test_iconvsr/test_iconvsr_net.py function test_iconvsr (line 8) | def test_iconvsr(): function teardown_module (line 85) | def teardown_module(): FILE: tests/test_models/test_editors/test_indexnet/test_indexnet.py function _demo_input_train (line 13) | def _demo_input_train(img_shape, batch_size=1, cuda=False, meta={}): function _demo_input_test (line 54) | def _demo_input_test(img_shape, batch_size=1, cuda=False, meta={}): function assert_pred_alpha (line 91) | def assert_pred_alpha(predictions, batch_size): function assert_dict_keys_equal (line 100) | def assert_dict_keys_equal(dictionary, target_keys): function assert_tensor_with_shape (line 106) | def assert_tensor_with_shape(tensor, shape): function _demo_inputs (line 112) | def _demo_inputs(input_shape=(1, 4, 64, 64)): function test_indexnet (line 125) | def test_indexnet(): function test_indexed_upsample (line 196) | def test_indexed_upsample(): function teardown_module (line 214) | def teardown_module(): FILE: tests/test_models/test_editors/test_indexnet/test_indexnet_decoder.py function test_indexnet_decoder (line 8) | def test_indexnet_decoder(): function teardown_module (line 38) | def teardown_module(): FILE: tests/test_models/test_editors/test_indexnet/test_indexnet_encoder.py function test_indexnet_encoder (line 13) | def test_indexnet_encoder(): function test_index_blocks (line 105) | def test_index_blocks(): function teardown_module (line 144) | def teardown_module(): FILE: tests/test_models/test_editors/test_inst_colorization/test_color_utils.py class TestColorUtils (line 8) | class TestColorUtils: method test_xyz2lab (line 30) | def test_xyz2lab(self): method test_rgb2xyz (line 49) | def test_rgb2xyz(self): method test_rgb2lab (line 68) | def test_rgb2lab(self): method test_lab2rgb (line 80) | def test_lab2rgb(self): method test_lab2xyz (line 93) | def test_lab2xyz(self): method test_xyz2rgb (line 111) | def test_xyz2rgb(self): method test_get_colorization_data (line 133) | def test_get_colorization_data(self): method test_encode_ab_ind (line 144) | def test_encode_ab_ind(self): function teardown_module (line 156) | def teardown_module(): FILE: tests/test_models/test_editors/test_inst_colorization/test_colorization_net.py function test_colorization_net (line 7) | def test_colorization_net(): function teardown_module (line 45) | def teardown_module(): FILE: tests/test_models/test_editors/test_inst_colorization/test_fusion_net.py function test_fusion_net (line 8) | def test_fusion_net(): function teardown_module (line 84) | def teardown_module(): FILE: tests/test_models/test_editors/test_inst_colorization/test_inst_colorization.py class TestInstColorization (line 16) | class TestInstColorization: method test_inst_colorization (line 18) | def test_inst_colorization(self): function teardown_module (line 126) | def teardown_module(): FILE: tests/test_models/test_editors/test_inst_colorization/test_weight_layer.py function test_weight_layer (line 13) | def test_weight_layer(): function teardown_module (line 33) | def teardown_module(): FILE: tests/test_models/test_editors/test_liif/test_liif.py function test_liif (line 12) | def test_liif(): function teardown_module (line 76) | def teardown_module(): FILE: tests/test_models/test_editors/test_liif/test_liif_net.py function test_liif_edsr_net (line 13) | def test_liif_edsr_net(): function test_liif_rdn_net (line 64) | def test_liif_rdn_net(): function teardown_module (line 118) | def teardown_module(): FILE: tests/test_models/test_editors/test_liif/test_mlp_refiner.py function test_MLPRefiner (line 7) | def test_MLPRefiner(): function teardown_module (line 14) | def teardown_module(): FILE: tests/test_models/test_editors/test_lsgan/test_lsgan.py class TestLSGAN (line 20) | class TestLSGAN(TestCase): method test_init (line 22) | def test_init(self): method test_train_step (line 58) | def test_train_step(self): function teardown_module (line 100) | def teardown_module(): FILE: tests/test_models/test_editors/test_lsgan/test_lsgan_discriminator.py class TestLSGANDiscriminator (line 9) | class TestLSGANDiscriminator(object): method setup_class (line 12) | def setup_class(cls): method test_lsgan_discriminator (line 17) | def test_lsgan_discriminator(self): method test_lsgan_discriminator_cuda (line 46) | def test_lsgan_discriminator_cuda(self): function teardown_module (line 75) | def teardown_module(): FILE: tests/test_models/test_editors/test_lsgan/test_lsgan_generator.py class TestLSGANGenerator (line 9) | class TestLSGANGenerator(object): method setup_class (line 12) | def setup_class(cls): method test_lsgan_generator (line 17) | def test_lsgan_generator(self): method test_lsgan_generator_cuda (line 39) | def test_lsgan_generator_cuda(self): function teardown_module (line 61) | def teardown_module(): FILE: tests/test_models/test_editors/test_mspie/test_mspie_stylegan2.py class TestMSPIEStyleGAN2 (line 17) | class TestMSPIEStyleGAN2(TestCase): method setup_class (line 20) | def setup_class(cls): method test_stylegan2_cpu (line 47) | def test_stylegan2_cpu(self): function teardown_module (line 75) | def teardown_module(): FILE: tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_discriminator.py class TestMSStyleGANv2Disc (line 8) | class TestMSStyleGANv2Disc: method setup_class (line 11) | def setup_class(cls): method test_msstylegan2_disc_cpu (line 14) | def test_msstylegan2_disc_cpu(self): method test_msstylegan2_disc_cuda (line 27) | def test_msstylegan2_disc_cuda(self): function teardown_module (line 40) | def teardown_module(): FILE: tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_generator.py class MockHeadPosEncoding (line 17) | class MockHeadPosEncoding(nn.Module): method __init__ (line 19) | def __init__(self): class TestMSStyleGAN2 (line 23) | class TestMSStyleGAN2: method setup_class (line 26) | def setup_class(cls): method test_msstylegan2_cpu (line 32) | def test_msstylegan2_cpu(self): method test_train (line 89) | def test_train(self): method test_mean_latent (line 114) | def test_mean_latent(self): method test_head_pos_encoding (line 123) | def test_head_pos_encoding(self): function teardown_module (line 138) | def teardown_module(): FILE: tests/test_models/test_editors/test_mspie/test_mspie_stylegan2_modules.py class TestModulatedPEStyleConv (line 13) | class TestModulatedPEStyleConv(TestCase): method setUpClass (line 16) | def setUpClass(cls): method test_upsample (line 23) | def test_upsample(self): method test_downsample (line 42) | def test_downsample(self): class TestModulatedPEConv2d (line 60) | class TestModulatedPEConv2d(TestCase): method setUpClass (line 63) | def setUpClass(cls): method test_equalized_lr_cfg (line 70) | def test_equalized_lr_cfg(self): method test_demodulate (line 81) | def test_demodulate(self): method test_up_after_conv (line 92) | def test_up_after_conv(self): function teardown_module (line 113) | def teardown_module(): FILE: tests/test_models/test_editors/test_mspie/test_pe_singan.py class TestPESinGAN (line 12) | class TestPESinGAN: method setup_class (line 15) | def setup_class(cls): method test_pesingan_cpu (line 53) | def test_pesingan_cpu(self): function teardown_module (line 123) | def teardown_module(): FILE: tests/test_models/test_editors/test_mspie/test_pe_singan_generator.py class TestSinGANPEGen (line 8) | class TestSinGANPEGen: method setup_class (line 11) | def setup_class(cls): method test_singan_gen_pe (line 30) | def test_singan_gen_pe(self): function teardown_module (line 98) | def teardown_module(): FILE: tests/test_models/test_editors/test_mspie/test_positional_encoding.py class TestSPE (line 9) | class TestSPE: method setup_class (line 12) | def setup_class(cls): method test_spe_cpu (line 15) | def test_spe_cpu(self): method test_spe_gpu (line 28) | def test_spe_gpu(self): class TestCSG (line 43) | class TestCSG: method setup_class (line 46) | def setup_class(cls): method test_csg_cpu (line 49) | def test_csg_cpu(self): method test_csg_cuda (line 57) | def test_csg_cuda(self): function teardown_module (line 62) | def teardown_module(): FILE: tests/test_models/test_editors/test_nafnet/test_naf_avgpool2d.py function test_avgpool2d (line 7) | def test_avgpool2d(): function teardown_module (line 56) | def teardown_module(): FILE: tests/test_models/test_editors/test_nafnet/test_naf_layernorm2d.py function test_layer_norm (line 7) | def test_layer_norm(): function teardown_module (line 17) | def teardown_module(): FILE: tests/test_models/test_editors/test_nafnet/test_nafbaseline.py function test_nafnet (line 7) | def test_nafnet(): function test_baseline_local (line 39) | def test_baseline_local(): function teardown_module (line 71) | def teardown_module(): FILE: tests/test_models/test_editors/test_nafnet/test_nafnet.py function test_nafnet (line 7) | def test_nafnet(): function test_nafnet_local (line 39) | def test_nafnet_local(): function teardown_module (line 71) | def teardown_module(): FILE: tests/test_models/test_editors/test_pconv/test_mask_conv_module.py function test_mask_conv_module (line 12) | def test_mask_conv_module(): function teardown_module (line 81) | def teardown_module(): FILE: tests/test_models/test_editors/test_pconv/test_partial_conv.py function test_pconv2d (line 8) | def test_pconv2d(): function teardown_module (line 76) | def teardown_module(): FILE: tests/test_models/test_editors/test_pconv/test_pconv_decoder.py function test_pconv_dec (line 10) | def test_pconv_dec(): function teardown_module (line 26) | def teardown_module(): FILE: tests/test_models/test_editors/test_pconv/test_pconv_encoder.py function test_pconv_enc (line 8) | def test_pconv_enc(): function teardown_module (line 30) | def teardown_module(): FILE: tests/test_models/test_editors/test_pconv/test_pconv_encoder_decoder.py function test_pconv_encdec (line 8) | def test_pconv_encdec(): function teardown_module (line 27) | def teardown_module(): FILE: tests/test_models/test_editors/test_pconv/test_pconv_inpaintor.py function test_pconv_inpaintor (line 18) | def test_pconv_inpaintor(): function teardown_module (line 67) | def teardown_module(): FILE: tests/test_models/test_editors/test_pggan/test_pggan.py class TestPGGAN (line 17) | class TestPGGAN(TestCase): method test_pggan_cpu (line 41) | def test_pggan_cpu(self): method test_pggan_cuda (line 155) | def test_pggan_cuda(self): function teardown_module (line 189) | def teardown_module(): FILE: tests/test_models/test_editors/test_pggan/test_pggan_discriminator.py class TestPGGANDiscriminator (line 10) | class TestPGGANDiscriminator: method setup_class (line 13) | def setup_class(cls): method test_pggan_discriminator (line 22) | def test_pggan_discriminator(self): method test_pggan_discriminator_cuda (line 59) | def test_pggan_discriminator_cuda(self): function teardown_module (line 77) | def teardown_module(): FILE: tests/test_models/test_editors/test_pggan/test_pggan_generator.py class TestPGGANGenerator (line 10) | class TestPGGANGenerator: method setup_class (line 13) | def setup_class(cls): method test_pggan_generator (line 18) | def test_pggan_generator(self): method test_pggan_generator_cuda (line 61) | def test_pggan_generator_cuda(self): function teardown_module (line 75) | def teardown_module(): FILE: tests/test_models/test_editors/test_pggan/test_pggan_modules.py class TestEqualizedLR (line 21) | class TestEqualizedLR: method setup_class (line 24) | def setup_class(cls): method test_equalized_conv_module (line 35) | def test_equalized_conv_module(self): method test_equalized_conv_module_cuda (line 67) | def test_equalized_conv_module_cuda(self): method test_equalized_linear_module (line 77) | def test_equalized_linear_module(self): method test_equalized_linear_module_cuda (line 97) | def test_equalized_linear_module_cuda(self): method test_equalized_lr (line 107) | def test_equalized_lr(self): class TestEqualizedLRConvUpModule (line 114) | class TestEqualizedLRConvUpModule: method setup_class (line 117) | def setup_class(cls): method test_equalized_lr_convup_module (line 129) | def test_equalized_lr_convup_module(self, ): method test_equalized_lr_convup_module_cuda (line 158) | def test_equalized_lr_convup_module_cuda(self): class TestEqualizedLRConvDownModule (line 169) | class TestEqualizedLRConvDownModule: method setup_class (line 172) | def setup_class(cls): method test_equalized_lr_conv_down (line 182) | def test_equalized_lr_conv_down(self): method test_equalized_lr_conv_down_cuda (line 211) | def test_equalized_lr_conv_down_cuda(self): class TestPixelNorm (line 221) | class TestPixelNorm: method setup_class (line 224) | def setup_class(cls): method test_pixel_norm (line 227) | def test_pixel_norm(self): method test_pixel_norm_cuda (line 238) | def test_pixel_norm_cuda(self): class TestMiniBatchStddevLayer (line 249) | class TestMiniBatchStddevLayer: method setup_class (line 252) | def setup_class(cls): method test_minibatch_stddev_layer (line 255) | def test_minibatch_stddev_layer(self): method test_minibatch_stddev_layer_cuda (line 274) | def test_minibatch_stddev_layer_cuda(self): class TestPGGANNoiseTo2DFeat (line 290) | class TestPGGANNoiseTo2DFeat: method setup_class (line 293) | def setup_class(cls): method test_pggan_noise2feat (line 297) | def test_pggan_noise2feat(self): method test_pggan_noise2feat_cuda (line 328) | def test_pggan_noise2feat_cuda(self): function teardown_module (line 338) | def teardown_module(): FILE: tests/test_models/test_editors/test_pix2pix/test_pix2pix.py function obj_from_dict (line 19) | def obj_from_dict(info: dict, parent=None, default_args=None): function test_pix2pix (line 58) | def test_pix2pix(): function test_pix2pix_val_step (line 220) | def test_pix2pix_val_step(): function teardown_module (line 255) | def teardown_module(): FILE: tests/test_models/test_editors/test_pix2pix/test_pix2pix_generator.py class TestUnetGenerator (line 11) | class TestUnetGenerator: method setup_class (line 14) | def setup_class(cls): method test_pix2pix_generator_cpu (line 27) | def test_pix2pix_generator_cpu(self): method test_pix2pix_generator_cuda (line 46) | def test_pix2pix_generator_cuda(self): function teardown_module (line 65) | def teardown_module(): FILE: tests/test_models/test_editors/test_pix2pix/test_pix2pix_modules.py function test_unet_skip_connection_block (line 8) | def test_unet_skip_connection_block(): function teardown_module (line 15) | def teardown_module(): FILE: tests/test_models/test_editors/test_plain/test_plain_decoder.py function assert_tensor_with_shape (line 12) | def assert_tensor_with_shape(tensor, shape): function _demo_inputs (line 18) | def _demo_inputs(input_shape=(1, 4, 64, 64)): function test_plain_decoder (line 34) | def test_plain_decoder(): function teardown_module (line 62) | def teardown_module(): FILE: tests/test_models/test_editors/test_plain/test_plain_refiner.py function test_plain_refiner (line 13) | def test_plain_refiner(): function teardown_module (line 23) | def teardown_module(): FILE: tests/test_models/test_editors/test_rdn/test_rdn_net.py function test_rdn (line 14) | def test_rdn(): function teardown_module (line 63) | def teardown_module(): FILE: tests/test_models/test_editors/test_real_basicvsr/test_real_basicvsr.py function test_real_basicvsr (line 21) | def test_real_basicvsr(init_weights): function teardown_module (line 117) | def teardown_module(): FILE: tests/test_models/test_editors/test_real_basicvsr/test_real_basicvsr_net.py function test_real_basicvsr_net (line 13) | def test_real_basicvsr_net(): function teardown_module (line 54) | def teardown_module(): FILE: tests/test_models/test_editors/test_real_esrgan/test_real_esrgan.py function test_real_esrgan (line 15) | def test_real_esrgan(init_weights): function teardown_module (line 115) | def teardown_module(): FILE: tests/test_models/test_editors/test_real_esrgan/test_unet_disc.py function test_unet_disc_with_spectral_norm (line 13) | def test_unet_disc_with_spectral_norm(): function teardown_module (line 28) | def teardown_module(): FILE: tests/test_models/test_editors/test_restormer/test_restormer_net.py function test_restormer_cpu (line 11) | def test_restormer_cpu(): function test_restormer_cuda (line 89) | def test_restormer_cuda(): function teardown_module (line 111) | def teardown_module(): FILE: tests/test_models/test_editors/test_sagan/test_sagan.py class TestSAGAN (line 33) | class TestSAGAN(TestCase): method test_init (line 35) | def test_init(self): method test_train_step (line 86) | def test_train_step(self): function teardown_module (line 133) | def teardown_module(): FILE: tests/test_models/test_editors/test_sagan/test_sagan_discriminator.py class TestSNGANPROJDiscriminator (line 12) | class TestSNGANPROJDiscriminator(object): method setup_class (line 15) | def setup_class(cls): method test_sngan_proj_discriminator (line 27) | def test_sngan_proj_discriminator(self): method test_sngan_proj_discriminator_cuda (line 179) | def test_sngan_proj_discriminator_cuda(self): function teardown_module (line 280) | def teardown_module(): FILE: tests/test_models/test_editors/test_sagan/test_sagan_generator.py class TestSNGANPROJGenerator (line 12) | class TestSNGANPROJGenerator(object): method setup_class (line 15) | def setup_class(cls): method test_sngan_proj_generator (line 28) | def test_sngan_proj_generator(self): method test_sngan_proj_generator_cuda (line 194) | def test_sngan_proj_generator_cuda(self): function teardown_module (line 305) | def teardown_module(): FILE: tests/test_models/test_editors/test_sagan/test_sagan_modules.py class TestSNGANGenResBlock (line 10) | class TestSNGANGenResBlock(object): method setup_class (line 13) | def setup_class(cls): method test_snganGenResBlock (line 28) | def test_snganGenResBlock(self): method test_snganGenResBlock_cuda (line 96) | def test_snganGenResBlock_cuda(self): class TestSNDiscResBlock (line 158) | class TestSNDiscResBlock(object): method setup_class (line 161) | def setup_class(cls): method test_snganDiscResBlock (line 170) | def test_snganDiscResBlock(self): method test_snganDiscResBlock_cuda (line 215) | def test_snganDiscResBlock_cuda(self): class TestSNDiscHeadResBlock (line 254) | class TestSNDiscHeadResBlock(object): method setup_class (line 257) | def setup_class(cls): method test_snganDiscHeadResBlock (line 265) | def test_snganDiscHeadResBlock(self): method test_snganDiscHeadResBlock_cuda (line 296) | def test_snganDiscHeadResBlock_cuda(self): class TestSNConditionalNorm (line 321) | class TestSNConditionalNorm(object): method setup_class (line 324) | def setup_class(cls): method test_conditionalNorm (line 335) | def test_conditionalNorm(self): method test_conditionalNorm_cuda (line 425) | def test_conditionalNorm_cuda(self): function teardown_module (line 509) | def teardown_module(): FILE: tests/test_models/test_editors/test_singan/test_singan.py class TestSinGAN (line 12) | class TestSinGAN: method setup_class (line 15) | def setup_class(cls): method test_singan_cpu (line 47) | def test_singan_cpu(self): function teardown_module (line 130) | def teardown_module(): FILE: tests/test_models/test_editors/test_singan/test_singan_discriminator.py class TestSinGANDisc (line 7) | class TestSinGANDisc: method setup_class (line 10) | def setup_class(cls): method test_singan_disc (line 20) | def test_singan_disc(self): function teardown_module (line 27) | def teardown_module(): FILE: tests/test_models/test_editors/test_singan/test_singan_generator.py class TestSinGANGen (line 7) | class TestSinGANGen: method setup_class (line 10) | def setup_class(cls): method test_singan_gen (line 30) | def test_singan_gen(self): function teardown_module (line 47) | def teardown_module(): FILE: tests/test_models/test_editors/test_singan/test_singan_modules.py function test_GeneratorBlock (line 8) | def test_GeneratorBlock(): function test_DiscriminatorBlock (line 22) | def test_DiscriminatorBlock(): function teardown_module (line 29) | def teardown_module(): FILE: tests/test_models/test_editors/test_srcnn/test_srcnn_net.py function test_srcnn (line 8) | def test_srcnn(): function teardown_module (line 41) | def teardown_module(): FILE: tests/test_models/test_editors/test_srgan/test_modified_vgg.py function test_modifiedVGG (line 7) | def test_modifiedVGG(): function teardown_module (line 14) | def teardown_module(): FILE: tests/test_models/test_editors/test_srgan/test_sr_resnet.py function test_srresnet_backbone (line 8) | def test_srresnet_backbone(): function test_discriminator (line 55) | def test_discriminator(): function teardown_module (line 78) | def teardown_module(): FILE: tests/test_models/test_editors/test_srgan/test_srgan.py function test_srgan_resnet (line 14) | def test_srgan_resnet(init_weights): function teardown_module (line 83) | def teardown_module(): FILE: tests/test_models/test_editors/test_stable_diffusion/test_clip_wrapper.py function test_clip_wrapper (line 9) | def test_clip_wrapper(): function test_load_clip_submodels (line 24) | def test_load_clip_submodels(): function test_load_clip_submodels_transformers_none (line 37) | def test_load_clip_submodels_transformers_none(): function teardown_module (line 56) | def teardown_module(): FILE: tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion.py class dummy_tokenizer (line 57) | class dummy_tokenizer(nn.Module): method __init__ (line 59) | def __init__(self): method __call__ (line 63) | def __call__(self, class dummy_text_encoder (line 75) | class dummy_text_encoder(nn.Module): method __init__ (line 77) | def __init__(self): method __call__ (line 81) | def __call__(self, x, attention_mask): function test_stable_diffusion (line 99) | def test_stable_diffusion(): function teardown_module (line 126) | def teardown_module(): FILE: tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion_inpaint.py class dummy_tokenizer (line 58) | class dummy_tokenizer(nn.Module): method __init__ (line 60) | def __init__(self): method __call__ (line 64) | def __call__(self, class dummy_text_encoder (line 76) | class dummy_text_encoder(nn.Module): method __init__ (line 78) | def __init__(self): method __call__ (line 82) | def __call__(self, x, attention_mask): function test_stable_diffusion (line 100) | def test_stable_diffusion(): function teardown_module (line 140) | def teardown_module(): FILE: tests/test_models/test_editors/test_stable_diffusion/test_stable_diffusion_tomesd.py class dummy_tokenizer (line 57) | class dummy_tokenizer(nn.Module): method __init__ (line 59) | def __init__(self): method __call__ (line 63) | def __call__(self, class dummy_text_encoder (line 75) | class dummy_text_encoder(nn.Module): method __init__ (line 77) | def __init__(self): method __call__ (line 81) | def __call__(self, x, attention_mask): function test_stable_diffusion (line 104) | def test_stable_diffusion(): function teardown_module (line 131) | def teardown_module(): FILE: tests/test_models/test_editors/test_stable_diffusion/test_vae.py function test_vae (line 9) | def test_vae(): function test_resnetblock2d (line 16) | def test_resnetblock2d(): function test_DiagonalGaussianDistribution (line 27) | def test_DiagonalGaussianDistribution(): function test_AttentionBlock (line 44) | def test_AttentionBlock(): function test_Downsample2D (line 51) | def test_Downsample2D(): function test_Upsample2D (line 58) | def test_Upsample2D(): function teardown_module (line 69) | def teardown_module(): FILE: tests/test_models/test_editors/test_stable_diffusion_xl/test_stable_diffusion_xl.py function test_stable_xl_diffusion (line 52) | def test_stable_xl_diffusion(): function test_stable_diffusion_xl_step (line 83) | def test_stable_diffusion_xl_step(): function teardown_module (line 113) | def teardown_module(): FILE: tests/test_models/test_editors/test_stylegan1/test_stylegan1.py class TestStyleGAN1 (line 18) | class TestStyleGAN1(TestCase): method test_stylegan_cpu (line 39) | def test_stylegan_cpu(self): method test_stylegan_cuda (line 163) | def test_stylegan_cuda(self): function teardown_module (line 199) | def teardown_module(): FILE: tests/test_models/test_editors/test_stylegan1/test_stylegan1_discriminator.py class TestStyleGANv1Disc (line 13) | class TestStyleGANv1Disc: method setup_class (line 16) | def setup_class(cls): method test_stylegan1_disc_cuda (line 20) | def test_stylegan1_disc_cuda(self): method test_stylegan1_disc_cpu (line 29) | def test_stylegan1_disc_cpu(self): function teardown_module (line 36) | def teardown_module(): FILE: tests/test_models/test_editors/test_stylegan1/test_stylegan1_generator.py class TestStyleGAN1Generator (line 14) | class TestStyleGAN1Generator: method setup_class (line 17) | def setup_class(cls): method test_g_cuda (line 29) | def test_g_cuda(self): method test_g_cpu (line 88) | def test_g_cpu(self): function teardown_module (line 170) | def teardown_module(): FILE: tests/test_models/test_editors/test_stylegan1/test_stylegan1_modules.py class TestAdaptiveInstanceNorm (line 9) | class TestAdaptiveInstanceNorm: method setup_class (line 12) | def setup_class(cls): method test_adain_cuda (line 17) | def test_adain_cuda(self): class TestStyleConv (line 26) | class TestStyleConv: method setup_class (line 29) | def setup_class(cls): method test_styleconv_cuda (line 42) | def test_styleconv_cuda(self): function teardown_module (line 52) | def teardown_module(): FILE: tests/test_models/test_editors/test_stylegan1/test_stylegan_utils.py function test_get_mean_latent (line 12) | def test_get_mean_latent(): function mock_generator (line 20) | def mock_generator(code, *args, **kwargs): function test_style_mixing (line 30) | def test_style_mixing(): function teardown_module (line 35) | def teardown_module(): FILE: tests/test_models/test_editors/test_stylegan2/test_ada/test_augment.py class TestAuementPipe (line 13) | class TestAuementPipe(TestCase): method setUpClass (line 16) | def setUpClass(cls): method test_forward (line 53) | def test_forward(self): function teardown_module (line 74) | def teardown_module(): FILE: tests/test_models/test_editors/test_stylegan2/test_stylegan2.py class TestStyleGAN2 (line 14) | class TestStyleGAN2(TestCase): method setup_class (line 17) | def setup_class(cls): method test_stylegan2_cpu (line 43) | def test_stylegan2_cpu(self): function teardown_module (line 72) | def teardown_module(): FILE: tests/test_models/test_editors/test_stylegan2/test_stylegan2_discriminator.py class TestStyleGANv2Disc (line 20) | class TestStyleGANv2Disc: method setup_class (line 23) | def setup_class(cls): method test_stylegan2_disc_cpu (line 29) | def test_stylegan2_disc_cpu(self): method test_stylegan2_disc_cuda (line 44) | def test_stylegan2_disc_cuda(self): function test_get_module_device_cpu (line 59) | def test_get_module_device_cpu(): function test_get_module_device_cuda (line 69) | def test_get_module_device_cuda(): class TestStyleGANv2AdaDisc (line 79) | class TestStyleGANv2AdaDisc: method setup_class (line 82) | def setup_class(cls): method test_styleganv2_ada (line 89) | def test_styleganv2_ada(self): function test_ada_pipeline (line 108) | def test_ada_pipeline(): function teardown_module (line 116) | def teardown_module(): FILE: tests/test_models/test_editors/test_stylegan2/test_stylegan2_generator.py class TestStyleGAN2Generator (line 11) | class TestStyleGAN2Generator: method setup_class (line 14) | def setup_class(cls): method test_stylegan2_g_cpu (line 21) | def test_stylegan2_g_cpu(self): method test_g_cuda (line 179) | def test_g_cuda(self): function teardown_module (line 250) | def teardown_module(): FILE: tests/test_models/test_editors/test_stylegan2/test_stylegan2_modules.py function test_get_module_device (line 19) | def test_get_module_device(): class TestDownsampleUpFIRDn (line 45) | class TestDownsampleUpFIRDn(): method test_DownsampleUpFIRDn (line 47) | def test_DownsampleUpFIRDn(self): method test_DownsampleUpFIRDn_cuda (line 56) | def test_DownsampleUpFIRDn_cuda(self): class TestBlur (line 65) | class TestBlur: method setup_class (line 68) | def setup_class(cls): method test_blur_cuda (line 73) | def test_blur_cuda(self): class TestModStyleConv (line 81) | class TestModStyleConv: method setup_class (line 84) | def setup_class(cls): method test_mod_styleconv_cpu (line 92) | def test_mod_styleconv_cpu(self): method test_mod_styleconv_cuda (line 125) | def test_mod_styleconv_cuda(self): class TestModulatedConv2d (line 143) | class TestModulatedConv2d(): method setup_class (line 146) | def setup_class(cls): method test_mod_conv_cpu (line 154) | def test_mod_conv_cpu(self): method test_mod_conv_cuda (line 185) | def test_mod_conv_cuda(self): class TestToRGB (line 216) | class TestToRGB: method setup_class (line 219) | def setup_class(cls): method test_torgb_cpu (line 222) | def test_torgb_cpu(self): method test_torgb_cuda (line 248) | def test_torgb_cuda(self): function teardown_module (line 263) | def teardown_module(): FILE: tests/test_models/test_editors/test_stylegan3/test_stylegan3.py class TestStyleGAN3 (line 18) | class TestStyleGAN3(TestCase): method setUpClass (line 21) | def setUpClass(cls): method test_val_and_test_step (line 58) | def test_val_and_test_step(self): method test_train_step (line 81) | def test_train_step(self): function teardown_module (line 98) | def teardown_module(): FILE: tests/test_models/test_editors/test_stylegan3/test_stylegan3_generator.py class TestStyleGAN3Generator (line 11) | class TestStyleGAN3Generator: method setup_class (line 14) | def setup_class(cls): method test_cpu (line 46) | def test_cpu(self): method test_cuda (line 93) | def test_cuda(self): function teardown_module (line 119) | def teardown_module(): FILE: tests/test_models/test_editors/test_stylegan3/test_stylegan3_modules.py function test_MappingNetwork (line 13) | def test_MappingNetwork(): function teardown_module (line 53) | def teardown_module(): FILE: tests/test_models/test_editors/test_stylegan3/test_stylegan3_utils.py function test_integer_transformation (line 17) | def test_integer_transformation(): function test_fractional_translation (line 35) | def test_fractional_translation(): function test_fractional_rotation (line 56) | def test_fractional_rotation(): function test_fractional_pseduo_rotation (line 68) | def test_fractional_pseduo_rotation(): function teardown_module (line 76) | def teardown_module(): FILE: tests/test_models/test_editors/test_swinir/test_swinir_modules.py function test_patchEmbed (line 16) | def test_patchEmbed(): function test_patchUnEmbed (line 34) | def test_patchUnEmbed(): function test_upsample (line 52) | def test_upsample(): function test_upsampleOneStep (line 69) | def test_upsampleOneStep(): function teardown_module (line 87) | def teardown_module(): FILE: tests/test_models/test_editors/test_swinir/test_swinir_net.py function test_swinir_cpu (line 10) | def test_swinir_cpu(): function test_swinir_cuda (line 88) | def test_swinir_cuda(): function teardown_module (line 111) | def teardown_module(): FILE: tests/test_models/test_editors/test_swinir/test_swinir_rstb.py function test_rstb (line 13) | def test_rstb(): function teardown_module (line 28) | def teardown_module(): FILE: tests/test_models/test_editors/test_swinir/test_swinir_utils.py function test_drop_path (line 9) | def test_drop_path(): function test_to_2tuple (line 15) | def test_to_2tuple(): function test_window (line 21) | def test_window(): function teardown_module (line 29) | def teardown_module(): FILE: tests/test_models/test_editors/test_tdan/test_tdan.py function test_tdan (line 12) | def test_tdan(): function teardown_module (line 47) | def teardown_module(): FILE: tests/test_models/test_editors/test_tdan/test_tdan_net.py function test_tdan_net (line 7) | def test_tdan_net(): function teardown_module (line 21) | def teardown_module(): FILE: tests/test_models/test_editors/test_tof/test_tof_vfi_net.py function test_tof_vfi_net (line 7) | def test_tof_vfi_net(): function teardown_module (line 31) | def teardown_module(): FILE: tests/test_models/test_editors/test_tof/test_tof_vsr_net.py function test_toflow_vsr_net (line 7) | def test_toflow_vsr_net(): function teardown_module (line 22) | def teardown_module(): FILE: tests/test_models/test_editors/test_ttsr/test_lte.py function test_lte (line 7) | def test_lte(): function teardown_module (line 25) | def teardown_module(): FILE: tests/test_models/test_editors/test_ttsr/test_search_transformer.py function test_search_transformer (line 7) | def test_search_transformer(): function teardown_module (line 27) | def teardown_module(): FILE: tests/test_models/test_editors/test_ttsr/test_ttsr.py function test_ttsr (line 22) | def test_ttsr(init_weights): function teardown_module (line 113) | def teardown_module(): FILE: tests/test_models/test_editors/test_ttsr/test_ttsr_disc.py function test_ttsr_dict (line 14) | def test_ttsr_dict(): function teardown_module (line 27) | def teardown_module(): FILE: tests/test_models/test_editors/test_ttsr/test_ttsr_net.py function test_sfe (line 15) | def test_sfe(): function test_csfi (line 25) | def test_csfi(): function test_merge_features (line 45) | def test_merge_features(): function test_ttsr_net (line 58) | def test_ttsr_net(): function teardown_module (line 77) | def teardown_module(): FILE: tests/test_models/test_editors/test_vico/test_vico.py class TestViCo (line 93) | class TestViCo(TestCase): method setUp (line 95) | def setUp(self): method test_infer (line 104) | def test_infer(self): method _test_infer (line 128) | def _test_infer(self, vico, num_prompt, num_repeat): method test_val_step (line 142) | def test_val_step(self): method test_test_step (line 169) | def test_test_step(self): method test_train_step (line 196) | def test_train_step(self): FILE: tests/test_models/test_editors/test_vico/test_vico_utils.py function test_set_vico_modules (line 18) | def test_set_vico_modules(): FILE: tests/test_models/test_editors/test_wgan_gp/test_wgan_discriminator.py class TestWGANGPDiscriminator (line 9) | class TestWGANGPDiscriminator(object): method setup_class (line 12) | def setup_class(cls): method test_wgangp_discriminator (line 35) | def test_wgangp_discriminator(self): method test_wgangp_discriminator_cuda (line 73) | def test_wgangp_discriminator_cuda(self): function teardown_module (line 111) | def teardown_module(): FILE: tests/test_models/test_editors/test_wgan_gp/test_wgan_generator.py class TestWGANGPGenerator (line 9) | class TestWGANGPGenerator(object): method setup_class (line 12) | def setup_class(cls): method test_wgangp_generator (line 17) | def test_wgangp_generator(self): method test_wgangp_generator_cuda (line 52) | def test_wgangp_generator_cuda(self): function teardown_module (line 87) | def teardown_module(): FILE: tests/test_models/test_editors/test_wgan_gp/test_wgan_gp.py class TestWGANGP (line 22) | class TestWGANGP(TestCase): method test_init (line 24) | def test_init(self): method test_train_step (line 63) | def test_train_step(self): function teardown_module (line 106) | def teardown_module(): FILE: tests/test_models/test_editors/test_wgan_gp/test_wgan_gp_module.py function test_ConvLNModule (line 9) | def test_ConvLNModule(): function test_WGANDecisionHead (line 15) | def test_WGANDecisionHead(): function test_WGANNoiseTo2DFeat (line 22) | def test_WGANNoiseTo2DFeat(): function teardown_module (line 29) | def teardown_module(): FILE: tests/test_models/test_losses/test_clip_loss.py function test_clip_loss (line 19) | def test_clip_loss(): function teardown_module (line 29) | def teardown_module(): FILE: tests/test_models/test_losses/test_composition_loss.py function test_composition_losses (line 12) | def test_composition_losses(): function teardown_module (line 83) | def teardown_module(): FILE: tests/test_models/test_losses/test_face_id_loss.py function test_face_id_loss (line 13) | def test_face_id_loss(): function teardown_module (line 21) | def teardown_module(): FILE: tests/test_models/test_losses/test_feature_loss.py function test_light_cnn_feature_loss (line 13) | def test_light_cnn_feature_loss(): function teardown_module (line 55) | def teardown_module(): FILE: tests/test_models/test_losses/test_gan_loss.py function test_gan_losses (line 10) | def test_gan_losses(): function teardown_module (line 120) | def teardown_module(): FILE: tests/test_models/test_losses/test_gradient_loss.py function test_gradient_loss (line 9) | def test_gradient_loss(): function test_gradient_penalty_losses (line 36) | def test_gradient_penalty_losses(): function test_disc_shift_loss (line 49) | def test_disc_shift_loss(): function teardown_module (line 57) | def teardown_module(): FILE: tests/test_models/test_losses/test_loss_comps/test_clip_loss_comps.py function test_clip_loss (line 19) | def test_clip_loss(): function teardown_module (line 32) | def teardown_module(): FILE: tests/test_models/test_losses/test_loss_comps/test_disc_auxiliary_loss_comps.py class TestDiscShiftLoss (line 15) | class TestDiscShiftLoss(object): method setup_class (line 18) | def setup_class(cls): method test_module_wrapper (line 24) | def test_module_wrapper(self): class TestGradientPenalty (line 48) | class TestGradientPenalty: method setup_class (line 51) | def setup_class(cls): method test_gp_loss (line 60) | def test_gp_loss(self): class TestR1GradientPenalty (line 105) | class TestR1GradientPenalty: method setup_class (line 108) | def setup_class(cls): method test_r1_regularizer (line 116) | def test_r1_regularizer(self): function teardown_module (line 159) | def teardown_module(): FILE: tests/test_models/test_losses/test_loss_comps/test_face_id_loss_comps.py function test_face_id_loss_comps (line 14) | def test_face_id_loss_comps(): function teardown_module (line 26) | def teardown_module(): FILE: tests/test_models/test_losses/test_loss_comps/test_gan_loss_comps.py function test_gan_losses (line 9) | def test_gan_losses(): function teardown_module (line 81) | def teardown_module(): FILE: tests/test_models/test_losses/test_loss_comps/test_gen_auxiliary_loss_comps.py class TestPathRegularizer (line 16) | class TestPathRegularizer: method setup_class (line 19) | def setup_class(cls): method test_path_regularizer_cpu (line 23) | def test_path_regularizer_cpu(self): method test_path_regularizer_cuda (line 50) | def test_path_regularizer_cuda(self): function teardown_module (line 74) | def teardown_module(): FILE: tests/test_models/test_losses/test_loss_wrapper.py function test_utils (line 9) | def test_utils(): function teardown_module (line 60) | def teardown_module(): FILE: tests/test_models/test_losses/test_perceptual_loss.py function test_perceptual_loss (line 16) | def test_perceptual_loss(init_weights): function test_t_perceptual_loss (line 97) | def test_t_perceptual_loss(): function teardown_module (line 150) | def teardown_module(): FILE: tests/test_models/test_losses/test_pixelwise_loss.py function test_pixelwise_losses (line 12) | def test_pixelwise_losses(): function teardown_module (line 117) | def teardown_module(): FILE: tests/test_models/test_utils/test_bbox_utils.py function test_extract_bbox_patch (line 10) | def test_extract_bbox_patch(): function test_extract_around_bbox (line 42) | def test_extract_around_bbox(): function assert_dict_keys_equal (line 70) | def assert_dict_keys_equal(dictionary, target_keys): function assert_tensor_with_shape (line 76) | def assert_tensor_with_shape(tensor, shape): function test_plain_refiner (line 82) | def test_plain_refiner(): function _demo_inputs_pair (line 103) | def _demo_inputs_pair(img_shape=(64, 64), batch_size=1, cuda=False): function teardown_module (line 126) | def teardown_module(): FILE: tests/test_models/test_utils/test_flow_warp.py function tensor_shift (line 8) | def tensor_shift(x, shift=(1, 1), fill_val=0): function test_flow_warp (line 31) | def test_flow_warp(): function teardown_module (line 55) | def teardown_module(): FILE: tests/test_models/test_utils/test_model_utils.py function test_generation_init_weights (line 15) | def test_generation_init_weights(): function test_set_requires_grad (line 59) | def test_set_requires_grad(): function test_get_module_device_cpu (line 66) | def test_get_module_device_cpu(): function test_get_valid_num_batches (line 75) | def test_get_valid_num_batches(): function test_build_module (line 101) | def test_build_module(): function teardown_module (line 128) | def teardown_module(): FILE: tests/test_models/test_utils/test_sampling_utils.py function test_noise_sample_fn (line 9) | def test_noise_sample_fn(): function test_label_sample_fn (line 16) | def test_label_sample_fn(): function teardown_module (line 69) | def teardown_module(): FILE: tests/test_models/test_utils/test_tensor_utils.py function test_tensor_utils (line 7) | def test_tensor_utils(): function test_normalize_vector (line 16) | def test_normalize_vector(): function teardown_module (line 28) | def teardown_module(): FILE: tests/test_structures/test_data_sample.py function test_is_stacked_var (line 13) | def test_is_stacked_var(): class TestDataSample (line 23) | class TestDataSample(TestCase): method test_init (line 25) | def test_init(self): method _check_in_and_same (line 37) | def _check_in_and_same(self, data_sample, field, value, is_meta=False): method test_set_prefined_data (line 53) | def test_set_prefined_data(self): method _test_set_label (line 106) | def _test_set_label(self, key): method test_set_gt_label (line 177) | def test_set_gt_label(self): method test_del_gt_label (line 180) | def test_del_gt_label(self): method test_stack_and_split (line 188) | def test_stack_and_split(self): method test_len (line 278) | def test_len(self): function teardown_module (line 290) | def teardown_module(): FILE: tests/test_utils/test_cli.py function test_modify_args (line 7) | def test_modify_args(): function teardown_module (line 12) | def teardown_module(): FILE: tests/test_utils/test_img_utils.py function test_all_to_tensor (line 10) | def test_all_to_tensor(): function test_can_convert_to_image (line 25) | def test_can_convert_to_image(): function test_tensor2img (line 36) | def test_tensor2img(): function test_to_numpy (line 62) | def test_to_numpy(): function teardown_module (line 68) | def teardown_module(): FILE: tests/test_utils/test_io_utils.py function test_download_from_url (line 6) | def test_download_from_url(): function teardown_module (line 14) | def teardown_module(): FILE: tests/test_utils/test_logger.py function test_print_colored_log (line 5) | def test_print_colored_log(): function teardown_module (line 9) | def teardown_module(): FILE: tests/test_utils/test_sampler.py function test_argument_sampler (line 9) | def test_argument_sampler(): class MockDataset (line 24) | class MockDataset(): method __init__ (line 26) | def __init__(self, length): method __getitem__ (line 29) | def __getitem__(self, idx): method __len__ (line 32) | def __len__(self): class MockValLoop (line 36) | class MockValLoop(): method __init__ (line 38) | def __init__(self): function test_val_data_sampler (line 42) | def test_val_data_sampler(): function teardown_module (line 74) | def teardown_module(): FILE: tests/test_utils/test_setup_env.py function test_register_all_modules (line 5) | def test_register_all_modules(): function test_try_import (line 9) | def test_try_import(): function teardown_module (line 15) | def teardown_module(): FILE: tests/test_utils/test_trans_utils.py class TestCrop (line 21) | class TestCrop: method setup_class (line 24) | def setup_class(cls): method check_ndim (line 40) | def check_ndim(cls, result_img_shape): method check_crop (line 48) | def check_crop(cls, result_img_shape, result_bbox): method check_crop_around_semi (line 56) | def check_crop_around_semi(alpha): method check_keys_contain (line 60) | def check_keys_contain(result_keys, target_keys): method test_crop_around_center (line 64) | def test_crop_around_center(self): method test_crop_around_fg (line 109) | def test_crop_around_fg(self): method test_crop_around_unknown (line 142) | def test_crop_around_unknown(self): function test_adjust_gamma (line 245) | def test_adjust_gamma(): function test_bbox_mask (line 304) | def test_bbox_mask(): function test_free_form_mask (line 342) | def test_free_form_mask(): function test_irregular_mask (line 367) | def test_irregular_mask(): function teardown_module (line 397) | def teardown_module(): FILE: tests/test_visualization/test_concat_visualizer.py function test_concatimagevisualizer (line 10) | def test_concatimagevisualizer(): function teardown_module (line 43) | def teardown_module(): FILE: tests/test_visualization/test_vis_backend.py class TestVisBackend (line 17) | class TestVisBackend(TestCase): method test_vis_backend (line 19) | def test_vis_backend(self): class TestTensorboardBackend (line 90) | class TestTensorboardBackend(TestCase): method test_tensorboard (line 92) | def test_tensorboard(self): class TestPaviBackend (line 110) | class TestPaviBackend(TestCase): method test_pavi (line 112) | def test_pavi(self): class TestWandbBackend (line 134) | class TestWandbBackend(TestCase): method test_wandb (line 136) | def test_wandb(self): function teardown_module (line 164) | def teardown_module(): FILE: tests/test_visualization/test_visualizer.py class TestGenVisualer (line 15) | class TestGenVisualer(TestCase): method test_add_datasample (line 17) | def test_add_datasample(self): function teardown_module (line 90) | def teardown_module(): FILE: tools/analysis_tools/get_flops.py function parse_args (line 16) | def parse_args(): function main (line 51) | def main(): FILE: tools/analysis_tools/print_config.py function parse_args (line 7) | def parse_args(): function main (line 25) | def main(): FILE: tools/dataset_converters/bgm/preprocess_bgm_dataset.py function generate_json (line 10) | def generate_json(data_root, seg_root, bg_root, all_data): function parse_args (line 77) | def parse_args(): function main (line 98) | def main(): FILE: tools/dataset_converters/comp1k/evaluate_comp1k.py function sad (line 15) | def sad(alpha, trimap, pred_alpha): function mse (line 29) | def mse(alpha, trimap, pred_alpha): function gradient_error (line 47) | def gradient_error(alpha, trimap, pred_alpha, sigma=1.4): function connectivity (line 81) | def connectivity(alpha, trimap, pred_alpha, step=0.1): function evaluate_one (line 142) | def evaluate_one(args): function evaluate (line 166) | def evaluate(pred_root, gt_root, trimap_root, verbose, nproc): function parse_args (line 228) | def parse_args(): function main (line 250) | def main(): FILE: tools/dataset_converters/comp1k/extend_fg.py function fix_png_file (line 14) | def fix_png_file(filename, folder): function join_first_contain (line 31) | def join_first_contain(directories, filename, data_root): class ExtendFg (line 46) | class ExtendFg: method __init__ (line 48) | def __init__(self, data_root, fg_dirs, alpha_dirs) -> None: method extend (line 53) | def extend(self, fg_name): function parse_args (line 79) | def parse_args(): function main (line 90) | def main(): FILE: tools/dataset_converters/comp1k/filter_comp1k_anno.py function generate_json (line 8) | def generate_json(comp1k_json_path, target_list_path, save_json_path): function parse_args (line 21) | def parse_args(): function main (line 35) | def main(): FILE: tools/dataset_converters/comp1k/preprocess_comp1k_dataset.py function fix_png_files (line 15) | def fix_png_files(directory): function fix_png_file (line 34) | def fix_png_file(filename, folder): function join_first_contain (line 51) | def join_first_contain(directories, filename, data_root): function get_data_info (line 66) | def get_data_info(args): function generate_json (line 143) | def generate_json(data_root, source_bg_dir, composite, nproc, mode): function parse_args (line 227) | def parse_args(): function main (line 249) | def main(): FILE: tools/dataset_converters/df2k_ost/preprocess_df2k_ost_dataset.py function generate_anno_file (line 15) | def generate_anno_file(args): function main_extract_subimages (line 28) | def main_extract_subimages(args): function extract_subimages (line 59) | def extract_subimages(opt): function worker (line 90) | def worker(path, opt): function make_lmdb_for_df2k_ost (line 137) | def make_lmdb_for_df2k_ost(data_root): function prepare_keys_df2k_ost (line 156) | def prepare_keys_df2k_ost(folder_path): function make_lmdb (line 175) | def make_lmdb(data_path, function read_img_worker (line 293) | def read_img_worker(path, key, compress_level): function parse_args (line 317) | def parse_args(): FILE: tools/dataset_converters/div2k/preprocess_div2k_dataset.py function generate_anno_file (line 16) | def generate_anno_file(args): function main_extract_subimages (line 35) | def main_extract_subimages(args): function extract_subimages (line 93) | def extract_subimages(opt): function worker (line 124) | def worker(path, opt): function make_lmdb_for_div2k (line 175) | def make_lmdb_for_div2k(data_root): function prepare_keys_div2k (line 208) | def prepare_keys_div2k(folder_path): function make_lmdb (line 226) | def make_lmdb(data_path, function read_img_worker (line 344) | def read_img_worker(path, key, compress_level): function parse_args (line 368) | def parse_args(): FILE: tools/dataset_converters/glean/preprocess_cat_test_dataset.py function imresize (line 15) | def imresize(img_path, output_path, scale=None, output_shape=None): function worker (line 41) | def worker(img_name, args): function downsample_images (line 73) | def downsample_images(args): function parse_args (line 88) | def parse_args(): FILE: tools/dataset_converters/glean/preprocess_cat_train_dataset.py function export_images (line 17) | def export_images(lmdb_path, meta_file_path, out_dir): function imresize (line 49) | def imresize(img_path, output_path, scale=None, output_shape=None): function worker (line 75) | def worker(img_name, out_dir): function downsample_images (line 113) | def downsample_images(args): function parse_args (line 130) | def parse_args(): FILE: tools/dataset_converters/glean/preprocess_ffhq_celebahq_dataset.py function imresize (line 15) | def imresize(img_path, output_path, scale=None, output_shape=None): function worker (line 41) | def worker(img_name, args): function downsample_images (line 64) | def downsample_images(args): function parse_args (line 78) | def parse_args(): FILE: tools/dataset_converters/reds/crop_sub_images.py function worker (line 15) | def worker(path, opt): function extract_subimages (line 66) | def extract_subimages(opt): function main_extract_subimages (line 97) | def main_extract_subimages(args): function parse_args (line 152) | def parse_args(): FILE: tools/dataset_converters/reds/preprocess_reds_dataset.py function make_lmdb (line 16) | def make_lmdb(mode, data_path, lmdb_path, batch=5000, compress_level=1): function merge_train_val (line 116) | def merge_train_val(train_path, val_path): function generate_anno_file (line 140) | def generate_anno_file(root_path, file_name='meta_info_REDS_GT.txt'): function split_anno_file (line 156) | def split_anno_file(root_path, val_partition='REDS4'): function unzip (line 193) | def unzip(zip_path): function parse_args (line 227) | def parse_args(): FILE: tools/dataset_converters/sidd/preprocess_sidd_test_dataset.py function export_images (line 14) | def export_images(args): function parse_args (line 63) | def parse_args(): FILE: tools/dataset_converters/vid4/preprocess_vid4_dataset.py function imresize (line 15) | def imresize(img_path, output_path, scale=None, output_shape=None): function worker (line 41) | def worker(img_name, args): function upsample_images (line 61) | def upsample_images(args): function parse_args (line 80) | def parse_args(): FILE: tools/dataset_converters/vimeo90k/preprocess_vimeo90k_dataset.py function make_lmdb (line 21) | def make_lmdb(mode, function generate_anno_file (line 127) | def generate_anno_file(clip_list, file_name='meta_info_Vimeo90K_GT.txt'): function imresize (line 144) | def imresize(img_path, output_path, scale=None, output_shape=None): function mesh_grid (line 170) | def mesh_grid(kernel_size): function bd_downsample (line 190) | def bd_downsample(img_path, output_path, sigma=1.6, scale=4): function worker (line 223) | def worker(clip_path, args): function downsample_images (line 248) | def downsample_images(args): function parse_args (line 269) | def parse_args(): FILE: tools/gui/component.py class QLabelClick (line 11) | class QLabelClick(QtWidgets.QLabel): method __init__ (line 14) | def __init__(self): method mousePressEvent (line 17) | def mousePressEvent(self, event): class QLabelSlider (line 21) | class QLabelSlider(QtWidgets.QLabel): method __init__ (line 23) | def __init__(self, parent, scale, label_1, label_2, title): method mousePressEvent (line 36) | def mousePressEvent(self, ev: QtGui.QMouseEvent) -> None: method mouseReleaseEvent (line 44) | def mouseReleaseEvent(self, ev: QtGui.QMouseEvent) -> None: method mouseMoveEvent (line 50) | def mouseMoveEvent(self, ev: QtGui.QMouseEvent) -> None: method paintEvent (line 59) | def paintEvent(self, ev: QtGui.QPaintEvent) -> None: method set_scale (line 73) | def set_scale(self, scale): method setImage (line 78) | def setImage(self, images): method set_auoMode (line 82) | def set_auoMode(self, mode): method auto_slider (line 86) | def auto_slider(self): method getImage (line 110) | def getImage(self): class QLabelPaint (line 142) | class QLabelPaint(QtWidgets.QLabel): method __init__ (line 144) | def __init__(self, parent, beginPoint=None, endPoint=None): method mousePressEvent (line 155) | def mousePressEvent(self, ev: QtGui.QMouseEvent) -> None: method mouseReleaseEvent (line 162) | def mouseReleaseEvent(self, ev: QtGui.QMouseEvent) -> None: method mouseMoveEvent (line 170) | def mouseMoveEvent(self, ev: QtGui.QMouseEvent) -> None: method paintEvent (line 178) | def paintEvent(self, ev: QtGui.QPaintEvent) -> None: class ConcatImageWidget (line 195) | class ConcatImageWidget(QtWidgets.QWidget): method __init__ (line 197) | def __init__(self, parent, mode, col_num=4): method show_images (line 212) | def show_images(self, x=0, y=0, w=0, h=0): method set_images (line 275) | def set_images(self, file_path, labels, gt=None, scale=1, rect=None): method set_rect (line 307) | def set_rect(self, beginPoint, endPoint): class VideoPlayer (line 317) | class VideoPlayer(QtCore.QThread): method __init__ (line 321) | def __init__(self, parent): method set (line 325) | def set(self, path, fps=None): method setVideo (line 336) | def setVideo(self, path, fps): method pause (line 350) | def pause(self): method resume (line 353) | def resume(self): method __del__ (line 357) | def __del__(self): method run (line 361) | def run(self): class VideoSlider (line 377) | class VideoSlider(QtCore.QThread): method __init__ (line 381) | def __init__(self, parent): method set (line 387) | def set(self, path1, path2, fps1=None, fps2=None): method setVideo (line 400) | def setVideo(self, path, fps): method pause (line 413) | def pause(self): method resume (line 416) | def resume(self): method __del__ (line 420) | def __del__(self): method run (line 424) | def run(self): FILE: tools/gui/gui.py class Homepage (line 9) | class Homepage(QtWidgets.QWidget): method __init__ (line 11) | def __init__(self, main_window): class MainWindow (line 36) | class MainWindow(QtWidgets.QMainWindow): method __init__ (line 38) | def __init__(self): method change_window (line 70) | def change_window(self, wname): FILE: tools/gui/page_general.py class SliderTab (line 8) | class SliderTab(QtWidgets.QWidget): method __init__ (line 10) | def __init__(self): method add (line 48) | def add(self): method change_image (line 65) | def change_image(self): method show_image (line 72) | def show_image(self): class GeneralPage (line 91) | class GeneralPage(QtWidgets.QWidget): method __init__ (line 93) | def __init__(self) -> None: FILE: tools/gui/page_sr.py class PatchTab (line 11) | class PatchTab(QtWidgets.QWidget): method __init__ (line 13) | def __init__(self, parent): method open_file (line 172) | def open_file(self): method add_file (line 190) | def add_file(self): method tableMenu (line 205) | def tableMenu(self, pos): method tb_swap (line 234) | def tb_swap(self, row, move): method set_gt (line 250) | def set_gt(self, path): method change_gt (line 260) | def change_gt(self): method set_scale (line 264) | def set_scale(self): method set_column (line 277) | def set_column(self): method run (line 282) | def run(self, rect=None): method reset (line 317) | def reset(self): method save (line 332) | def save(self): method wheelEvent (line 343) | def wheelEvent(self, ev) -> None: method keyPressEvent (line 362) | def keyPressEvent(self, ev) -> None: method eventFilter (line 375) | def eventFilter(self, object, event) -> bool: class SliderTab (line 383) | class SliderTab(QtWidgets.QWidget): method __init__ (line 385) | def __init__(self, parent): method set_autoSlider (line 560) | def set_autoSlider(self): method auto_slider (line 569) | def auto_slider(self): method add_image (line 572) | def add_image(self, cb, btn): method add_1 (line 610) | def add_1(self): method add_2 (line 632) | def add_2(self): method set_label (line 653) | def set_label(self): method set_scale (line 660) | def set_scale(self): method change_image_1 (line 667) | def change_image_1(self): method change_image_2 (line 677) | def change_image_2(self): method change_video (line 687) | def change_video(self): method setImg (line 699) | def setImg(self, images): method show_image (line 703) | def show_image(self): method pause (line 717) | def pause(self): method reset (line 727) | def reset(self): method save (line 750) | def save(self): method record (line 761) | def record(self): method recording (line 791) | def recording(self): method wheelEvent (line 798) | def wheelEvent(self, ev) -> None: method keyPressEvent (line 812) | def keyPressEvent(self, ev) -> None: method eventFilter (line 829) | def eventFilter(self, object, event) -> bool: class SRPage (line 837) | class SRPage(QtWidgets.QWidget): method __init__ (line 839) | def __init__(self, parent) -> None: FILE: tools/gui/utils.py function layout2widget (line 7) | def layout2widget(layout): function qimage2array (line 13) | def qimage2array(img): FILE: tools/model_converters/publish_model.py function parse_args (line 9) | def parse_args(): function process_checkpoint (line 18) | def process_checkpoint(in_file, out_file): function main (line 34) | def main(): FILE: tools/test.py function parse_args (line 15) | def parse_args(): function main (line 48) | def main(): FILE: tools/train.py function parse_args (line 13) | def parse_args(): function main (line 54) | def main():