MCPcopy Create free account

hub / github.com/DragonisCV/RAM / functions

Functions659 in github.com/DragonisCV/RAM

↓ 142 callersMethodget
(self, name, suffix='ram')
ram/utils/registry.py:65
↓ 29 callersMethodkeys
(self)
ram/utils/registry.py:80
↓ 28 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
ram/utils/logger.py:146
↓ 26 callersFunctiontensor2img
Convert torch Tensors into image numpy arrays. After clamping to [min, max], values will be normalized to [0, 1]. Args: tensor (Tens
ram/utils/img_util.py:38
↓ 14 callersMethod__init__
(self)
ram/utils/diffjpeg.py:125
↓ 14 callersMethod__init__
(self, dim)
ram/archs/restormerRFR_arch.py:133
↓ 14 callersMethod_load_image
(self, path, key)
ram/data/base/base_dataset.py:23
↓ 11 callersMethod__init__
(self, dim)
ram/archs/promptir_arch.py:137
↓ 10 callersMethod__init__
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.)
ram/archs/swinir_arch.py:17
↓ 10 callersMethod__init__
(self, dim)
ram/archs/AdaSAM_RestormerWoskip_arch.py:138
↓ 10 callersMethod__init__
(self, loss_weight=1.0, reduction='mean')
ram/losses/losses.py:70
↓ 10 callersFunctionbuild_loss
Build loss from options. Args: opt (dict): Configuration. It must contain: type (str): Model type.
ram/losses/__init__.py:21
↓ 10 callersMethodload_network
Load network. Args: load_path (str): The path of networks to be loaded. net (nn.Module): Network. strict
ram/models/base_model.py:293
↓ 10 callersMethodsave_network
Save networks. Args: net (nn.Module | list[nn.Module]): Network(s) to be saved. net_label (str): Network label.
ram/models/base_model.py:212
↓ 9 callersMethod_init_file_client
(self)
ram/data/base/base_dataset.py:17
↓ 9 callersMethod_process_images
(self, img_gt, img_lq)
ram/data/base/base_dataset.py:40
↓ 9 callersFunctionbuild_network
(opt,is_print=True)
ram/archs/__init__.py:18
↓ 9 callersFunctionparse_degradations
(augment_opt)
ram/data/utils/online_util.py:126
↓ 8 callersMethodbackward
(ctx, grad_output)
ram/ops/upfirdn2d/upfirdn2d.py:135
↓ 8 callersMethodget_bare_model
Get bare model, especially under wrapping with DistributedDataParallel or DataParallel.
ram/models/base_model.py:139
↓ 8 callersMethodrepeat
(x, k=2)
ram/utils/diffjpeg.py:366
↓ 8 callersFunctionscandir
Scan a directory to find the interested files. Args: dir_path (str): Path of the directory. suffix (str | tuple(str), optional):
ram/utils/misc.py:52
↓ 7 callersMethod_test_processing
(self, img_gt, img_lq, scale)
ram/data/base/base_dataset.py:33
↓ 7 callersMethod_train_augmentation
(self, img_gt, img_lq, scale, gt_path=None)
ram/data/base/base_dataset.py:27
↓ 7 callersFunctionimwrite
Write image to file. Args: img (ndarray): Image array to be written. file_path (str): Image file path. params (None or li
ram/utils/img_util.py:135
↓ 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
ram/metrics/metric_util.py:6
↓ 7 callersFunctionto_y_channel
Change to Y channel of YCbCr. Args: img (ndarray): Images with range [0, 255]. Returns: (ndarray): Images with range [0, 255
ram/metrics/metric_util.py:32
↓ 6 callersMethod__init__
(self,name)
ram/data/utils/online_util.py:6
↓ 6 callersMethodflops
(self)
ram/archs/swinir_arch.py:516
↓ 6 callersFunctionparse_options
(root_path, is_train=True)
ram/utils/options.py:127
↓ 5 callersMethod__init__
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.)
ram/archs/AdaSAM_arch.py:28
↓ 5 callersFunctioncenter_crop
(img_gt,crop_pad_size)
ram/data/utils/transforms.py:25
↓ 5 callersMethodget_optimizer
(self, optim_type, params, lr, **kwargs)
ram/models/base_model.py:104
↓ 5 callersMethodreduce_loss_dict
reduce loss dict. In distributed training, it averages the losses among different GPUs . Args: loss_dict (OrderedDict):
ram/models/base_model.py:371
↓ 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 pre-
ram/utils/color_util.py:129
↓ 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, im
ram/utils/color_util.py:156
↓ 4 callersMethod_gram_mat
Calculate Gram matrix. Args: x (torch.Tensor): Tensor with shape of (n, c, h, w). Returns: torch.Tensor: Gra
ram/losses/losses.py:328
↓ 4 callersFunction_ntuple
(n)
ram/archs/arch_util.py:299
↓ 4 callersFunctionbuild_dataloader
Build dataloader. Args: dataset (torch.utils.data.Dataset): Dataset. dataset_opt (dict): Dataset options. It contains the followi
ram/data/__init__.py:40
↓ 4 callersFunctionbuild_dataset
Build dataset from options. Args: dataset_opt (dict): Configuration for dataset. It must contain: name (str): Dataset name.
ram/data/__init__.py:25
↓ 4 callersFunctionget_dist_info
()
ram/utils/dist_util.py:60
↓ 4 callersFunctionget_time_str
()
ram/utils/misc.py:20
↓ 4 callersMethodmodel_to_device
Model to device. It also warps models with DistributedDataParallel or DataParallel. Args: net (nn.Module)
ram/models/base_model.py:88
↓ 4 callersFunctionpaired_paths_from_folder
Generate paired paths from folders. Args: folders (list[str]): A list of folder path. The order of list should be [input_fold
ram/data/utils/data_util.py:111
↓ 4 callersMethodprint_network
Print the str and parameter number of a network. Args: net (nn.Module)
ram/models/base_model.py:148
↓ 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 deta
ram/utils/color_util.py:186
↓ 4 callersMethodsave
Save networks and training state.
ram/models/base_model.py:32
↓ 4 callersMethodsave_training_state
Save training states during training, which will be used for resuming. Args: epoch (int): Current epoch. curr
ram/models/base_model.py:322
↓ 4 callersMethodsetup_schedulers
Set up schedulers.
ram/models/base_model.py:123
↓ 4 callersMethodstart
(self)
ram/utils/logger.py:20
↓ 4 callersFunctiontrunc_normal_
r"""Fills the input Tensor with values drawn from a truncated normal distribution. From: https://github.com/rwightman/pytorch-image-models/bl
ram/archs/arch_util.py:272
↓ 3 callersMethod__init__
(self, in_channels, out_channels, kernel_size,
ram/ops/dcn/deform_conv.py:193
↓ 3 callersMethod_save_results
(self, data, folder_name)
scripts/analysis_utils.py:186
↓ 3 callersMethod_update_best_metric_result
(self, dataset_name, metric, val, current_iter)
ram/models/base_model.py:65
↓ 3 callersFunctionattr_grad
Calculate attribute gradient.
scripts/analysis_utils.py:55
↓ 3 callersFunctionaugment
Augment: horizontal flips OR rotate (0, 90, 180, 270 degrees). We use vertical flip and transpose for rotation implementation. All the images
ram/data/utils/transforms.py:129
↓ 3 callersFunctiondict2str
dict to string for printing options. Args: opt (dict): Option dict. indent_level (int): Indent level. Default: 1. Return:
ram/utils/options.py:54
↓ 3 callersMethodget_current_visuals
(self)
ram/models/ram_plus_finetune_model.py:449
↓ 3 callersFunctionget_env_info
Get environment information. Currently, only log the software version.
ram/utils/logger.py:188
↓ 3 callersFunctionimfrombytes
Read an image from bytes. Args: content (bytes): Image bytes got from files or other streams. flag (str): Flags specifying the co
ram/utils/img_util.py:114
↓ 3 callersMethodinit_ema_model
(self)
ram/models/ram_base_model.py:46
↓ 3 callersFunctionmake_exp_dirs
Make dirs for experiments.
ram/utils/misc.py:38
↓ 3 callersFunctionmkdir_and_rename
mkdirs. If path exists, rename it with timestamp and create a new one. Args: path (str): Folder path.
ram/utils/misc.py:24
↓ 3 callersMethodmodel_ema
(self, decay=0.999)
ram/models/base_model.py:76
↓ 3 callersMethodpreload
(self)
ram/data/utils/prefetch_dataloader.py:105
↓ 3 callersFunctionshape_check
ram/ops/dcn/src/deform_conv_cuda.cpp:62
↓ 3 callersMethodvalidation
Validation function. Args: dataloader (torch.utils.data.DataLoader): Validation dataloader. current_iter (int): Curre
ram/models/base_model.py:36
↓ 3 callersFunctionwindow_partition
Args: x: (B, H, W, C) window_size (int): window size Returns: windows: (num_windows*B, window_size, window_size, C)
ram/archs/swinir_arch.py:35
↓ 2 callersMethod__init__
(self, loader)
ram/data/utils/prefetch_dataloader.py:70
↓ 2 callersMethod__init__
(self, optimizer, milestones, gamma=0.1, restarts=(0, ), restart_weights=(1, ), last_epoch=-1)
ram/models/lr_scheduler.py:19
↓ 2 callersMethod_do_register
(self, name, obj, suffix=None)
ram/utils/registry.py:38
↓ 2 callersMethod_get_interpolated_img_from_mask_attribute_path
(self, base_img, final_img, alpha, order_array)
scripts/analysis_utils.py:173
↓ 2 callersMethod_initialize_best_metric_results
Initialize the best metric results dict for recording the best metric value and iteration.
ram/models/base_model.py:50
↓ 2 callersMethod_log_validation_metric_values
(self, current_iter, dataset_name, tb_logger)
ram/models/ram_plus_finetune_model.py:434
↓ 2 callersMethod_log_validation_metric_values
(self, current_iter, dataset_name, tb_logger)
ram/models/ram_finetune_model.py:203
↓ 2 callersFunction_totensor
(img, bgr2rgb, float32)
ram/utils/img_util.py:22
↓ 2 callersFunctionbuild_model
Build model from options. Args: opt (dict): Configuration. It must contain: model_type (str): Model type.
ram/models/__init__.py:18
↓ 2 callersFunctioncalculate_metric
Calculate metric from data and options. Args: opt (dict): Configuration. It must contain: type (str): Model type.
ram/metrics/__init__.py:10
↓ 2 callersFunctioncalculate_psnr
Calculate PSNR (Peak Signal-to-Noise Ratio). Reference: https://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio Args: img (ndarray)
ram/metrics/psnr_ssim.py:12
↓ 2 callersFunctioncalculate_ssim
Calculate SSIM (structural similarity). ``Paper: Image quality assessment: From error visibility to structural similarity`` The results are
ram/metrics/psnr_ssim.py:85
↓ 2 callersFunctioncalculate_weights_indices
Calculate weights and indices, used for imresize function. Args: in_length (int): Input length. out_length (int): Output length.
ram/utils/matlab_functions.py:16
↓ 2 callersMethodconv_gauss
(self, img)
ram/losses/losses.py:194
↓ 2 callersFunctioncubic
cubic function used for calculate_weights_indices.
ram/utils/matlab_functions.py:6
↓ 2 callersFunctionestimate_aggd_param
Estimate AGGD (Asymmetric Generalized Gaussian Distribution) parameters. Args: block (ndarray): 2D Image block. Returns: tup
ram/metrics/niqe.py:13
↓ 2 callersMethodfeed_data
(self, data)
ram/models/ram_plus_finetune_model.py:117
↓ 2 callersFunctionfilter2D
PyTorch version of cv2.filter2D Args: img (Tensor): (b, c, h, w) kernel (Tensor): (b, k, k)
ram/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 te
ram/losses/losses.py:78
↓ 2 callersMethodforward_features
(self, x, mask=None, patch_size=1)
ram/archs/swinir_arch.py:823
↓ 2 callersMethodget_avg_time
(self)
ram/utils/logger.py:41
↓ 2 callersFunctionimg2tensor
Numpy array to tensor. Args: imgs (list[ndarray] | ndarray): Input images. bgr2rgb (bool): Whether to change bgr to rgb.
ram/utils/img_util.py:9
↓ 2 callersFunctioninit_dist
(launcher, backend='nccl', **kwargs)
ram/utils/dist_util.py:10
↓ 2 callersMethodinit_weights
(self)
ram/ops/dcn/deform_conv.py:322
↓ 2 callersMethodlaplacian_kernel
(self, current)
ram/losses/losses.py:199
↓ 2 callersMethodload_pretrained_models
(self)
ram/models/ram_plus_pretrain_model.py:46
↓ 2 callersMethodload_pretrained_models
(self)
ram/models/ram_plus_finetune_model.py:54
↓ 2 callersMethodload_pretrained_models
(self)
ram/models/ram_base_model.py:40
↓ 2 callersFunctionmain
()
inference/inference.py:56
↓ 2 callersMethodmask_model_ema
(self, decay=0.999)
ram/models/ram_plus_pretrain_model.py:79
↓ 2 callersMethodmodel_ema
(self, decay=0.999)
ram/models/ram_plus_pretrain_model.py:87
↓ 2 callersMethodmodel_ema
(self, decay=0.999)
ram/models/ram_base_model.py:58
next →1–100 of 659, ranked by callers