SYMBOL INDEX (172 symbols across 18 files) FILE: RestoreFormer/data/ffhq_degradation_dataset.py class FFHQDegradationDataset (line 20) | class FFHQDegradationDataset(data.Dataset): method __init__ (line 22) | def __init__(self, opt): method color_jitter (line 82) | def color_jitter(img, shift): method color_jitter_pt (line 89) | def color_jitter_pt(img, brightness, contrast, saturation, hue): method get_component_coordinates (line 109) | def get_component_coordinates(self, index, status): method __getitem__ (line 133) | def __getitem__(self, index): method __len__ (line 217) | def __len__(self): FILE: RestoreFormer/distributed/distributed.py function is_primary (line 12) | def is_primary(): function get_rank (line 16) | def get_rank(): function get_local_rank (line 26) | def get_local_rank(): function synchronize (line 39) | def synchronize(): function get_world_size (line 54) | def get_world_size(): function all_reduce (line 64) | def all_reduce(tensor, op=dist.ReduceOp.SUM): function all_gather (line 75) | def all_gather(data): function reduce_dict (line 110) | def reduce_dict(input_dict, average=True): function data_sampler (line 135) | def data_sampler(dataset, shuffle, distributed): FILE: RestoreFormer/distributed/launch.py function find_free_port (line 10) | def find_free_port(): function launch (line 22) | def launch(fn, n_gpu_per_machine, n_machine=1, machine_rank=0, dist_url=... function distributed_worker (line 52) | def distributed_worker( FILE: RestoreFormer/models/vqgan_v1.py class RestoreFormerModel (line 8) | class RestoreFormerModel(pl.LightningModule): method __init__ (line 9) | def __init__(self, method init_from_ckpt (line 43) | def init_from_ckpt(self, path, ignore_keys=list()): method forward (line 74) | def forward(self, input): method training_step (line 78) | def training_step(self, batch, batch_idx, optimizer_idx): method validation_step (line 142) | def validation_step(self, batch, batch_idx): method configure_optimizers (line 164) | def configure_optimizers(self): method get_last_layer (line 207) | def get_last_layer(self): method log_images (line 212) | def log_images(self, batch, **kwargs): FILE: RestoreFormer/modules/discriminator/model.py function weights_init (line 8) | def weights_init(m): class NLayerDiscriminator (line 17) | class NLayerDiscriminator(nn.Module): method __init__ (line 21) | def __init__(self, input_nc=3, ndf=64, n_layers=3, use_actnorm=False): method forward (line 65) | def forward(self, input): class NLayerDiscriminator_v1 (line 69) | class NLayerDiscriminator_v1(nn.Module): method __init__ (line 73) | def __init__(self, input_nc=3, ndf=64, n_layers=3, use_actnorm=False): method forward (line 123) | def forward(self, input): FILE: RestoreFormer/modules/losses/lpips.py class LPIPS (line 11) | class LPIPS(nn.Module): method __init__ (line 13) | def __init__(self, use_dropout=True, style_weight=0.): method load_from_pretrained (line 29) | def load_from_pretrained(self, name="vgg_lpips"): method from_pretrained (line 35) | def from_pretrained(cls, name="vgg_lpips"): method forward (line 43) | def forward(self, input, target): method _gram_mat (line 63) | def _gram_mat(self, x): class ScalingLayer (line 79) | class ScalingLayer(nn.Module): method __init__ (line 80) | def __init__(self): method forward (line 85) | def forward(self, inp): class NetLinLayer (line 89) | class NetLinLayer(nn.Module): method __init__ (line 91) | def __init__(self, chn_in, chn_out=1, use_dropout=False): class vgg16 (line 98) | class vgg16(torch.nn.Module): method __init__ (line 99) | def __init__(self, requires_grad=False, pretrained=True): method forward (line 122) | def forward(self, X): function normalize_tensor (line 138) | def normalize_tensor(x,eps=1e-10): function spatial_average (line 143) | def spatial_average(x, keepdim=True): FILE: RestoreFormer/modules/losses/vqperceptual.py class DummyLoss (line 13) | class DummyLoss(nn.Module): method __init__ (line 14) | def __init__(self): function adopt_weight (line 18) | def adopt_weight(weight, global_step, threshold=0, value=0.): function hinge_d_loss (line 24) | def hinge_d_loss(logits_real, logits_fake): function vanilla_d_loss (line 31) | def vanilla_d_loss(logits_real, logits_fake): class VQLPIPSWithDiscriminatorWithCompWithIdentity (line 38) | class VQLPIPSWithDiscriminatorWithCompWithIdentity(nn.Module): method __init__ (line 39) | def __init__(self, disc_start, codebook_weight=1.0, pixelloss_weight=1.0, method calculate_adaptive_weight (line 105) | def calculate_adaptive_weight(self, nll_loss, g_loss, last_layer=None): method _gram_mat (line 118) | def _gram_mat(self, x): method gray_resize_for_identity (line 133) | def gray_resize_for_identity(self, out, size=128): method forward (line 139) | def forward(self, codebook_loss, gts, reconstructions, components, opt... FILE: RestoreFormer/modules/util.py function count_params (line 5) | def count_params(model): class ActNorm (line 10) | class ActNorm(nn.Module): method __init__ (line 11) | def __init__(self, num_features, logdet=False, affine=True, method initialize (line 22) | def initialize(self, input): method forward (line 43) | def forward(self, input, reverse=False): method reverse (line 71) | def reverse(self, output): class Attention2DConv (line 95) | class Attention2DConv(nn.Module): method __init__ (line 97) | def __init__(self): FILE: RestoreFormer/modules/vqvae/arcface_arch.py function conv3x3 (line 6) | def conv3x3(in_planes, out_planes, stride=1): class BasicBlock (line 11) | class BasicBlock(nn.Module): method __init__ (line 14) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 24) | def forward(self, x): class IRBlock (line 43) | class IRBlock(nn.Module): method __init__ (line 46) | def __init__(self, inplanes, planes, stride=1, downsample=None, use_se... method forward (line 60) | def forward(self, x): class Bottleneck (line 81) | class Bottleneck(nn.Module): method __init__ (line 84) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 96) | def forward(self, x): class SEBlock (line 119) | class SEBlock(nn.Module): method __init__ (line 121) | def __init__(self, channel, reduction=16): method forward (line 128) | def forward(self, x): class ResNetArcFace (line 136) | class ResNetArcFace(nn.Module): method __init__ (line 138) | def __init__(self, block, layers, use_se=True): method _make_layer (line 167) | def _make_layer(self, block, planes, blocks, stride=1): method forward (line 182) | def forward(self, x): FILE: RestoreFormer/modules/vqvae/facial_component_discriminator.py class FacialComponentDiscriminator (line 14) | class FacialComponentDiscriminator(nn.Module): method __init__ (line 16) | def __init__(self): method forward (line 26) | def forward(self, x, return_feats=False): FILE: RestoreFormer/modules/vqvae/utils.py function get_roi_regions (line 4) | def get_roi_regions(gt, output, loc_left_eyes, loc_right_eyes, loc_mouths, FILE: RestoreFormer/modules/vqvae/vqvae_arch.py class VectorQuantizer (line 11) | class VectorQuantizer(nn.Module): method __init__ (line 23) | def __init__(self, n_e, e_dim, beta): method forward (line 32) | def forward(self, z): method get_codebook_entry (line 94) | def get_codebook_entry(self, indices, shape): function nonlinearity (line 112) | def nonlinearity(x): function Normalize (line 117) | def Normalize(in_channels): class Upsample (line 121) | class Upsample(nn.Module): method __init__ (line 122) | def __init__(self, in_channels, with_conv): method forward (line 132) | def forward(self, x): class Downsample (line 139) | class Downsample(nn.Module): method __init__ (line 140) | def __init__(self, in_channels, with_conv): method forward (line 151) | def forward(self, x): class ResnetBlock (line 161) | class ResnetBlock(nn.Module): method __init__ (line 162) | def __init__(self, *, in_channels, out_channels=None, conv_shortcut=Fa... method forward (line 200) | def forward(self, x, temb): class MultiHeadAttnBlock (line 223) | class MultiHeadAttnBlock(nn.Module): method __init__ (line 224) | def __init__(self, in_channels, head_size=1): method forward (line 256) | def forward(self, x, y=None): class MultiHeadEncoder (line 300) | class MultiHeadEncoder(nn.Module): method __init__ (line 301) | def __init__(self, ch, out_ch, ch_mult=(1,2,4,8), num_res_blocks=2, method forward (line 367) | def forward(self, x): class MultiHeadDecoder (line 406) | class MultiHeadDecoder(nn.Module): method __init__ (line 407) | def __init__(self, ch, out_ch, ch_mult=(1,2,4,8), num_res_blocks=2, method forward (line 479) | def forward(self, z): class MultiHeadDecoderTransformer (line 513) | class MultiHeadDecoderTransformer(nn.Module): method __init__ (line 514) | def __init__(self, ch, out_ch, ch_mult=(1,2,4,8), num_res_blocks=2, method forward (line 586) | def forward(self, z, hs): class VQVAEGAN (line 622) | class VQVAEGAN(nn.Module): method __init__ (line 623) | def __init__(self, n_embed=1024, embed_dim=256, ch=128, out_ch=3, ch_m... method encode (line 653) | def encode(self, x): method decode (line 660) | def decode(self, quant): method forward (line 666) | def forward(self, input): class VQVAEGANMultiHeadTransformer (line 672) | class VQVAEGANMultiHeadTransformer(nn.Module): method __init__ (line 673) | def __init__(self, n_embed=1024, embed_dim=256, ch=128, out_ch=3, ch_m... method encode (line 708) | def encode(self, x): method decode (line 715) | def decode(self, quant, hs): method forward (line 721) | def forward(self, input): FILE: RestoreFormer/util.py function download (line 18) | def download(url, local_path, chunk_size=1024): function md5_hash (line 30) | def md5_hash(path): function get_ckpt_path (line 36) | def get_ckpt_path(name, root, check=False): class KeyNotFoundError (line 47) | class KeyNotFoundError(Exception): method __init__ (line 48) | def __init__(self, cause, keys=None, visited=None): function retrieve (line 62) | def retrieve( FILE: main.py function get_obj_from_str (line 15) | def get_obj_from_str(string, reload=False): function get_parser (line 23) | def get_parser(**parser_kwargs): function nondefault_trainer_args (line 137) | def nondefault_trainer_args(opt): function instantiate_from_config (line 144) | def instantiate_from_config(config): class WrappedDataset (line 153) | class WrappedDataset(Dataset): method __init__ (line 155) | def __init__(self, dataset): method __len__ (line 158) | def __len__(self): method __getitem__ (line 161) | def __getitem__(self, idx): class DataModuleFromConfig (line 165) | class DataModuleFromConfig(pl.LightningDataModule): method __init__ (line 166) | def __init__(self, batch_size, train=None, validation=None, test=None, method prepare_data (line 183) | def prepare_data(self): method setup (line 187) | def setup(self, stage=None): method _train_dataloader (line 195) | def _train_dataloader(self): method _val_dataloader (line 199) | def _val_dataloader(self): method _test_dataloader (line 204) | def _test_dataloader(self): class SetupCallback (line 209) | class SetupCallback(Callback): method __init__ (line 210) | def __init__(self, resume, now, logdir, ckptdir, cfgdir, config, light... method on_pretrain_routine_start (line 220) | def on_pretrain_routine_start(self, trainer, pl_module): class ImageLogger (line 240) | class ImageLogger(Callback): method __init__ (line 241) | def __init__(self, batch_frequency, max_images, clamp=True, increase_l... method _wandb (line 255) | def _wandb(self, pl_module, images, batch_idx, split): method _testtube (line 264) | def _testtube(self, pl_module, images, batch_idx, split): method log_local (line 275) | def log_local(self, save_dir, split, images, method log_img (line 294) | def log_img(self, pl_module, batch, batch_idx, split="train"): method check_frequency (line 325) | def check_frequency(self, batch_idx): method on_train_batch_end (line 334) | def on_train_batch_end(self, trainer, pl_module, outputs, batch, batch... method on_validation_batch_end (line 337) | def on_validation_batch_end(self, trainer, pl_module, outputs, batch, ... function melk (line 578) | def melk(*args, **kwargs): function divein (line 585) | def divein(*args, **kwargs): FILE: scripts/metrics/cal_fid.py function calculate_fid_folder (line 12) | def calculate_fid_folder(): FILE: scripts/metrics/cal_identity_distance.py function cosine_similarity (line 21) | def cosine_similarity(emb1, emb2): function gray_resize_for_identity (line 25) | def gray_resize_for_identity(out, size=128): function calculate_identity_distance_folder (line 31) | def calculate_identity_distance_folder(): FILE: scripts/metrics/cal_psnr_ssim.py function calculate_psnr_ssim_lpips_folder (line 18) | def calculate_psnr_ssim_lpips_folder(): FILE: scripts/test.py function restoration (line 22) | def restoration(model, function get_parser (line 80) | def get_parser(): function load_model_from_config (line 142) | def load_model_from_config(config, sd, gpu=True, eval_mode=True): function load_model_and_dset (line 191) | def load_model_and_dset(config, ckpt, gpu, eval_mode):