MCPcopy Create free account

hub / github.com/IceClear/CLIP-IQA / functions

Functions1,214 in github.com/IceClear/CLIP-IQA

↓ 68 callersFunctiontensor2img
Convert torch Tensors into image numpy arrays. After clamping to (min, max), image values will be normalized to [0, 1]. For different tensor
mmedit/core/misc.py:9
↓ 50 callersFunctionget_root_logger
Get the root logger. The logger will be initialized if it has not been initialized. By default a StreamHandler will be added. If `log_file` i
mmedit/utils/logger.py:7
↓ 49 callersMethodparse_losses
Parse losses dict for different loss variants. Args: losses (dict): Loss dict. Returns: loss (float): Sum of
mmedit/models/base.py:78
↓ 35 callersFunctionbuild_loss
Build loss. Args: cfg (dict): Configuration for building loss.
mmedit/models/builder.py:43
↓ 30 callersFunctionbuild_component
Build component. Args: cfg (dict): Configuration for building component.
mmedit/models/builder.py:34
↓ 27 callersFunctionset_requires_grad
Set requires_grad for all the networks. Args: nets (nn.Module | list[nn.Module]): A list of networks or a single network.
mmedit/models/common/model_utils.py:6
↓ 20 callersFunctionmake_layer
Make layers by stacking the same blocks. Args: block (nn.module): nn.module class for basic block. num_blocks (int): number of bl
mmedit/models/common/sr_backbone_utils.py:26
↓ 16 callersMethod__init__
(self, kernel, pad, upsample_factor=1)
mmedit/models/components/stylegan2/modules.py:371
↓ 13 callersFunctionbuild_backbone
Build backbone. Args: cfg (dict): Configuration for building backbone.
mmedit/models/builder.py:25
↓ 13 callersFunctionflow_warp
Warp an image or a feature map with optical flow. Args: x (Tensor): Tensor with size (n, c, h, w). flow (Tensor): Tensor with siz
mmedit/models/common/flow_warp.py:6
↓ 10 callersMethodapply
Apply function. This function is to register an equalized learning rate hook in an ``nn.Module``. Args: module (
mmedit/models/components/stylegan2/modules.py:117
↓ 10 callersMethodupsample
Compute the output image given the features. Args: lqs (tensor): Input low quality (LQ) sequence with shape (n, t
mmedit/models/backbones/sr_backbones/basicvsr_pp.py:241
↓ 8 callersMethodevaluate
Evaluation function. Args: output (Tensor): Model output with shape (n, c, h, w). gt (Tensor): GT Tensor with shape (
mmedit/models/restorers/tdan.py:71
↓ 8 callersMethodscan_folder
Obtain image path list (including sub-folders) from a given folder. Args: path (str | :obj:`Path`): Folder path. Returns
mmedit/datasets/base_sr_dataset.py:26
↓ 7 callersMethod__init__
(self, in_channels, out_channels, kernel_size,
mmedit/models/backbones/vfi_backbones/flavr_net.py:428
↓ 7 callersFunctionreorder_image
Reorder images to 'HWC' order. If the input_order is (h, w), return (h, w, 1); If the input_order is (c, h, w), return (h, w, c); If the
mmedit/core/evaluation/metrics.py:146
↓ 6 callersMethod__init__
(self, embed_dim: int, # vision image_resolution: int,
mmedit/models/components/clip/model.py:258
↓ 6 callersFunctionbuild_dataset
Build a dataset from config dict. It supports a variety of dataset config. If ``cfg`` is a Sequential (list or dict), it will be a concatenat
mmedit/datasets/builder.py:52
↓ 6 callersFunctionbuild_model
Build model. Args: cfg (dict): Configuration for building model. train_cfg (dict): Training configuration. Default: None.
mmedit/models/builder.py:52
↓ 6 callersMethodforward_train_d
Forward function in discriminator training step. In this function, we compute the prediction for each data batch (real or fake). Mean
mmedit/models/inpaintors/aot_inpaintor.py:22
↓ 6 callersMethodget_module
Get `nn.ModuleDict` to fit the `MMDistributedDataParallel` interface. Args: module (MMDistributedDataParallel | nn.Module
mmedit/models/synthesizers/cycle_gan.py:136
↓ 6 callersMethodpad
(self, x, kernel_size, stride)
mmedit/models/common/gca_module.py:337
↓ 5 callersMethod__init__
(self, in_channels, pool_features)
mmedit/core/evaluation/inception_utils.py:195
↓ 5 callersMethod__init__
(self, classnames, backbone_name='ViT-B/32', n_ctx=16, ctx_init="", cfg_imsize=224, class_specify=False, class
mmedit/models/backbones/sr_backbones/coopclipiqa.py:191
↓ 5 callersMethod__init__
(self, in_channels, out_channels, mid_channels,
mmedit/models/backbones/sr_backbones/dic_net.py:376
↓ 5 callersMethod_make_layer
(self, inplanes, planes, convs_layers)
mmedit/models/backbones/encoder_decoders/encoders/vgg.py:55
↓ 5 callersFunctionbuild_dataloader
Build PyTorch DataLoader. In distributed training, each GPU/process has a dataloader. In non-distributed training, there is only one dataload
mmedit/datasets/builder.py:83
↓ 5 callersFunctiondefault_init_weights
Initialize network weights. Args: modules (nn.Module): Modules to be initialized. scale (float): Scale initialized weights, espec
mmedit/models/common/sr_backbone_utils.py:7
↓ 5 callersMethodencode
(self, text)
mmedit/models/components/clip/simple_tokenizer.py:121
↓ 5 callersFunctionget_module_device
Get the device of a module. Args: module (nn.Module): A module contains the parameters. Returns: torch.device: The device of
mmedit/models/components/stylegan2/common.py:5
↓ 5 callersFunctionl1_loss
L1 loss. Args: pred (Tensor): Prediction Tensor with shape (n, c, h, w). target ([type]): Target Tensor with shape (n, c, h, w).
mmedit/models/losses/pixelwise_loss.py:13
↓ 5 callersMethodnormalize
Normalize the input image. Args: img (Tensor): Input image. Returns: Tensor: Normalized image.
mmedit/models/backbones/sr_backbones/tof.py:187
↓ 5 callersFunctionto_tensor
Convert objects of various python types to :obj:`torch.Tensor`. Supported types are: :class:`numpy.ndarray`, :class:`torch.Tensor`, :class:`S
mmedit/datasets/pipelines/formating.py:13
↓ 4 callersMethod__init__
(self, in_channels, mid_channels, num_blocks, res_scale)
mmedit/models/backbones/sr_backbones/ttsr_net.py:34
↓ 4 callersMethod__init__
(self, in_channels=3, kernel_size=3, num_block_groups=5,
mmedit/models/backbones/vfi_backbones/cain_net.py:254
↓ 4 callersMethod_join_tensors
Concat or Add two tensors. Args: x1 (Tensor): The first input tensor. x2 (Tensor): The second input tensor.
mmedit/models/backbones/vfi_backbones/flavr_net.py:332
↓ 4 callersMethod_make_layer
(self, planes, blocks, stride=1)
mmedit/models/components/clip/model.py:131
↓ 4 callersMethod_make_layer
(self, block, planes, num_blocks, stride, conv_cfg, norm_cfg, act_cfg, with_spectral_norm)
mmedit/models/backbones/encoder_decoders/encoders/resnet_enc.py:210
↓ 4 callersMethod_make_layer
(self, block, planes, blocks, stride=1, dilation=1)
mmedit/models/backbones/encoder_decoders/encoders/resnet.py:354
↓ 4 callersMethod_make_layer
(self, block, planes, num_blocks, conv_cfg, norm_cfg, act_cfg, with_spectral_norm)
mmedit/models/backbones/encoder_decoders/decoders/resnet_dec.py:169
↓ 4 callersMethod_make_layer
(self, block, mid_channels, num_blocks,
mmedit/models/backbones/vfi_backbones/flavr_net.py:189
↓ 4 callersMethod_transform
Apply spatial transform (flip, rotate) to the images. Args: imgs (torch.Tensor): The images to be transformed/ mode (
mmedit/models/common/ensemble.py:22
↓ 4 callersFunctionbuild
Build module function. Args: cfg (dict): Configuration for building modules. registry (obj): ``registry`` object. default
mmedit/models/builder.py:8
↓ 4 callersMethoddecode
(self, tokens)
mmedit/models/components/clip/simple_tokenizer.py:129
↓ 4 callersFunctionequalized_lr
r"""Equalized Learning Rate. This trick is proposed in: Progressive Growing of GANs for Improved Quality, Stability, and Variation The g
mmedit/models/components/stylegan2/modules.py:160
↓ 4 callersMethodevery_n_iters
(self, runner, n)
mmedit/core/hooks/ema.py:72
↓ 4 callersFunctiongeneration_init_weights
Default initialization of network weights for image generation. By default, we use normal init, but xavier and kaiming might work better for
mmedit/models/common/generation_model_utils.py:9
↓ 4 callersMethodis_better
(self, a, best)
mmedit/core/scheduler/lr_updater.py:196
↓ 4 callersFunctionparse_requirements
Parse the package dependencies listed in a requirements file but strips specific versioning information. Args: fname (str): path to r
setup.py:66
↓ 4 callersFunctionplcc
Pearson Linear Correlation Coefficient
mmedit/core/evaluation/metrics.py:587
↓ 4 callersMethodrestore_shape
Restore the predicted alpha to the original shape. The shape of the predicted alpha may not be the same as the shape of original inpu
mmedit/models/mattors/base_mattor.py:115
↓ 4 callersMethodsave_image
Save predicted alpha to file. Args: pred_alpha (np.ndarray): The predicted alpha matte of shape (H, W). meta (list[di
mmedit/models/mattors/base_mattor.py:179
↓ 3 callersMethod__init__
(self, sess, io_binding, output_names, base_model)
mmedit/core/export/wrappers.py:33
↓ 3 callersMethod__init__
(self, in_channels, out_stride=32, width_mult=1,
mmedit/models/backbones/encoder_decoders/encoders/indexnet_encoder.py:345
↓ 3 callersMethod__init__
(self, block, layers, in_channels, conv_cf
mmedit/models/backbones/encoder_decoders/encoders/resnet_enc.py:123
↓ 3 callersMethod__init__
(self, pretrained)
mmedit/models/backbones/sr_backbones/basicvsr_net.py:238
↓ 3 callersMethod__init__
(self, in_channels, out_channels, mid_channels=64,
mmedit/models/backbones/sr_backbones/edvr_net.py:323
↓ 3 callersMethod__init__
(self, norm_cfg, pretrained=None)
mmedit/models/backbones/vfi_backbones/tof_vfi_net.py:99
↓ 3 callersMethod__init__
(self, gan_type, real_label_val=1.0, fake_label_val=0.0,
mmedit/models/losses/gan_loss.py:24
↓ 3 callersMethod__init__
(self, loss_weight=1.0, reduction='mean', sample_wise=False)
mmedit/models/losses/pixelwise_loss.py:69
↓ 3 callersMethod_forward
(self, x)
mmedit/models/mattors/gca.py:40
↓ 3 callersMethod_forward
(self, x, refine)
mmedit/models/mattors/dim.py:66
↓ 3 callersFunction_make_kernel
(k)
mmedit/models/components/stylegan2/modules.py:314
↓ 3 callersFunction_mesh_grid
Generate the mesh grid, centering at zero. Args: kernel_size (int): The size of the kernel. Returns: x_grid (ndarray): x-coo
mmedit/datasets/pipelines/blur_kernels.py:28
↓ 3 callersFunctiondigit_version
(version_str)
mmedit/__init__.py:10
↓ 3 callersMethodevaluate
Evaluation function. Args: runner (``mmcv.runner.BaseRunner``): The runner. results (dict): Model forward results.
mmedit/core/evaluation/eval_hooks.py:50
↓ 3 callersMethodevaluate
Evaluate predicted alpha matte. The evaluation metrics are determined by ``self.test_cfg.metrics``. Args: pred_alpha (np
mmedit/models/mattors/base_mattor.py:152
↓ 3 callersFunctionextract_bbox_patch
Extract patch from a given bbox. Args: bbox (torch.Tensor | numpy.array): Bbox with (top, left, h, w). If `img` has batch dim
mmedit/models/common/model_utils.py:22
↓ 3 callersMethodextract_patches
Extract feature patches. The feature map will be padded automatically to make sure the number of patches is equal to `(H / stride) *
mmedit/models/common/gca_module.py:315
↓ 3 callersFunctionget_rotated_sigma_matrix
Calculate the rotated sigma matrix (two dimensional matrix). Args: sig_x (float): Standard deviation along the horizontal direction.
mmedit/datasets/pipelines/blur_kernels.py:9
↓ 3 callersFunctionget_unknown_tensor
Get 1-channel unknown area tensor from the 3 or 1-channel trimap tensor. Args: trimap (Tensor): Tensor with shape (N, 3, H, W) or (N, 1,
mmedit/models/mattors/utils.py:5
↓ 3 callersMethodim2col
Reshape image-style feature to columns. This function is used for unfold feature maps to columns. The details of this function can be
mmedit/models/common/contextual_attention.py:320
↓ 3 callersFunctioninit_model
Initialize a model from config file. Args: config (str or :obj:`mmcv.Config`): Config file path or the config object.
mmedit/apis/matting_inference.py:48
↓ 3 callersFunctionmetric_eva
(pred_score, gt_score)
tools/test_mat.py:30
↓ 3 callersMethodpad
(self, inputs, kernel_size, dilation)
mmedit/models/backbones/encoder_decoders/encoders/indexnet_encoder.py:284
↓ 3 callersFunctionpixel_unshuffle
Down-sample by pixel unshuffle. Args: x (Tensor): Input tensor. scale (int): Scale factor. Returns: Tensor: Output t
mmedit/models/common/downsample.py:2
↓ 3 callersFunctionpolynomial_kernel
Create a polynomial kernel.
mmedit/core/evaluation/inceptions.py:85
↓ 3 callersFunctionrestoration_inference
Inference image with the model. Args: model (nn.Module): The loaded model. img (str): File path of input image. Returns:
mmedit/apis/restoration_inference.py:17
↓ 3 callersMethodsave_visualization
Save visualization results. Args: img (torch.Tensor): Tensor with shape of (n, 3, h, w). filename (str): Path to save
mmedit/models/inpaintors/two_stage.py:129
↓ 3 callersMethodscatter
Scatter function. Args: inputs (Tensor): Input Tensor. kwargs (dict): Args for ``mmcv.parallel.scatte
mmedit/core/distributed_wrapper.py:93
↓ 3 callersFunctionsrocc
Spearman Rank Order Correlation Coefficient
mmedit/core/evaluation/metrics.py:580
↓ 2 callersMethod__init__
(self, img_folder, pipeline, file_path,
mmedit/datasets/iqa_koniq_dataset.py:79
↓ 2 callersMethod__init__
(self, depth, in_channels, stem_channels,
mmedit/models/backbones/encoder_decoders/encoders/resnet.py:234
↓ 2 callersMethod__init__
(self)
mmedit/models/backbones/sr_backbones/tof.py:92
↓ 2 callersMethod__init__
(self, encoder, imnet, local_ensemble=True,
mmedit/models/backbones/sr_backbones/liif_net.py:32
↓ 2 callersMethod__init__
(self, in_channels, channel_growth, num_layers)
mmedit/models/backbones/sr_backbones/rdn.py:44
↓ 2 callersMethod__init__
(self, mid_channels, growth_channels=32)
mmedit/models/backbones/sr_backbones/rrdb_net.py:73
↓ 2 callersMethod__init__
(self, in_channels, out_channels)
mmedit/models/extractors/feedback_hour_glass.py:28
↓ 2 callersMethod__init__
(self, buffer_size, buffer_ratio=0.5)
mmedit/models/common/generation_model_utils.py:72
↓ 2 callersMethod__init__
(self, loss_weight=1.0, reduction='mean', sample_wise=False)
mmedit/models/losses/composition_loss.py:25
↓ 2 callersMethod__init__
(self, layer_name_list, vgg_type='vgg19', use_input_norm=Tr
mmedit/models/losses/perceptual_loss.py:32
↓ 2 callersMethod__len__
Length of the dataset. Returns: int: Length of the dataset.
mmedit/datasets/base_dataset.py:61
↓ 2 callersMethod_color_jitter
(self, image, this_seed)
mmedit/datasets/pipelines/augmentation.py:664
↓ 2 callersMethod_crop_hole
Create a all-zero rectangle hole in the image. Args: img (np.ndarray): Source image. start_point (tuple[int]): The to
mmedit/datasets/pipelines/matting_aug.py:349
↓ 2 callersFunction_extract
(bbox, img)
mmedit/models/common/model_utils.py:41
↓ 2 callersMethod_get_params
Get parameters for affine transformation. Returns: paras (tuple): Params to be passed to the affine transformation.
mmedit/datasets/pipelines/augmentation.py:424
↓ 2 callersMethod_gram_mat
Calculate Gram matrix. Args: x (torch.Tensor): Tensor with shape of (n, c, h, w). Returns: torch.Tensor: Gra
mmedit/models/losses/perceptual_loss.py:218
↓ 2 callersFunction_mod
(bbox, target_size)
mmedit/models/common/model_utils.py:89
↓ 2 callersMethod_resize
(self, img)
mmedit/datasets/pipelines/matlab_like_resize.py:213
↓ 2 callersMethod_save_image
Save the image. Args: meta (list[dict]): Meta data, such as path of target file. Default: None. These dictionarie
mmedit/models/video_interpolators/basic_interpolator.py:189
next →1–100 of 1,214, ranked by callers