SYMBOL INDEX (741 symbols across 75 files) FILE: basicsr/archs/__init__.py function build_network (line 19) | def build_network(opt): FILE: basicsr/archs/arcface_arch.py function conv3x3 (line 5) | def conv3x3(inplanes, outplanes, stride=1): class BasicBlock (line 16) | class BasicBlock(nn.Module): method __init__ (line 27) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 37) | def forward(self, x): class IRBlock (line 56) | class IRBlock(nn.Module): method __init__ (line 68) | def __init__(self, inplanes, planes, stride=1, downsample=None, use_se... method forward (line 82) | def forward(self, x): class Bottleneck (line 103) | class Bottleneck(nn.Module): method __init__ (line 114) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 126) | def forward(self, x): class SEBlock (line 149) | class SEBlock(nn.Module): method __init__ (line 157) | def __init__(self, channel, reduction=16): method forward (line 164) | def forward(self, x): class ResNetArcFace (line 172) | class ResNetArcFace(nn.Module): method __init__ (line 183) | def __init__(self, block, layers, use_se=True): method _make_layer (line 214) | def _make_layer(self, block, planes, num_blocks, stride=1): method forward (line 229) | def forward(self, x): FILE: basicsr/archs/arch_util.py function default_init_weights (line 18) | def default_init_weights(module_list, scale=1, bias_fill=0, **kwargs): function make_layer (line 48) | def make_layer(basic_block, num_basic_block, **kwarg): class ResidualBlockNoBN (line 64) | class ResidualBlockNoBN(nn.Module): method __init__ (line 79) | def __init__(self, num_feat=64, res_scale=1, pytorch_init=False): method forward (line 89) | def forward(self, x): class Upsample (line 95) | class Upsample(nn.Sequential): method __init__ (line 103) | def __init__(self, scale, num_feat): function flow_warp (line 117) | def flow_warp(x, flow, interp_mode='bilinear', padding_mode='zeros', ali... function resize_flow (line 151) | def resize_flow(flow, size_type, sizes, interp_mode='bilinear', align_co... function pixel_unshuffle (line 190) | def pixel_unshuffle(x, scale): class DCNv2Pack (line 209) | class DCNv2Pack(ModulatedDeformConvPack): method forward (line 220) | def forward(self, x, feat): function _no_grad_trunc_normal_ (line 239) | def _no_grad_trunc_normal_(tensor, mean, std, a, b): function trunc_normal_ (line 277) | def trunc_normal_(tensor, mean=0., std=1., a=-2., b=2.): function _ntuple (line 304) | def _ntuple(n): FILE: basicsr/archs/dir_dist_codeformer_multiscale_arch.py function calc_mean_std (line 16) | def calc_mean_std(feat, eps=1e-5): function adaptive_instance_normalization (line 33) | def adaptive_instance_normalization(content_feat, style_feat): class PositionEmbeddingSine (line 50) | class PositionEmbeddingSine(nn.Module): method __init__ (line 56) | def __init__(self, num_pos_feats=64, temperature=10000, normalize=Fals... method forward (line 67) | def forward(self, x, mask=None): function _get_activation_fn (line 93) | def _get_activation_fn(activation): class TransformerSALayer (line 104) | class TransformerSALayer(nn.Module): method __init__ (line 105) | def __init__(self, embed_dim, nhead=8, dim_mlp=2048, dropout=0.0, acti... method with_pos_embed (line 120) | def with_pos_embed(self, tensor, pos: Optional[Tensor]): method forward (line 123) | def forward( class TransformerSALayerTemporal (line 147) | class TransformerSALayerTemporal(nn.Module): method __init__ (line 148) | def __init__(self, embed_dim, nhead=8, dim_mlp=2048, dropout=0.0, acti... method with_pos_embed (line 164) | def with_pos_embed(self, tensor, pos: Optional[Tensor]): method forward (line 167) | def forward(self, class Fuse_sft_block (line 196) | class Fuse_sft_block(nn.Module): method __init__ (line 197) | def __init__(self, in_ch, out_ch): method forward (line 211) | def forward(self, enc_feat, dec_feat, w=1): class ExpModule (line 219) | class ExpModule(nn.Module): method forward (line 220) | def forward(self, x): class MultiScaleFuse (line 224) | class MultiScaleFuse(nn.Module): method __init__ (line 225) | def __init__(self): method forward (line 232) | def forward(self, s64, s32, s16): class TemporalCodeFormerDirDistMultiScale (line 244) | class TemporalCodeFormerDirDistMultiScale(VQAutoEncoder): method __init__ (line 245) | def __init__(self, method _init_weights (line 335) | def _init_weights(self, module): method forward (line 344) | def forward(self, x, w=0, detach_16=True, code_only=False, adain=False): FILE: basicsr/archs/rrdbnet_arch.py class ResidualDenseBlock (line 9) | class ResidualDenseBlock(nn.Module): method __init__ (line 19) | def __init__(self, num_feat=64, num_grow_ch=32): method forward (line 32) | def forward(self, x): class RRDB (line 42) | class RRDB(nn.Module): method __init__ (line 52) | def __init__(self, num_feat, num_grow_ch=32): method forward (line 58) | def forward(self, x): class RRDBNet (line 67) | class RRDBNet(nn.Module): method __init__ (line 87) | def __init__(self, num_in_ch, num_out_ch, scale=4, num_feat=64, num_bl... method forward (line 105) | def forward(self, x): FILE: basicsr/archs/vgg_arch.py function insert_bn (line 36) | def insert_bn(names): class VGGFeatureExtractor (line 55) | class VGGFeatureExtractor(nn.Module): method __init__ (line 78) | def __init__(self, method forward (line 141) | def forward(self, x): FILE: basicsr/archs/vqgan_arch.py function normalize (line 14) | def normalize(in_channels): function swish (line 19) | def swish(x): class VectorQuantizer (line 24) | class VectorQuantizer(nn.Module): method __init__ (line 25) | def __init__(self, codebook_size, emb_dim, beta): method forward (line 33) | def forward(self, z): method get_codebook_feat (line 72) | def get_codebook_feat(self, indices, shape): class GumbelQuantizer (line 87) | class GumbelQuantizer(nn.Module): method __init__ (line 88) | def __init__(self, codebook_size, emb_dim, num_hiddens, straight_throu... method forward (line 98) | def forward(self, z): class Downsample (line 117) | class Downsample(nn.Module): method __init__ (line 118) | def __init__(self, in_channels): method forward (line 122) | def forward(self, x): class Upsample (line 129) | class Upsample(nn.Module): method __init__ (line 130) | def __init__(self, in_channels): method forward (line 134) | def forward(self, x): class ResBlock (line 141) | class ResBlock(nn.Module): method __init__ (line 142) | def __init__(self, in_channels, out_channels=None): method forward (line 153) | def forward(self, x_in): class AttnBlock (line 167) | class AttnBlock(nn.Module): method __init__ (line 168) | def __init__(self, in_channels): method forward (line 202) | def forward(self, x): class Encoder (line 229) | class Encoder(nn.Module): method __init__ (line 230) | def __init__(self, in_channels, nf, emb_dim, ch_mult, num_res_blocks, ... method forward (line 269) | def forward(self, x): class Generator (line 276) | class Generator(nn.Module): method __init__ (line 277) | def __init__(self, nf, emb_dim, ch_mult, res_blocks, img_size, attn_re... method forward (line 319) | def forward(self, x): class VQAutoEncoder (line 327) | class VQAutoEncoder(nn.Module): method __init__ (line 328) | def __init__(self, img_size, nf, ch_mult, quantizer="nearest", res_blo... method forward (line 385) | def forward(self, x): class VQGANDiscriminator (line 395) | class VQGANDiscriminator(nn.Module): method __init__ (line 396) | def __init__(self, nc=3, ndf=64, n_layers=4, model_path=None): method forward (line 433) | def forward(self, x): FILE: basicsr/data/__init__.py function build_dataset (line 25) | def build_dataset(dataset_opt): function build_dataloader (line 40) | def build_dataloader(dataset, dataset_opt, num_gpu=1, dist=False, sample... function worker_init_fn (line 96) | def worker_init_fn(worker_id, num_workers, rank, seed): FILE: basicsr/data/color_dataset.py class ColorizationDataset (line 23) | class ColorizationDataset(data.Dataset): method __init__ (line 24) | def __init__(self, opt): method __getitem__ (line 92) | def __getitem__(self, index): method __len__ (line 191) | def __len__(self): FILE: basicsr/data/data_sampler.py class EnlargedSampler (line 6) | class EnlargedSampler(Sampler): method __init__ (line 21) | def __init__(self, dataset, num_replicas, rank, ratio=1): method __iter__ (line 29) | def __iter__(self): method __len__ (line 44) | def __len__(self): method set_epoch (line 47) | def set_epoch(self, epoch): FILE: basicsr/data/data_util.py function read_img_seq (line 13) | def read_img_seq(path, require_mod_crop=False, scale=1): function generate_frame_indices (line 37) | def generate_frame_indices(crt_idx, max_frame_num, num_frames, padding='... function paired_paths_from_lmdb (line 89) | def paired_paths_from_lmdb(folders, keys): function paired_paths_from_meta_info_file (line 148) | def paired_paths_from_meta_info_file(folders, keys, meta_info_file, file... function paired_paths_from_folder (line 192) | def paired_paths_from_folder(folders, keys, filename_tmpl): function paths_from_folder (line 228) | def paths_from_folder(folder): function paths_from_lmdb (line 243) | def paths_from_lmdb(folder): function generate_gaussian_kernel (line 259) | def generate_gaussian_kernel(kernel_size=13, sigma=1.6): function duf_downsample (line 277) | def duf_downsample(x, kernel_size=13, scale=4): function brush_stroke_mask (line 310) | def brush_stroke_mask(img, color=(255,255,255)): function brush_stroke_mask_video (line 367) | def brush_stroke_mask_video(imgs, color=(255,255,255)): function random_ff_mask (line 426) | def random_ff_mask(shape, max_angle = 10, max_len = 100, max_width = 70,... FILE: basicsr/data/degradations.py function sigma_matrix2 (line 16) | def sigma_matrix2(sig_x, sig_y, theta): function mesh_grid (line 32) | def mesh_grid(kernel_size): function pdf2 (line 50) | def pdf2(sigma_matrix, grid): function cdf2 (line 66) | def cdf2(d_matrix, grid): function bivariate_Gaussian (line 84) | def bivariate_Gaussian(kernel_size, sig_x, sig_y, theta, grid=None, isot... function bivariate_generalized_Gaussian (line 112) | def bivariate_generalized_Gaussian(kernel_size, sig_x, sig_y, theta, bet... function bivariate_plateau (line 143) | def bivariate_plateau(kernel_size, sig_x, sig_y, theta, beta, grid=None,... function random_bivariate_Gaussian (line 176) | def random_bivariate_Gaussian(kernel_size, function random_bivariate_generalized_Gaussian (line 220) | def random_bivariate_generalized_Gaussian(kernel_size, function random_bivariate_plateau (line 272) | def random_bivariate_plateau(kernel_size, function random_mixed_kernels (line 324) | def random_mixed_kernels(kernel_list, function circular_lowpass_kernel (line 389) | def circular_lowpass_kernel(cutoff, kernel_size, pad_to=0): function generate_gaussian_noise (line 419) | def generate_gaussian_noise(img, sigma=10, gray_noise=False): function add_gaussian_noise (line 438) | def add_gaussian_noise(img, sigma=10, clip=True, rounds=False, gray_nois... function generate_gaussian_noise_pt (line 460) | def generate_gaussian_noise_pt(img, sigma=10, gray_noise=0): function add_gaussian_noise_pt (line 492) | def add_gaussian_noise_pt(img, sigma=10, gray_noise=0, clip=True, rounds... function random_generate_gaussian_noise (line 515) | def random_generate_gaussian_noise(img, sigma_range=(0, 10), gray_prob=0): function random_add_gaussian_noise (line 524) | def random_add_gaussian_noise(img, sigma_range=(0, 1.0), gray_prob=0, cl... function random_generate_gaussian_noise_pt (line 536) | def random_generate_gaussian_noise_pt(img, sigma_range=(0, 10), gray_pro... function random_add_gaussian_noise_pt (line 544) | def random_add_gaussian_noise_pt(img, sigma_range=(0, 1.0), gray_prob=0,... function generate_poisson_noise (line 559) | def generate_poisson_noise(img, scale=1.0, gray_noise=False): function add_poisson_noise (line 586) | def add_poisson_noise(img, scale=1.0, clip=True, rounds=False, gray_nois... function generate_poisson_noise_pt (line 609) | def generate_poisson_noise_pt(img, scale=1.0, gray_noise=0): function add_poisson_noise_pt (line 657) | def add_poisson_noise_pt(img, scale=1.0, clip=True, rounds=False, gray_n... function random_generate_poisson_noise (line 685) | def random_generate_poisson_noise(img, scale_range=(0, 1.0), gray_prob=0): function random_add_poisson_noise (line 694) | def random_add_poisson_noise(img, scale_range=(0, 1.0), gray_prob=0, cli... function random_generate_poisson_noise_pt (line 706) | def random_generate_poisson_noise_pt(img, scale_range=(0, 1.0), gray_pro... function random_add_poisson_noise_pt (line 714) | def random_add_poisson_noise_pt(img, scale_range=(0, 1.0), gray_prob=0, ... function add_jpg_compression (line 731) | def add_jpg_compression(img, quality=90): function random_add_jpg_compression (line 750) | def random_add_jpg_compression(img, quality_range=(90, 100)): FILE: basicsr/data/gaussian_kernels.py function sigma_matrix2 (line 8) | def sigma_matrix2(sig_x, sig_y, theta): function mesh_grid (line 23) | def mesh_grid(kernel_size): function pdf2 (line 40) | def pdf2(sigma_matrix, grid): function cdf2 (line 54) | def cdf2(D, grid): function bivariate_skew_Gaussian (line 70) | def bivariate_skew_Gaussian(kernel_size, sig_x, sig_y, theta, D, grid=No... function mass_center_shift (line 96) | def mass_center_shift(kernel_size, kernel): function bivariate_skew_Gaussian_center (line 112) | def bivariate_skew_Gaussian_center(kernel_size, function bivariate_anisotropic_Gaussian (line 139) | def bivariate_anisotropic_Gaussian(kernel_size, function bivariate_isotropic_Gaussian (line 163) | def bivariate_isotropic_Gaussian(kernel_size, sig, grid=None): function bivariate_generalized_Gaussian (line 181) | def bivariate_generalized_Gaussian(kernel_size, function bivariate_plateau_type1 (line 213) | def bivariate_plateau_type1(kernel_size, sig_x, sig_y, theta, beta, grid... function bivariate_plateau_type1_iso (line 237) | def bivariate_plateau_type1_iso(kernel_size, sig, beta, grid=None): function random_bivariate_skew_Gaussian_center (line 259) | def random_bivariate_skew_Gaussian_center(kernel_size, function random_bivariate_anisotropic_Gaussian (line 310) | def random_bivariate_anisotropic_Gaussian(kernel_size, function random_bivariate_isotropic_Gaussian (line 354) | def random_bivariate_isotropic_Gaussian(kernel_size, function random_bivariate_generalized_Gaussian (line 385) | def random_bivariate_generalized_Gaussian(kernel_size, function random_bivariate_plateau_type1 (line 435) | def random_bivariate_plateau_type1(kernel_size, function random_bivariate_plateau_type1_iso (line 485) | def random_bivariate_plateau_type1_iso(kernel_size, function random_mixed_kernels (line 519) | def random_mixed_kernels(kernel_list, function show_one_kernel (line 588) | def show_one_kernel(): function show_plateau_kernel (line 635) | def show_plateau_kernel(): FILE: basicsr/data/inpainting_dataset.py class InpaintingDataset (line 23) | class InpaintingDataset(data.Dataset): method __init__ (line 24) | def __init__(self, opt): method __getitem__ (line 92) | def __getitem__(self, index): method __len__ (line 192) | def __len__(self): FILE: basicsr/data/paired_image_dataset.py class PairedImageDataset (line 11) | class PairedImageDataset(data.Dataset): method __init__ (line 42) | def __init__(self, opt): method __getitem__ (line 67) | def __getitem__(self, index): method __len__ (line 100) | def __len__(self): FILE: basicsr/data/prefetch_dataloader.py class PrefetchGenerator (line 7) | class PrefetchGenerator(threading.Thread): method __init__ (line 18) | def __init__(self, generator, num_prefetch_queue): method run (line 25) | def run(self): method __next__ (line 30) | def __next__(self): method __iter__ (line 36) | def __iter__(self): class PrefetchDataLoader (line 40) | class PrefetchDataLoader(DataLoader): method __init__ (line 55) | def __init__(self, num_prefetch_queue, **kwargs): method __iter__ (line 59) | def __iter__(self): class CPUPrefetcher (line 63) | class CPUPrefetcher(): method __init__ (line 70) | def __init__(self, loader): method next (line 74) | def next(self): method reset (line 80) | def reset(self): class CUDAPrefetcher (line 84) | class CUDAPrefetcher(): method __init__ (line 97) | def __init__(self, loader, opt): method preload (line 105) | def preload(self): method next (line 117) | def next(self): method reset (line 123) | def reset(self): FILE: basicsr/data/transforms.py function mod_crop (line 5) | def mod_crop(img, scale): function paired_random_crop (line 25) | def paired_random_crop(img_gts, img_lqs, gt_patch_size, scale, gt_path): function augment (line 80) | def augment(imgs, hflip=True, rotation=True, flows=None, return_status=F... function img_rotate (line 147) | def img_rotate(img, angle, center=None, scale=1.0): FILE: basicsr/data/vfhq_dataset.py class VFHQRealDegradationDatasetNew (line 23) | class VFHQRealDegradationDatasetNew(data.Dataset): method __init__ (line 53) | def __init__(self, opt): method __getitem__ (line 121) | def __getitem__(self, index): method __len__ (line 277) | def __len__(self): FILE: basicsr/losses/__init__.py function build_loss (line 14) | def build_loss(opt): FILE: basicsr/losses/loss_util.py function reduce_loss (line 5) | def reduce_loss(loss, reduction): function weight_reduce_loss (line 25) | def weight_reduce_loss(loss, weight=None, reduction='mean'): function weighted_loss (line 57) | def weighted_loss(loss_func): FILE: basicsr/losses/losses.py function l1_loss (line 17) | def l1_loss(pred, target): function mse_loss (line 22) | def mse_loss(pred, target): function charbonnier_loss (line 27) | def charbonnier_loss(pred, target, eps=1e-12): class L1Loss (line 32) | class L1Loss(nn.Module): method __init__ (line 41) | def __init__(self, loss_weight=1.0, reduction='mean'): method forward (line 49) | def forward(self, pred, target, weight=None, **kwargs): class MSELoss (line 61) | class MSELoss(nn.Module): method __init__ (line 70) | def __init__(self, loss_weight=1.0, reduction='mean'): method forward (line 78) | def forward(self, pred, target, weight=None, **kwargs): class CharbonnierLoss (line 90) | class CharbonnierLoss(nn.Module): method __init__ (line 105) | def __init__(self, loss_weight=1.0, reduction='mean', eps=1e-12): method forward (line 114) | def forward(self, pred, target, weight=None, **kwargs): class WeightedTVLoss (line 126) | class WeightedTVLoss(L1Loss): method __init__ (line 133) | def __init__(self, loss_weight=1.0): method forward (line 136) | def forward(self, pred, weight=None): class PerceptualLoss (line 146) | class PerceptualLoss(nn.Module): method __init__ (line 169) | def __init__(self, method forward (line 199) | def forward(self, x, gt): method _gram_mat (line 241) | def _gram_mat(self, x): class LPIPSLoss (line 258) | class LPIPSLoss(nn.Module): method __init__ (line 259) | def __init__(self, method forward (line 275) | def forward(self, pred, target): class GANLoss (line 287) | class GANLoss(nn.Module): method __init__ (line 299) | def __init__(self, gan_type, real_label_val=1.0, fake_label_val=0.0, l... method _wgan_loss (line 319) | def _wgan_loss(self, input, target): method _wgan_softplus_loss (line 331) | def _wgan_softplus_loss(self, input, target): method get_target_label (line 348) | def get_target_label(self, input, target_is_real): method forward (line 365) | def forward(self, input, target_is_real, is_disc=False): function r1_penalty (line 391) | def r1_penalty(real_pred, real_img): function g_path_regularize (line 408) | def g_path_regularize(fake_img, latents, mean_path_length, decay=0.01): function gradient_penalty_loss (line 420) | def gradient_penalty_loss(discriminator, real_data, fake_data, weight=No... class DirichletKLLoss (line 460) | class DirichletKLLoss(nn.Module): method __init__ (line 467) | def __init__(self, loss_weight=1.0, kl_coef=1.1): method forward (line 472) | def forward(self, alpha): FILE: basicsr/metrics/__init__.py function calculate_metric (line 9) | def calculate_metric(data, opt): FILE: basicsr/metrics/metric_util.py function reorder_image (line 6) | def reorder_image(img, input_order='HWC'): function to_y_channel (line 32) | def to_y_channel(img): FILE: basicsr/metrics/psnr_ssim.py function calculate_psnr (line 9) | def calculate_psnr(img1, img2, crop_border, input_order='HWC', test_y_ch... function _ssim (line 49) | def _ssim(img1, img2): function calculate_ssim (line 84) | def calculate_ssim(img1, img2, crop_border, input_order='HWC', test_y_ch... FILE: basicsr/models/__init__.py function build_model (line 19) | def build_model(opt): FILE: basicsr/models/base_model.py class BaseModel (line 14) | class BaseModel(): method __init__ (line 17) | def __init__(self, opt): method feed_data (line 24) | def feed_data(self, data): method optimize_parameters (line 27) | def optimize_parameters(self): method get_current_visuals (line 30) | def get_current_visuals(self): method save (line 33) | def save(self, epoch, current_iter): method validation (line 37) | def validation(self, dataloader, current_iter, tb_logger, save_img=Fal... method model_ema (line 51) | def model_ema(self, decay=0.999): method get_current_log (line 60) | def get_current_log(self): method model_to_device (line 63) | def model_to_device(self, net): method get_optimizer (line 79) | def get_optimizer(self, optim_type, params, lr, **kwargs): method setup_schedulers (line 86) | def setup_schedulers(self): method get_bare_model (line 99) | def get_bare_model(self, net): method print_network (line 108) | def print_network(self, net): method _set_lr (line 126) | def _set_lr(self, lr_groups_l): method _get_init_lr (line 136) | def _get_init_lr(self): method update_learning_rate (line 144) | def update_learning_rate(self, current_iter, warmup_iter=-1): method get_current_learning_rate (line 167) | def get_current_learning_rate(self): method save_network (line 171) | def save_network(self, net, net_label, current_iter, param_key='params'): method _print_different_keys_loading (line 202) | def _print_different_keys_loading(self, crt_net, load_net, strict=True): method load_network (line 236) | def load_network(self, net, load_path, strict=True, param_key='params'): method save_training_state (line 264) | def save_training_state(self, epoch, current_iter): method resume_training (line 282) | def resume_training(self, resume_state): method reduce_loss_dict (line 297) | def reduce_loss_dict(self, loss_dict): FILE: basicsr/models/codeformer_dirichlet_video_model.py class CodeFormerDirichletVideoModel (line 16) | class CodeFormerDirichletVideoModel(SRModel): method feed_data (line 17) | def feed_data(self, data): method init_training_settings (line 37) | def init_training_settings(self): method calculate_adaptive_weight (line 96) | def calculate_adaptive_weight(self, recon_loss, g_loss, last_layer, di... method setup_optimizers (line 104) | def setup_optimizers(self): method gray_resize_for_identity (line 134) | def gray_resize_for_identity(self, out, size=128): method optimize_parameters (line 140) | def optimize_parameters(self, current_iter): method test (line 218) | def test(self): method dist_validation (line 230) | def dist_validation(self, dataloader, current_iter, tb_logger, save_img): method nondist_validation (line 234) | def nondist_validation(self, dataloader, current_iter, tb_logger, save... method _log_validation_metric_values (line 309) | def _log_validation_metric_values(self, current_iter, dataset_name, tb... method get_current_visuals (line 319) | def get_current_visuals(self): method save (line 325) | def save(self, epoch, current_iter): FILE: basicsr/models/lr_scheduler.py class MultiStepRestartLR (line 6) | class MultiStepRestartLR(_LRScheduler): method __init__ (line 19) | def __init__(self, optimizer, milestones, gamma=0.1, restarts=(0, ), r... method get_lr (line 27) | def get_lr(self): function get_position_from_periods (line 36) | def get_position_from_periods(iteration, cumulative_period): class CosineAnnealingRestartLR (line 57) | class CosineAnnealingRestartLR(_LRScheduler): method __init__ (line 77) | def __init__(self, optimizer, periods, restart_weights=(1, ), eta_min=... method get_lr (line 86) | def get_lr(self): FILE: basicsr/models/sr_model.py class SRModel (line 14) | class SRModel(BaseModel): method __init__ (line 17) | def __init__(self, opt): method init_training_settings (line 34) | def init_training_settings(self): method setup_optimizers (line 72) | def setup_optimizers(self): method feed_data (line 86) | def feed_data(self, data): method optimize_parameters (line 91) | def optimize_parameters(self, current_iter): method test (line 120) | def test(self): method dist_validation (line 131) | def dist_validation(self, dataloader, current_iter, tb_logger, save_img): method nondist_validation (line 135) | def nondist_validation(self, dataloader, current_iter, tb_logger, save... method _log_validation_metric_values (line 186) | def _log_validation_metric_values(self, current_iter, dataset_name, tb... method get_current_visuals (line 196) | def get_current_visuals(self): method save (line 204) | def save(self, epoch, current_iter): FILE: basicsr/models/vqgan_model.py class VQGANModel (line 16) | class VQGANModel(SRModel): method feed_data (line 17) | def feed_data(self, data): method init_training_settings (line 22) | def init_training_settings(self): method calculate_adaptive_weight (line 85) | def calculate_adaptive_weight(self, recon_loss, g_loss, last_layer, di... method adopt_weight (line 93) | def adopt_weight(self, weight, global_step, threshold=0, value=0.): method setup_optimizers (line 98) | def setup_optimizers(self): method optimize_parameters (line 117) | def optimize_parameters(self, current_iter): method test (line 192) | def test(self): method dist_validation (line 205) | def dist_validation(self, dataloader, current_iter, tb_logger, save_img): method nondist_validation (line 210) | def nondist_validation(self, dataloader, current_iter, tb_logger, save... method _log_validation_metric_values (line 262) | def _log_validation_metric_values(self, current_iter, dataset_name, tb... method get_current_visuals (line 273) | def get_current_visuals(self): method save (line 279) | def save(self, epoch, current_iter): FILE: basicsr/ops/dcn/deform_conv.py class DeformConvFunction (line 27) | class DeformConvFunction(Function): method forward (line 30) | def forward(ctx, method backward (line 69) | def backward(ctx, grad_output): method _output_size (line 101) | def _output_size(input, weight, padding, dilation, stride): class ModulatedDeformConvFunction (line 115) | class ModulatedDeformConvFunction(Function): method forward (line 118) | def forward(ctx, method backward (line 152) | def backward(ctx, grad_output): method _infer_shape (line 172) | def _infer_shape(ctx, input, weight): class DeformConv (line 186) | class DeformConv(nn.Module): method __init__ (line 188) | def __init__(self, method reset_parameters (line 223) | def reset_parameters(self): method forward (line 230) | def forward(self, x, offset): class DeformConvPack (line 246) | class DeformConvPack(DeformConv): method __init__ (line 264) | def __init__(self, *args, **kwargs): method init_offset (line 277) | def init_offset(self): method forward (line 281) | def forward(self, x): class ModulatedDeformConv (line 287) | class ModulatedDeformConv(nn.Module): method __init__ (line 289) | def __init__(self, method init_weights (line 320) | def init_weights(self): method forward (line 329) | def forward(self, x, offset, mask): class ModulatedDeformConvPack (line 334) | class ModulatedDeformConvPack(ModulatedDeformConv): method __init__ (line 352) | def __init__(self, *args, **kwargs): method init_weights (line 365) | def init_weights(self): method forward (line 371) | def forward(self, x): FILE: basicsr/ops/dcn/src/deform_conv_cuda.cpp function shape_check (line 62) | void shape_check(at::Tensor input, at::Tensor offset, at::Tensor *gradOu... function deform_conv_forward_cuda (line 152) | int deform_conv_forward_cuda(at::Tensor input, at::Tensor weight, function deform_conv_backward_input_cuda (line 262) | int deform_conv_backward_input_cuda(at::Tensor input, at::Tensor offset, function deform_conv_backward_parameters_cuda (line 376) | int deform_conv_backward_parameters_cuda( function modulated_deform_conv_cuda_forward (line 490) | void modulated_deform_conv_cuda_forward( function modulated_deform_conv_cuda_backward (line 571) | void modulated_deform_conv_cuda_backward( FILE: basicsr/ops/dcn/src/deform_conv_ext.cpp function deform_conv_forward (line 52) | int deform_conv_forward(at::Tensor input, at::Tensor weight, function deform_conv_backward_input (line 70) | int deform_conv_backward_input(at::Tensor input, at::Tensor offset, function deform_conv_backward_parameters (line 89) | int deform_conv_backward_parameters( function modulated_deform_conv_forward (line 107) | void modulated_deform_conv_forward( function modulated_deform_conv_backward (line 127) | void modulated_deform_conv_backward( function PYBIND11_MODULE (line 150) | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { FILE: basicsr/ops/fused_act/fused_act.py class FusedLeakyReLUFunctionBackward (line 24) | class FusedLeakyReLUFunctionBackward(Function): method forward (line 27) | def forward(ctx, grad_output, out, negative_slope, scale): method backward (line 46) | def backward(ctx, gradgrad_input, gradgrad_bias): class FusedLeakyReLUFunction (line 54) | class FusedLeakyReLUFunction(Function): method forward (line 57) | def forward(ctx, input, bias, negative_slope, scale): method backward (line 67) | def backward(ctx, grad_output): class FusedLeakyReLU (line 75) | class FusedLeakyReLU(nn.Module): method __init__ (line 77) | def __init__(self, channel, negative_slope=0.2, scale=2**0.5): method forward (line 84) | def forward(self, input): function fused_leaky_relu (line 88) | def fused_leaky_relu(input, bias, negative_slope=0.2, scale=2**0.5): FILE: basicsr/ops/fused_act/src/fused_bias_act.cpp function fused_bias_act (line 14) | torch::Tensor fused_bias_act(const torch::Tensor& input, function PYBIND11_MODULE (line 24) | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { FILE: basicsr/ops/upfirdn2d/src/upfirdn2d.cpp function upfirdn2d (line 13) | torch::Tensor upfirdn2d(const torch::Tensor& input, const torch::Tensor&... function PYBIND11_MODULE (line 22) | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { FILE: basicsr/ops/upfirdn2d/upfirdn2d.py class UpFirDn2dBackward (line 24) | class UpFirDn2dBackward(Function): method forward (line 27) | def forward(ctx, grad_output, kernel, grad_kernel, up, down, pad, g_pa... method backward (line 67) | def backward(ctx, gradgrad_input): class UpFirDn2d (line 91) | class UpFirDn2d(Function): method forward (line 94) | def forward(ctx, input, kernel, up, down, pad): method backward (line 129) | def backward(ctx, grad_output): function upfirdn2d (line 147) | def upfirdn2d(input, kernel, up=1, down=1, pad=(0, 0)): function upfirdn2d_native (line 156) | def upfirdn2d_native(input, kernel, up_x, up_y, down_x, down_y, pad_x0, ... FILE: basicsr/setup.py function readme (line 15) | def readme(): function get_git_hash (line 21) | def get_git_hash(): function get_hash (line 46) | def get_hash(): function write_version_py (line 61) | def write_version_py(): function get_version (line 78) | def get_version(): function make_cuda_ext (line 84) | def make_cuda_ext(name, module, sources, sources_cuda=None): function get_requirements (line 111) | def get_requirements(filename='requirements.txt'): FILE: basicsr/train.py function parse_options (line 26) | def parse_options(root_path, is_train=True): function init_loggers (line 61) | def init_loggers(opt): function create_train_val_dataloader (line 77) | def create_train_val_dataloader(opt, logger): function train_pipeline (line 117) | def train_pipeline(root_path): FILE: basicsr/utils/dist_util.py function init_dist (line 10) | def init_dist(launcher, backend='nccl', **kwargs): function _init_dist_pytorch (line 21) | def _init_dist_pytorch(backend, **kwargs): function _init_dist_slurm (line 30) | def _init_dist_slurm(backend, port=None): function get_dist_info (line 62) | def get_dist_info(): function master_only (line 76) | def master_only(func): FILE: basicsr/utils/download_util.py function download_file_from_google_drive (line 11) | def download_file_from_google_drive(file_id, save_path): function get_confirm_token (line 41) | def get_confirm_token(response): function save_response_content (line 48) | def save_response_content(response, destination, file_size=None, chunk_s... function load_file_from_url (line 69) | def load_file_from_url(url, model_dir=None, progress=True, file_name=None): FILE: basicsr/utils/file_client.py class BaseStorageBackend (line 5) | class BaseStorageBackend(metaclass=ABCMeta): method get (line 14) | def get(self, filepath): method get_text (line 18) | def get_text(self, filepath): class MemcachedBackend (line 22) | class MemcachedBackend(BaseStorageBackend): method __init__ (line 32) | def __init__(self, server_list_cfg, client_cfg, sys_path=None): method get (line 47) | def get(self, filepath): method get_text (line 54) | def get_text(self, filepath): class HardDiskBackend (line 58) | class HardDiskBackend(BaseStorageBackend): method get (line 61) | def get(self, filepath): method get_text (line 67) | def get_text(self, filepath): class LmdbBackend (line 74) | class LmdbBackend(BaseStorageBackend): method __init__ (line 94) | def __init__(self, db_paths, client_keys='default', readonly=True, loc... method get (line 114) | def get(self, filepath, client_key): method get_text (line 128) | def get_text(self, filepath): class FileClient (line 132) | class FileClient(object): method __init__ (line 151) | def __init__(self, backend='disk', **kwargs): method get (line 158) | def get(self, filepath, client_key='default'): method get_text (line 166) | def get_text(self, filepath): FILE: basicsr/utils/img_util.py function img2tensor (line 10) | def img2tensor(imgs, bgr2rgb=True, float32=True): function tensor2img (line 40) | def tensor2img(tensor, rgb2bgr=True, out_type=np.uint8, min_max=(0, 1)): function tensor2img_fast (line 99) | def tensor2img_fast(tensor, rgb2bgr=True, min_max=(0, 1)): function tensor2imgs (line 116) | def tensor2imgs(tensor, rgb2bgr=True, min_max=(0, 1)): function imfrombytes (line 143) | def imfrombytes(content, flag='color', float32=False): function imwrite (line 164) | def imwrite(img, file_path, params=None, auto_mkdir=True): function images_to_gif (line 182) | def images_to_gif(image_list, output_path, duration=100, loop=0): function crop_border (line 217) | def crop_border(imgs, crop_border): FILE: basicsr/utils/lmdb_util.py function make_lmdb_from_imgs (line 9) | def make_lmdb_from_imgs(data_path, function read_img_worker (line 132) | def read_img_worker(path, key, compress_level): class LmdbMaker (line 156) | class LmdbMaker(): method __init__ (line 167) | def __init__(self, lmdb_path, map_size=1024**4, batch=5000, compress_l... method put (line 182) | def put(self, img_byte, key, img_shape): method close (line 193) | def close(self): FILE: basicsr/utils/logger.py class MessageLogger (line 10) | class MessageLogger(): method __init__ (line 22) | def __init__(self, opt, start_iter=1, tb_logger=None): method __call__ (line 33) | def __call__(self, log_vars): function init_tb_logger (line 78) | def init_tb_logger(log_dir): function init_wandb_logger (line 85) | def init_wandb_logger(opt): function get_root_logger (line 107) | def get_root_logger(logger_name='basicsr', log_level=logging.INFO, log_f... function get_env_info (line 147) | def get_env_info(): FILE: basicsr/utils/matlab_functions.py function cubic (line 6) | def cubic(x): function calculate_weights_indices (line 16) | def calculate_weights_indices(in_length, out_length, scale, kernel, kern... function imresize (line 86) | def imresize(img, scale, antialiasing=True): function rgb2ycbcr (line 169) | def rgb2ycbcr(img, y_only=False): function bgr2ycbcr (line 202) | def bgr2ycbcr(img, y_only=False): function ycbcr2rgb (line 235) | def ycbcr2rgb(img): function ycbcr2bgr (line 264) | def ycbcr2bgr(img): function _convert_input_type_range (line 293) | def _convert_input_type_range(img): function _convert_output_type_range (line 320) | def _convert_output_type_range(img, dst_type): FILE: basicsr/utils/misc.py function gpu_is_available (line 15) | def gpu_is_available(): function get_device (line 21) | def get_device(gpu_id=None): function set_random_seed (line 35) | def set_random_seed(seed): function get_time_str (line 44) | def get_time_str(): function mkdir_and_rename (line 48) | def mkdir_and_rename(path): function make_exp_dirs (line 62) | def make_exp_dirs(opt): function scandir (line 74) | def scandir(dir_path, suffix=None, recursive=False, full_path=False): function check_resume (line 116) | def check_resume(opt, resume_iter): function sizeof_fmt (line 143) | def sizeof_fmt(size, suffix='B'): FILE: basicsr/utils/options.py function ordered_yaml (line 7) | def ordered_yaml(): function parse (line 32) | def parse(opt_path, root_path, is_train=True): function dict2str (line 90) | def dict2str(opt, indent_level=1): FILE: basicsr/utils/realesrgan_utils.py class RealESRGANer (line 14) | class RealESRGANer(): method __init__ (line 29) | def __init__(self, method pre_process (line 71) | def pre_process(self, img): method process (line 96) | def process(self): method tile_process (line 100) | def tile_process(self): method post_process (line 165) | def post_process(self): method enhance (line 177) | def enhance(self, img, outscale=None, alpha_upsampler='realesrgan'): class PrefetchReader (line 255) | class PrefetchReader(threading.Thread): method __init__ (line 263) | def __init__(self, img_list, num_prefetch_queue): method run (line 268) | def run(self): method __next__ (line 275) | def __next__(self): method __iter__ (line 281) | def __iter__(self): class IOConsumer (line 285) | class IOConsumer(threading.Thread): method __init__ (line 287) | def __init__(self, opt, que, qid): method run (line 293) | def run(self): FILE: basicsr/utils/registry.py class Registry (line 4) | class Registry(): method __init__ (line 30) | def __init__(self, name): method _do_register (line 38) | def _do_register(self, name, obj): method register (line 43) | def register(self, obj=None): method get (line 62) | def get(self, name): method __contains__ (line 68) | def __contains__(self, name): method __iter__ (line 71) | def __iter__(self): method keys (line 74) | def keys(self): FILE: basicsr/utils/video_util.py function get_video_meta_info (line 17) | def get_video_meta_info(video_path): class VideoReader (line 29) | class VideoReader: method __init__ (line 30) | def __init__(self, video_path): method get_resolution (line 52) | def get_resolution(self): method get_fps (line 55) | def get_fps(self): method get_audio (line 60) | def get_audio(self): method __len__ (line 63) | def __len__(self): method get_frame_from_stream (line 66) | def get_frame_from_stream(self): method get_frame_from_list (line 73) | def get_frame_from_list(self): method get_frame (line 80) | def get_frame(self): method close (line 84) | def close(self): class VideoWriter (line 89) | class VideoWriter: method __init__ (line 90) | def __init__(self, video_save_path, height, width, fps, audio): method write_frame (line 113) | def write_frame(self, frame): method close (line 123) | def close(self): FILE: facelib/detection/__init__.py function init_detection_model (line 14) | def init_detection_model(model_name, half=False, device='cuda'): function init_retinaface_model (line 25) | def init_retinaface_model(model_name, half=False, device='cuda'): function init_yolov5face_model (line 49) | def init_yolov5face_model(model_name, device='cuda'): FILE: facelib/detection/align_trans.py class FaceWarpException (line 13) | class FaceWarpException(Exception): method __str__ (line 15) | def __str__(self): function get_reference_facial_points (line 19) | def get_reference_facial_points(output_size=None, inner_padding_factor=0... function get_affine_transform_matrix (line 112) | def get_affine_transform_matrix(src_pts, dst_pts): function warp_and_crop_face (line 145) | def warp_and_crop_face(src_img, facial_pts, reference_pts=None, crop_siz... FILE: facelib/detection/matlab_cp2tform.py class MatlabCp2tormException (line 7) | class MatlabCp2tormException(Exception): method __str__ (line 9) | def __str__(self): function tformfwd (line 13) | def tformfwd(trans, uv): function tforminv (line 37) | def tforminv(trans, uv): function findNonreflectiveSimilarity (line 60) | def findNonreflectiveSimilarity(uv, xy, options=None): function findSimilarity (line 94) | def findSimilarity(uv, xy, options=None): function get_similarity_transform (line 130) | def get_similarity_transform(src_pts, dst_pts, reflective=True): function cvt_tform_mat_for_cv2 (line 170) | def cvt_tform_mat_for_cv2(trans): function get_similarity_transform_for_cv2 (line 198) | def get_similarity_transform_for_cv2(src_pts, dst_pts, reflective=True): FILE: facelib/detection/retinaface/retinaface.py function generate_config (line 19) | def generate_config(network_name): class RetinaFace (line 75) | class RetinaFace(nn.Module): method __init__ (line 77) | def __init__(self, network_name='resnet50', half=False, phase='test'): method forward (line 122) | def forward(self, inputs): method __detect_faces (line 147) | def __detect_faces(self, inputs): method transform (line 167) | def transform(self, image, use_origin_size): method detect_faces (line 194) | def detect_faces( method __align_multi (line 241) | def __align_multi(self, image, boxes, landmarks, limit=None): method align_multi (line 259) | def align_multi(self, img, conf_threshold=0.8, limit=None): method batched_transform (line 267) | def batched_transform(self, frames, use_origin_size): method batched_detect_faces (line 310) | def batched_detect_faces(self, frames, conf_threshold=0.8, nms_thresho... FILE: facelib/detection/retinaface/retinaface_net.py function conv_bn (line 6) | def conv_bn(inp, oup, stride=1, leaky=0): function conv_bn_no_relu (line 12) | def conv_bn_no_relu(inp, oup, stride): function conv_bn1X1 (line 19) | def conv_bn1X1(inp, oup, stride, leaky=0): function conv_dw (line 25) | def conv_dw(inp, oup, stride, leaky=0.1): class SSH (line 36) | class SSH(nn.Module): method __init__ (line 38) | def __init__(self, in_channel, out_channel): method forward (line 52) | def forward(self, input): class FPN (line 66) | class FPN(nn.Module): method __init__ (line 68) | def __init__(self, in_channels_list, out_channels): method forward (line 80) | def forward(self, input): class MobileNetV1 (line 100) | class MobileNetV1(nn.Module): method __init__ (line 102) | def __init__(self): method forward (line 127) | def forward(self, x): class ClassHead (line 138) | class ClassHead(nn.Module): method __init__ (line 140) | def __init__(self, inchannels=512, num_anchors=3): method forward (line 145) | def forward(self, x): class BboxHead (line 152) | class BboxHead(nn.Module): method __init__ (line 154) | def __init__(self, inchannels=512, num_anchors=3): method forward (line 158) | def forward(self, x): class LandmarkHead (line 165) | class LandmarkHead(nn.Module): method __init__ (line 167) | def __init__(self, inchannels=512, num_anchors=3): method forward (line 171) | def forward(self, x): function make_class_head (line 178) | def make_class_head(fpn_num=3, inchannels=64, anchor_num=2): function make_bbox_head (line 185) | def make_bbox_head(fpn_num=3, inchannels=64, anchor_num=2): function make_landmark_head (line 192) | def make_landmark_head(fpn_num=3, inchannels=64, anchor_num=2): FILE: facelib/detection/retinaface/retinaface_utils.py class PriorBox (line 8) | class PriorBox(object): method __init__ (line 10) | def __init__(self, cfg, image_size=None, phase='train'): method forward (line 19) | def forward(self): function py_cpu_nms (line 39) | def py_cpu_nms(dets, thresh): function point_form (line 50) | def point_form(boxes): function center_size (line 65) | def center_size(boxes): function intersect (line 79) | def intersect(box_a, box_b): function jaccard (line 98) | def jaccard(box_a, box_b): function matrix_iou (line 117) | def matrix_iou(a, b): function matrix_iof (line 130) | def matrix_iof(a, b): function match (line 142) | def match(threshold, truths, priors, variances, labels, landms, loc_t, c... function encode (line 200) | def encode(matched, priors, variances): function encode_landm (line 224) | def encode_landm(matched, priors, variances): function decode (line 254) | def decode(loc, priors, variances): function decode_landm (line 274) | def decode_landm(pre, priors, variances): function batched_decode (line 297) | def batched_decode(b_loc, priors, variances): function batched_decode_landm (line 320) | def batched_decode_landm(pre, priors, variances): function log_sum_exp (line 343) | def log_sum_exp(x): function nms (line 357) | def nms(boxes, scores, overlap=0.5, top_k=200): FILE: facelib/detection/yolov5face/face_detector.py function isListempty (line 22) | def isListempty(inList): class YoloDetector (line 27) | class YoloDetector: method __init__ (line 28) | def __init__( method _preprocess (line 48) | def _preprocess(self, imgs): method _postprocess (line 69) | def _postprocess(self, imgs, origimgs, pred, conf_thres, iou_thres): method detect_faces (line 104) | def detect_faces(self, imgs, conf_thres=0.7, iou_thres=0.5): method __call__ (line 140) | def __call__(self, *args): FILE: facelib/detection/yolov5face/models/common.py function autopad (line 18) | def autopad(k, p=None): # kernel, padding function channel_shuffle (line 25) | def channel_shuffle(x, groups): function DWConv (line 37) | def DWConv(c1, c2, k=1, s=1, act=True): class Conv (line 42) | class Conv(nn.Module): method __init__ (line 44) | def __init__(self, c1, c2, k=1, s=1, p=None, g=1, act=True): # ch_in,... method forward (line 50) | def forward(self, x): method fuseforward (line 53) | def fuseforward(self, x): class StemBlock (line 57) | class StemBlock(nn.Module): method __init__ (line 58) | def __init__(self, c1, c2, k=3, s=2, p=None, g=1, act=True): method forward (line 66) | def forward(self, x): class Bottleneck (line 74) | class Bottleneck(nn.Module): method __init__ (line 76) | def __init__(self, c1, c2, shortcut=True, g=1, e=0.5): # ch_in, ch_ou... method forward (line 83) | def forward(self, x): class BottleneckCSP (line 87) | class BottleneckCSP(nn.Module): method __init__ (line 89) | def __init__(self, c1, c2, n=1, shortcut=True, g=1, e=0.5): # ch_in, ... method forward (line 100) | def forward(self, x): class C3 (line 106) | class C3(nn.Module): method __init__ (line 108) | def __init__(self, c1, c2, n=1, shortcut=True, g=1, e=0.5): # ch_in, ... method forward (line 116) | def forward(self, x): class ShuffleV2Block (line 120) | class ShuffleV2Block(nn.Module): method __init__ (line 121) | def __init__(self, inp, oup, stride): method depthwise_conv (line 160) | def depthwise_conv(i, o, kernel_size, stride=1, padding=0, bias=False): method forward (line 163) | def forward(self, x): class SPP (line 173) | class SPP(nn.Module): method __init__ (line 175) | def __init__(self, c1, c2, k=(5, 9, 13)): method forward (line 182) | def forward(self, x): class Focus (line 187) | class Focus(nn.Module): method __init__ (line 189) | def __init__(self, c1, c2, k=1, s=1, p=None, g=1, act=True): # ch_in,... method forward (line 193) | def forward(self, x): # x(b,c,w,h) -> y(b,4c,w/2,h/2) class Concat (line 197) | class Concat(nn.Module): method __init__ (line 199) | def __init__(self, dimension=1): method forward (line 203) | def forward(self, x): class NMS (line 207) | class NMS(nn.Module): method forward (line 213) | def forward(self, x): class AutoShape (line 217) | class AutoShape(nn.Module): method __init__ (line 224) | def __init__(self, model): method autoshape (line 228) | def autoshape(self): method forward (line 232) | def forward(self, imgs, size=640, augment=False, profile=False): class Detections (line 275) | class Detections: method __init__ (line 277) | def __init__(self, imgs, pred, names=None): method __len__ (line 290) | def __len__(self): method tolist (line 293) | def tolist(self): FILE: facelib/detection/yolov5face/models/experimental.py class CrossConv (line 10) | class CrossConv(nn.Module): method __init__ (line 12) | def __init__(self, c1, c2, k=3, s=1, g=1, e=1.0, shortcut=False): method forward (line 20) | def forward(self, x): class MixConv2d (line 24) | class MixConv2d(nn.Module): method __init__ (line 26) | def __init__(self, c1, c2, k=(1, 3), s=1, equal_ch=True): method forward (line 44) | def forward(self, x): FILE: facelib/detection/yolov5face/models/yolo.py class Detect (line 29) | class Detect(nn.Module): method __init__ (line 33) | def __init__(self, nc=80, anchors=(), ch=()): # detection layer method forward (line 46) | def forward(self, x): method _make_grid (line 89) | def _make_grid(nx=20, ny=20): class Model (line 95) | class Model(nn.Module): method __init__ (line 96) | def __init__(self, cfg="yolov5s.yaml", ch=3, nc=None): # model, input... method forward (line 120) | def forward(self, x): method forward_once (line 123) | def forward_once(self, x): method _initialize_biases (line 134) | def _initialize_biases(self, cf=None): # initialize biases into Detec... method _print_biases (line 143) | def _print_biases(self): method fuse (line 149) | def fuse(self): # fuse model Conv2d() + BatchNorm2d() layers method nms (line 160) | def nms(self, mode=True): # add or remove NMS module method autoshape (line 174) | def autoshape(self): # add autoShape module function parse_model (line 181) | def parse_model(d, ch): # model_dict, input_channels(3) FILE: facelib/detection/yolov5face/utils/autoanchor.py function check_anchor_order (line 4) | def check_anchor_order(m): FILE: facelib/detection/yolov5face/utils/datasets.py function letterbox (line 5) | def letterbox(img, new_shape=(640, 640), color=(114, 114, 114), auto=Tru... FILE: facelib/detection/yolov5face/utils/general.py function check_img_size (line 9) | def check_img_size(img_size, s=32): function make_divisible (line 17) | def make_divisible(x, divisor): function xyxy2xywh (line 22) | def xyxy2xywh(x): function xywh2xyxy (line 32) | def xywh2xyxy(x): function scale_coords (line 42) | def scale_coords(img1_shape, coords, img0_shape, ratio_pad=None): function clip_coords (line 58) | def clip_coords(boxes, img_shape): function box_iou (line 66) | def box_iou(box1, box2): function non_max_suppression_face (line 89) | def non_max_suppression_face(prediction, conf_thres=0.25, iou_thres=0.45... function non_max_suppression (line 168) | def non_max_suppression(prediction, conf_thres=0.25, iou_thres=0.45, cla... function scale_coords_landmarks (line 249) | def scale_coords_landmarks(img1_shape, coords, img0_shape, ratio_pad=None): FILE: facelib/detection/yolov5face/utils/torch_utils.py function fuse_conv_and_bn (line 5) | def fuse_conv_and_bn(conv, bn): function copy_attr (line 34) | def copy_attr(a, b, include=(), exclude=()): FILE: facelib/parsing/__init__.py function init_parsing_model (line 8) | def init_parsing_model(model_name='bisenet', half=False, device='cuda'): FILE: facelib/parsing/bisenet.py class ConvBNReLU (line 8) | class ConvBNReLU(nn.Module): method __init__ (line 10) | def __init__(self, in_chan, out_chan, ks=3, stride=1, padding=1): method forward (line 15) | def forward(self, x): class BiSeNetOutput (line 21) | class BiSeNetOutput(nn.Module): method __init__ (line 23) | def __init__(self, in_chan, mid_chan, num_class): method forward (line 28) | def forward(self, x): class AttentionRefinementModule (line 34) | class AttentionRefinementModule(nn.Module): method __init__ (line 36) | def __init__(self, in_chan, out_chan): method forward (line 43) | def forward(self, x): class ContextPath (line 53) | class ContextPath(nn.Module): method __init__ (line 55) | def __init__(self): method forward (line 64) | def forward(self, x): class FeatureFusionModule (line 87) | class FeatureFusionModule(nn.Module): method __init__ (line 89) | def __init__(self, in_chan, out_chan): method forward (line 97) | def forward(self, fsp, fcp): class BiSeNet (line 110) | class BiSeNet(nn.Module): method __init__ (line 112) | def __init__(self, num_class): method forward (line 120) | def forward(self, x, return_feat=False): FILE: facelib/parsing/parsenet.py class NormLayer (line 8) | class NormLayer(nn.Module): method __init__ (line 16) | def __init__(self, channels, normalize_shape=None, norm_type='bn'): method forward (line 35) | def forward(self, x, ref=None): class ReluLayer (line 42) | class ReluLayer(nn.Module): method __init__ (line 54) | def __init__(self, channels, relu_type='relu'): method forward (line 70) | def forward(self, x): class ConvLayer (line 74) | class ConvLayer(nn.Module): method __init__ (line 76) | def __init__(self, method forward (line 103) | def forward(self, x): class ResidualBlock (line 113) | class ResidualBlock(nn.Module): method __init__ (line 118) | def __init__(self, c_in, c_out, relu_type='prelu', norm_type='bn', sca... method forward (line 132) | def forward(self, x): class ParseNet (line 140) | class ParseNet(nn.Module): method __init__ (line 142) | def __init__(self, method forward (line 188) | def forward(self, x): FILE: facelib/parsing/resnet.py function conv3x3 (line 5) | def conv3x3(in_planes, out_planes, stride=1): class BasicBlock (line 10) | class BasicBlock(nn.Module): method __init__ (line 12) | def __init__(self, in_chan, out_chan, stride=1): method forward (line 26) | def forward(self, x): function create_layer_basic (line 41) | def create_layer_basic(in_chan, out_chan, bnum, stride=1): class ResNet18 (line 48) | class ResNet18(nn.Module): method __init__ (line 50) | def __init__(self): method forward (line 60) | def forward(self, x): FILE: facelib/utils/face_restoration_helper.py function get_largest_face (line 25) | def get_largest_face(det_faces, h, w): function get_center_face (line 47) | def get_center_face(det_faces, h=0, w=0, center=None): class FaceRestoreHelper (line 63) | class FaceRestoreHelper(object): method __init__ (line 66) | def __init__( method set_upscale_factor (line 159) | def set_upscale_factor(self, upscale_factor): method read_image (line 162) | def read_image(self, img): method init_dlib (line 185) | def init_dlib(self, detection_path, landmark5_path): method get_face_landmarks_5_dlib (line 199) | def get_face_landmarks_5_dlib(self, method get_face_landmarks_5 (line 231) | def get_face_landmarks_5(self, method align_warp_face (line 362) | def align_warp_face(self, save_cropped_path=None, border_mode='constan... method get_inverse_affine (line 402) | def get_inverse_affine(self, save_inverse_affine_path=None): method add_restored_face (line 414) | def add_restored_face(self, restored_face, input_face=None): method paste_faces_to_input_image (line 423) | def paste_faces_to_input_image( method clean_all (line 588) | def clean_all(self): class FaceAligner (line 598) | class FaceAligner(object): method __init__ (line 599) | def __init__(self, method set_image (line 664) | def set_image(self, img): method align_pair_face (line 667) | def align_pair_face(self, img_lq, img_gt, landmarks): method align_single_face (line 677) | def align_single_face(self, img, landmarks, border_mode='constant'): method align_warp_face (line 698) | def align_warp_face(self, img_lq, img_gt, landmarks, border_mode='cons... method clean_all (line 726) | def clean_all(self): FILE: facelib/utils/face_utils.py function compute_increased_bbox (line 6) | def compute_increased_bbox(bbox, increase_area, preserve_aspect=True): function get_valid_bboxes (line 23) | def get_valid_bboxes(bboxes, h, w): function align_crop_face_landmarks (line 31) | def align_crop_face_landmarks(img, function paste_face_back (line 190) | def paste_face_back(img, face, inverse_affine): FILE: facelib/utils/misc.py function download_pretrained_models (line 14) | def download_pretrained_models(file_ids, save_path_root): function imwrite (line 38) | def imwrite(img, file_path, params=None, auto_mkdir=True): function img2tensor (line 57) | def img2tensor(imgs, bgr2rgb=True, float32=True): function load_file_from_url (line 86) | def load_file_from_url(url, model_dir=None, progress=True, file_name=None): function scandir (line 106) | def scandir(dir_path, suffix=None, recursive=False, full_path=False): function is_gray (line 146) | def is_gray(img, threshold=10): function rgb2gray (line 162) | def rgb2gray(img, out_channel=3): function bgr2gray (line 169) | def bgr2gray(img, out_channel=3): function calc_mean_std (line 177) | def calc_mean_std(feat, eps=1e-5): function adain_npy (line 191) | def adain_npy(content_feat, style_feat): FILE: scripts/inference.py function interpolate_sequence (line 19) | def interpolate_sequence(sequence): function set_realesrgan (line 35) | def set_realesrgan(): FILE: scripts/inference_color_and_inpainting.py function interpolate_sequence (line 19) | def interpolate_sequence(sequence): function set_realesrgan (line 35) | def set_realesrgan(): FILE: scripts/warp_images.py function interpolate_sequence (line 23) | def interpolate_sequence(sequence): function process_single (line 38) | def process_single(args, face_helper, input_path, ldmk_folder_path):