MCPcopy Create free account

hub / github.com/CVL-UESTC/PFT-SR / functions

Functions370 in github.com/CVL-UESTC/PFT-SR

↓ 44 callersMethodget
(self, name, suffix='basicsr')
basicsr/utils/registry.py:65
↓ 17 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
basicsr/utils/logger.py:146
↓ 14 callersMethod__init__
(self)
basicsr/utils/diffjpeg.py:125
↓ 12 callersFunctionscandir
Scan a directory to find the interested files. Args: dir_path (str): Path of the directory. suffix (str | tuple(str), optiona
basicsr/utils/misc.py:52
↓ 11 callersMethod__init__
(self, img_size=64, patch_size=1, in_chans=3,
basicsr/archs/pft_arch.py:888
↓ 11 callersMethodkeys
(self)
basicsr/utils/registry.py:80
↓ 9 callersMethodclose
(self)
basicsr/utils/lmdb_util.py:196
↓ 9 callersMethodflops
(self, input_resolution=None)
basicsr/archs/pft_arch.py:1149
↓ 8 callersFunctionmake_lmdb_from_imgs
Make lmdb from images. Contents of lmdb. The file structure is: :: example.lmdb ├── data.mdb ├── lock.mdb
basicsr/utils/lmdb_util.py:9
↓ 8 callersFunctionprepare_keys
Prepare image path list and keys for DIV2K dataset. Args: folder_path (str): Folder path. Returns: list[str]: Image pa
basicsr/utils/create_lmdb.py:14
↓ 5 callersMethodget_bare_model
Get bare model, especially under wrapping with DistributedDataParallel or DataParallel.
basicsr/models/base_model.py:139
↓ 5 callersFunctionimg2tensor
Numpy array to tensor. Args: imgs (list[ndarray] | ndarray): Input images. bgr2rgb (bool): Whether to change bgr to rgb.
basicsr/utils/img_util.py:9
↓ 4 callersMethod__init__
(self, loss_weight=1.0, reduction='mean')
basicsr/losses/basic_loss.py:37
↓ 4 callersFunction_convert_input_type_range
Convert the type and range of the input image. It converts the input image to np.float32 type and range of [0, 1]. It is mainly used for p
basicsr/utils/color_util.py:129
↓ 4 callersFunction_convert_input_type_range
Convert the type and range of the input image. It converts the input image to np.float32 type and range of [0, 1]. It is mainly used for p
basicsr/utils/matlab_functions.py:305
↓ 4 callersFunction_convert_output_type_range
Convert the type and range of the image according to dst_type. It converts the image to desired type and range. If `dst_type` is np.uint8,
basicsr/utils/color_util.py:156
↓ 4 callersFunction_convert_output_type_range
Convert the type and range of the image according to dst_type. It converts the image to desired type and range. If `dst_type` is np.uint8,
basicsr/utils/matlab_functions.py:332
↓ 4 callersFunction_ntuple
(n)
basicsr/archs/arch_util.py:299
↓ 4 callersMethodforward_features
(self, x, params)
basicsr/archs/pft_arch.py:1047
↓ 4 callersFunctionget_dist_info
()
basicsr/utils/dist_util.py:60
↓ 4 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
basicsr/metrics/metric_util.py:6
↓ 4 callersFunctionrgb2ycbcr_pt
Convert RGB images to YCbCr images (PyTorch version). It implements the ITU-R BT.601 conversion for standard-definition television. See more de
basicsr/utils/color_util.py:186
↓ 4 callersMethodstart
(self)
basicsr/utils/logger.py:20
↓ 4 callersFunctiontensor2img
Convert torch Tensors into image numpy arrays. After clamping to [min, max], values will be normalized to [0, 1]. Args: tensor
basicsr/utils/img_util.py:38
↓ 4 callersFunctiontest
(img_path, img_path2, crop_border, test_y_channel=False)
basicsr/metrics/test_metrics/test_psnr_ssim.py:9
↓ 4 callersFunctionto_y_channel
Change to Y channel of YCbCr. Args: img (ndarray): Images with range [0, 255]. Returns: (ndarray): Images with range [
basicsr/metrics/metric_util.py:32
↓ 3 callersFunctionbgr2ycbcr
Convert a BGR image to YCbCr image. The bgr version of rgb2ycbcr. It implements the ITU-R BT.601 conversion for standard-definition t
basicsr/utils/color_util.py:38
↓ 3 callersFunctionbuild_dataloader
Build dataloader. Args: dataset (torch.utils.data.Dataset): Dataset. dataset_opt (dict): Dataset options. It contains the fol
basicsr/data/__init__.py:40
↓ 3 callersFunctionbuild_dataset
Build dataset from options. Args: dataset_opt (dict): Configuration for dataset. It must contain: name (str): Dataset nam
basicsr/data/__init__.py:25
↓ 3 callersFunctioncalculate_psnr_pt
Calculate PSNR (Peak Signal-to-Noise Ratio) (PyTorch version). Reference: https://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio Args:
basicsr/metrics/psnr_ssim.py:52
↓ 3 callersFunctioncalculate_ssim_pt
Calculate SSIM (structural similarity) (PyTorch version). ``Paper: Image quality assessment: From error visibility to structural similarity``
basicsr/metrics/psnr_ssim.py:132
↓ 3 callersFunctionget_time_str
()
basicsr/utils/misc.py:20
↓ 3 callersFunctionmake_cuda_ext
(name, module, sources, sources_cuda=None)
setup.py:82
↓ 3 callersFunctionmesh_grid
Generate the mesh grid, centering at zero. Args: kernel_size (int): Returns: xy (ndarray): with the shape (kernel_size
basicsr/data/degradations.py:32
↓ 3 callersFunctionmkdir_and_rename
mkdirs. If path exists, rename it with timestamp and create a new one. Args: path (str): Folder path.
basicsr/utils/misc.py:24
↓ 3 callersMethodpreload
(self)
basicsr/data/prefetch_dataloader.py:102
↓ 3 callersMethodput
(self, img_byte, key, img_shape)
basicsr/utils/lmdb_util.py:185
↓ 3 callersMethodrepeat
(x, k=2)
basicsr/utils/diffjpeg.py:366
↓ 3 callersMethodsave
(self, epoch, current_iter)
basicsr/models/sr_model.py:277
↓ 3 callersFunctionsigma_matrix2
Calculate the rotated sigma matrix (two dimensional matrix). Args: sig_x (float): sig_y (float): theta (float): Radi
basicsr/data/degradations.py:16
↓ 3 callersFunctiontrunc_normal_
r"""Fills the input Tensor with values drawn from a truncated normal distribution. From: https://github.com/rwightman/pytorch-image-models
basicsr/archs/arch_util.py:272
↓ 3 callersMethodvalidation
Validation function. Args: dataloader (torch.utils.data.DataLoader): Validation dataloader. current_iter (int): C
basicsr/models/base_model.py:37
↓ 2 callersMethod__init__
(self, loader)
basicsr/data/prefetch_dataloader.py:68
↓ 2 callersMethod_do_register
(self, name, obj, suffix=None)
basicsr/utils/registry.py:38
↓ 2 callersFunction_scandir
(dir_path, suffix, recursive)
basicsr/utils/misc.py:73
↓ 2 callersFunction_totensor
(img, bgr2rgb, float32)
basicsr/utils/img_util.py:22
↓ 2 callersFunctionbuild_loss
Build loss from options. Args: opt (dict): Configuration. It must contain: type (str): Model type.
basicsr/losses/__init__.py:18
↓ 2 callersFunctionbuild_model
Build model from options. Args: opt (dict): Configuration. It must contain: model_type (str): Model type.
basicsr/models/__init__.py:18
↓ 2 callersFunctionbuild_network
(opt)
basicsr/archs/__init__.py:18
↓ 2 callersFunctioncalculate_weights_indices
Calculate weights and indices, used for imresize function. Args: in_length (int): Input length. out_length (int): Output leng
basicsr/utils/matlab_functions.py:16
↓ 2 callersFunctioncubic
cubic function used for calculate_weights_indices.
basicsr/utils/matlab_functions.py:6
↓ 2 callersFunctiondict2str
dict to string for printing options. Args: opt (dict): Option dict. indent_level (int): Indent level. Default: 1. Retu
basicsr/utils/options.py:54
↓ 2 callersMethodfeed_data
(self, data)
basicsr/models/sr_model.py:90
↓ 2 callersFunctionfilter2D
PyTorch version of cv2.filter2D Args: img (Tensor): (b, c, h, w) kernel (Tensor): (b, k, k)
basicsr/utils/img_process_util.py:7
↓ 2 callersMethodforward
Args: pred (Tensor): of shape (N, C, H, W). Predicted tensor. target (Tensor): of shape (N, C, H, W). Ground truth
basicsr/losses/basic_loss.py:45
↓ 2 callersFunctiongenerate_gaussian_noise
Generate Gaussian noise. Args: img (Numpy array): Input image, shape (h, w, c), range [0, 1], float32. sigma (float): Noise s
basicsr/data/degradations.py:419
↓ 2 callersFunctiongenerate_gaussian_noise_pt
Add Gaussian noise (PyTorch version). Args: img (Tensor): Shape (b, c, h, w), range[0, 1], float32. scale (float | Tensor): N
basicsr/data/degradations.py:460
↓ 2 callersFunctiongenerate_poisson_noise
Generate poisson noise. Reference: https://github.com/scikit-image/scikit-image/blob/main/skimage/util/noise.py#L37-L219 Args:
basicsr/data/degradations.py:559
↓ 2 callersFunctiongenerate_poisson_noise_pt
Generate a batch of poisson noise (PyTorch version) Args: img (Tensor): Input image, shape (b, c, h, w), range [0, 1], float32.
basicsr/data/degradations.py:609
↓ 2 callersMethodget_avg_time
(self)
basicsr/utils/logger.py:41
↓ 2 callersFunctionget_env_info
Get environment information. Currently, only log the software version.
basicsr/utils/logger.py:188
↓ 2 callersFunctionimfrombytes
Read an image from bytes. Args: content (bytes): Image bytes got from files or other streams. flag (str): Flags specifying th
basicsr/utils/img_util.py:114
↓ 2 callersFunctioninit_dist
(launcher, backend='nccl', **kwargs)
basicsr/utils/dist_util.py:10
↓ 2 callersMethodload_network
Load network. Args: load_path (str): The path of networks to be loaded. net (nn.Module): Network. st
basicsr/models/base_model.py:293
↓ 2 callersFunctionmake_exp_dirs
Make dirs for experiments.
basicsr/utils/misc.py:38
↓ 2 callersMethodmodel_ema
(self, decay=0.999)
basicsr/models/base_model.py:76
↓ 2 callersMethodnext
(self)
basicsr/data/prefetch_dataloader.py:114
↓ 2 callersMethodnondist_validation
(self, dataloader, current_iter, tb_logger, save_img)
basicsr/models/sr_model.py:187
↓ 2 callersFunctionnorm_cdf
(x)
basicsr/archs/arch_util.py:238
↓ 2 callersFunctionordered_yaml
Support OrderedDict for yaml. Returns: tuple: yaml Loader and Dumper.
basicsr/utils/options.py:13
↓ 2 callersFunctionparse_options
(root_path, is_train=True)
basicsr/utils/options.py:99
↓ 2 callersFunctionprocess_image
(image_input_path, image_output_path, model, device)
inference.py:41
↓ 2 callersFunctionquality_to_factor
Calculate factor corresponding to quality Args: quality(float): Quality for jpeg compression. Returns: float: Compres
basicsr/utils/diffjpeg.py:32
↓ 2 callersFunctionrandom_bivariate_Gaussian
Randomly generate bivariate isotropic or anisotropic Gaussian kernels. In the isotropic mode, only `sigma_x_range` is used. `sigma_y_range` and
basicsr/data/degradations.py:176
↓ 2 callersFunctionrandom_bivariate_generalized_Gaussian
Randomly generate bivariate generalized Gaussian kernels. In the isotropic mode, only `sigma_x_range` is used. `sigma_y_range` and `rotation_ra
basicsr/data/degradations.py:220
↓ 2 callersFunctionrandom_bivariate_plateau
Randomly generate bivariate plateau kernels. In the isotropic mode, only `sigma_x_range` is used. `sigma_y_range` and `rotation_range` is ignor
basicsr/data/degradations.py:272
↓ 2 callersMethodrecord
(self)
basicsr/utils/logger.py:23
↓ 2 callersMethodsave
Save networks and training state.
basicsr/models/base_model.py:33
↓ 2 callersMethodsave_network
Save networks. Args: net (nn.Module | list[nn.Module]): Network(s) to be saved. net_label (str): Network label.
basicsr/models/base_model.py:212
↓ 2 callersFunctionwindow_partition
Args: x: (b, h, w, c) window_size (int): window size Returns: windows: (num_windows*b, window_size, window_size, c)
basicsr/archs/pft_arch.py:172
↓ 1 callersMethod__init__
(self, scale, num_feat)
basicsr/archs/arch_util.py:99
↓ 1 callersMethod__init__
(self, optimizer, milestones, gamma=0.1, restarts=(0, ), restart_weights=(1, ), last_epoch=-1)
basicsr/models/lr_scheduler.py:19
↓ 1 callersMethod__iter__
(self)
basicsr/data/prefetch_dataloader.py:35
↓ 1 callersFunction_augment
(img)
basicsr/data/transforms.py:120
↓ 1 callersFunction_augment_flow
(flow)
basicsr/data/transforms.py:129
↓ 1 callersMethod_get_init_lr
Get the initial lr, which is set by the scheduler.
basicsr/models/base_model.py:177
↓ 1 callersFunction_init_dist_pytorch
(backend, **kwargs)
basicsr/utils/dist_util.py:21
↓ 1 callersFunction_init_dist_slurm
Initialize slurm distributed training environment. If argument ``port`` is not specified, then the master port will be system environment
basicsr/utils/dist_util.py:28
↓ 1 callersMethod_initialize_best_metric_results
Initialize the best metric results dict for recording the best metric value and iteration.
basicsr/models/base_model.py:51
↓ 1 callersMethod_log_validation_metric_values
(self, current_iter, dataset_name, tb_logger)
basicsr/models/sr_model.py:254
↓ 1 callersFunction_minimal_ext_cmd
(cmd)
setup.py:20
↓ 1 callersFunction_no_grad_trunc_normal_
(tensor, mean, std, a, b)
basicsr/archs/arch_util.py:234
↓ 1 callersFunction_postprocess_yml_value
(value)
basicsr/utils/options.py:75
↓ 1 callersMethod_print_different_keys_loading
Print keys with different name or different size when loading models. 1. Print keys with different names. 2. If strict=False, prin
basicsr/models/base_model.py:258
↓ 1 callersMethod_set_lr
Set learning rate for warm-up. Args: lr_groups_l (list): List for lr_groups, each for an optimizer.
basicsr/models/base_model.py:167
↓ 1 callersFunction_ssim
Calculate SSIM (structural similarity) for one channel images. It is called by func:`calculate_ssim`. Args: img (ndarray): Imag
basicsr/metrics/psnr_ssim.py:170
↓ 1 callersFunction_ssim_pth
Calculate SSIM (structural similarity) (PyTorch version). It is called by func:`calculate_ssim_pt`. Args: img (Tensor): Images
basicsr/metrics/psnr_ssim.py:201
↓ 1 callersMethod_update_best_metric_result
(self, dataset_name, metric, val, current_iter)
basicsr/models/base_model.py:66
↓ 1 callersFunctionadd_jpg_compression
Add JPG compression artifacts. Args: img (Numpy array): Input image, shape (h, w, c), range [0, 1], float32. quality (float):
basicsr/data/degradations.py:731
↓ 1 callersFunctionaugment
Augment: horizontal flips OR rotate (0, 90, 180, 270 degrees). We use vertical flip and transpose for rotation implementation. All the ima
basicsr/data/transforms.py:94
next →1–100 of 370, ranked by callers