SYMBOL INDEX (232 symbols across 25 files) FILE: concern/image.py function load_image (line 6) | def load_image(path): function resize_by_max (line 15) | def resize_by_max(image, max_side=512, force=False): function image2buffer (line 25) | def image2buffer(image): FILE: concern/track.py class Track (line 6) | class Track: method __init__ (line 7) | def __init__(self): method track (line 11) | def track(self, mark): FILE: concern/visualize.py function channel_first (line 5) | def channel_first(image, format): function mask2image (line 9) | def mask2image(mask:np.array, format="HWC"): function draw_points (line 18) | def draw_points(image, points, color=(255, 0, 0)): FILE: faceutils/dlibutils/main.py function detect (line 15) | def detect(image: Image) -> 'faces': function crop (line 33) | def crop(image: Image, face, up_ratio, down_ratio, width_ratio) -> (Imag... function crop_by_image_size (line 84) | def crop_by_image_size(image: Image, face) -> (Image, 'face'): function landmarks (line 110) | def landmarks(image: Image, face): function crop_from_array (line 114) | def crop_from_array(image: np.array, face) -> (np.array, 'face'): FILE: faceutils/mask/main.py class FaceParser (line 14) | class FaceParser: method __init__ (line 15) | def __init__(self, device="cpu"): method parse (line 30) | def parse(self, image: Image): FILE: faceutils/mask/model.py class ConvBNReLU (line 11) | class ConvBNReLU(nn.Module): method __init__ (line 12) | def __init__(self, in_chan, out_chan, ks=3, stride=1, padding=1, *args... method forward (line 23) | def forward(self, x): method init_weight (line 28) | def init_weight(self): class BiSeNetOutput (line 34) | class BiSeNetOutput(nn.Module): method __init__ (line 35) | def __init__(self, in_chan, mid_chan, n_classes, *args, **kwargs): method forward (line 41) | def forward(self, x): method init_weight (line 46) | def init_weight(self): method get_params (line 52) | def get_params(self): class AttentionRefinementModule (line 64) | class AttentionRefinementModule(nn.Module): method __init__ (line 65) | def __init__(self, in_chan, out_chan, *args, **kwargs): method forward (line 73) | def forward(self, x): method init_weight (line 82) | def init_weight(self): class ContextPath (line 89) | class ContextPath(nn.Module): method __init__ (line 90) | def __init__(self, *args, **kwargs): method forward (line 101) | def forward(self, x): method init_weight (line 124) | def init_weight(self): method get_params (line 130) | def get_params(self): class SpatialPath (line 143) | class SpatialPath(nn.Module): method __init__ (line 144) | def __init__(self, *args, **kwargs): method forward (line 152) | def forward(self, x): method init_weight (line 159) | def init_weight(self): method get_params (line 165) | def get_params(self): class FeatureFusionModule (line 177) | class FeatureFusionModule(nn.Module): method __init__ (line 178) | def __init__(self, in_chan, out_chan, *args, **kwargs): method forward (line 197) | def forward(self, fsp, fcp): method init_weight (line 209) | def init_weight(self): method get_params (line 215) | def get_params(self): class BiSeNet (line 227) | class BiSeNet(nn.Module): method __init__ (line 228) | def __init__(self, n_classes, *args, **kwargs): method forward (line 238) | def forward(self, x): method init_weight (line 253) | def init_weight(self): method get_params (line 259) | def get_params(self): FILE: faceutils/mask/resnet.py function conv3x3 (line 11) | def conv3x3(in_planes, out_planes, stride=1): class BasicBlock (line 17) | class BasicBlock(nn.Module): method __init__ (line 18) | def __init__(self, in_chan, out_chan, stride=1): method forward (line 33) | def forward(self, x): function create_layer_basic (line 48) | def create_layer_basic(in_chan, out_chan, bnum, stride=1): class Resnet18 (line 55) | class Resnet18(nn.Module): method __init__ (line 56) | def __init__(self): method forward (line 68) | def forward(self, x): method init_weight (line 79) | def init_weight(self): method get_params (line 87) | def get_params(self): FILE: models/elegant.py class Generator (line 11) | class Generator(nn.ModuleDict): method __init__ (line 13) | def __init__(self, conv_dim=64, image_size=256, num_layer_e=2, num_lay... method get_transfer_input (line 104) | def get_transfer_input(self, image, mask, diff, lms, is_reference=False): method get_transfer_output (line 137) | def get_transfer_output(self, fea_c_list, mask_c_list, diff_c_list, lm... method decode (line 164) | def decode(self, fea_c_list, attn_out_list): method forward (line 182) | def forward(self, c, s, mask_c, mask_s, diff_c, diff_s, lms_c, lms_s): method tps_align (line 197) | def tps_align(self, feature_size, lms_s, lms_c, fea_s, sample_mode='bi... FILE: models/loss.py class GANLoss (line 9) | class GANLoss(nn.Module): method __init__ (line 15) | def __init__(self, gan_mode='lsgan', target_real_label=1.0, target_fak... method forward (line 35) | def forward(self, prediction, target_is_real): function norm (line 53) | def norm(x: torch.Tensor): function de_norm (line 56) | def de_norm(x: torch.Tensor): function masked_his_match (line 60) | def masked_his_match(image_s, image_r, mask_s, mask_r): function generate_pgt (line 86) | def generate_pgt(image_s, image_r, mask_s, mask_r, lms_s, lms_r, margins... class LinearAnnealingFn (line 115) | class LinearAnnealingFn(): method __init__ (line 119) | def __init__(self, milestones, f_values): method __call__ (line 124) | def __call__(self, t:int): class ComposePGT (line 137) | class ComposePGT(nn.Module): method __init__ (line 138) | def __init__(self, margins, skin_alpha, eye_alpha, lip_alpha): method forward (line 148) | def forward(self, sources, targets, mask_srcs, mask_tars, lms_srcs, lm... class AnnealingComposePGT (line 158) | class AnnealingComposePGT(nn.Module): method __init__ (line 159) | def __init__(self, margins, method step (line 174) | def step(self): method forward (line 181) | def forward(self, sources, targets, mask_srcs, mask_tars, lms_srcs, lm... class MakeupLoss (line 192) | class MakeupLoss(nn.Module): method __init__ (line 196) | def __init__(self): method forward (line 199) | def forward(self, x, target, mask=None): FILE: models/model.py function get_generator (line 11) | def get_generator(config): function get_discriminator (line 27) | def get_discriminator(config): class Discriminator (line 38) | class Discriminator(nn.Module): method __init__ (line 40) | def __init__(self, input_channel=3, conv_dim=64, num_layers=3, norm='S... method forward (line 73) | def forward(self, x): class VGG (line 79) | class VGG(TVGG): method forward (line 80) | def forward(self, x): function make_layers (line 85) | def make_layers(cfg, batch_norm=False): function _vgg (line 101) | def _vgg(arch, cfg, batch_norm, pretrained, progress, **kwargs): function vgg16 (line 112) | def vgg16(pretrained=False, progress=True, **kwargs): FILE: models/modules/histogram_matching.py function cal_hist (line 4) | def cal_hist(image): function cal_trans (line 25) | def cal_trans(ref, adj): function histogram_matching (line 39) | def histogram_matching(dstImg, refImg, index): FILE: models/modules/module_attn.py class MultiheadAttention_weight (line 7) | class MultiheadAttention_weight(nn.Module): method __init__ (line 8) | def __init__(self, feature_dim, proj_dim, num_heads=1, dropout=0.0, bi... method forward (line 21) | def forward(self, fea_c, fea_s, mask_c, mask_s): class MultiheadAttention_value (line 55) | class MultiheadAttention_value(nn.Module): method __init__ (line 56) | def __init__(self, feature_dim, proj_dim, num_heads=1, bias=True): method forward (line 66) | def forward(self, weights, fea): class MultiheadAttention (line 82) | class MultiheadAttention(nn.Module): method __init__ (line 83) | def __init__(self, in_channels, proj_channels, value_channels, out_cha... method forward (line 88) | def forward(self, fea_q, fea_k, fea_v, mask_q, mask_k): class FeedForwardLayer (line 97) | class FeedForwardLayer(nn.Module): method __init__ (line 98) | def __init__(self, feature_dim, ff_dim, dropout=0.0): method forward (line 108) | def forward(self, x): class Attention_apply (line 112) | class Attention_apply(nn.Module): method __init__ (line 113) | def __init__(self, feature_dim, normalize=True): method forward (line 121) | def forward(self, x, attn_out): FILE: models/modules/module_base.py class ResidualBlock (line 7) | class ResidualBlock(nn.Module): method __init__ (line 9) | def __init__(self, dim_in, dim_out): method forward (line 19) | def forward(self, x): class ResidualBlock_IN (line 24) | class ResidualBlock_IN(nn.Module): method __init__ (line 26) | def __init__(self, dim_in, dim_out, affine=False): method forward (line 38) | def forward(self, x): class ResidualBlock_Downsample (line 43) | class ResidualBlock_Downsample(nn.Module): method __init__ (line 45) | def __init__(self, dim_in, dim_out, affine=False): method forward (line 57) | def forward(self, x): class Downsample (line 64) | class Downsample(nn.Module): method __init__ (line 66) | def __init__(self, dim_in, dim_out, affine=False): method forward (line 74) | def forward(self, x): class ResidualBlock_Upsample (line 78) | class ResidualBlock_Upsample(nn.Module): method __init__ (line 80) | def __init__(self, dim_in, dim_out, normalize=True, affine=False): method forward (line 98) | def forward(self, x): class Upsample (line 105) | class Upsample(nn.Module): method __init__ (line 107) | def __init__(self, dim_in, dim_out, normalize=True, affine=False): method forward (line 121) | def forward(self, x): class PositionalEmbedding (line 125) | class PositionalEmbedding(nn.Module): method __init__ (line 126) | def __init__(self, embedding_dim=136, feature_size=64, max_size=None, ... method forward (line 135) | def forward(self, diff, mask): class MergeBlock (line 165) | class MergeBlock(nn.Module): method __init__ (line 166) | def __init__(self, merge_mode, feature_dim, normalize=True): method forward (line 181) | def forward(self, fea_s, fea_r): FILE: models/modules/pseudo_gt.py function expand_area (line 11) | def expand_area(mask:torch.Tensor, margin:int): function mask_blur (line 28) | def mask_blur(mask:torch.Tensor, blur_size=3, mode='smooth'): function mask_blend (line 54) | def mask_blend(mask, blend_alpha, mask_bound=None, blur_size=3, blend_mo... function tps_align (line 64) | def tps_align(img_size, lms_r, lms_s, image_r, image_s=None, function tps_blend (line 86) | def tps_blend(blend_alpha, img_size, lms_r, lms_s, image_r, image_s=None... function fine_align (line 110) | def fine_align(img_size, lms_r, lms_s, image_r, image_s, mask_r, mask_s,... FILE: models/modules/sow_attention.py class WindowAttention (line 6) | class WindowAttention(nn.Module): method __init__ (line 7) | def __init__(self, window_size, in_channels, proj_channels, value_chan... method generate_window_weight (line 33) | def generate_window_weight(self): method make_window (line 41) | def make_window(self, x: torch.Tensor): method demake_window (line 54) | def demake_window(self, x: torch.Tensor): method make_mask_window (line 70) | def make_mask_window(self, mask: torch.Tensor): method forward (line 83) | def forward(self, fea_q, fea_k, fea_v, mask_q=None, mask_k=None): class SowAttention (line 118) | class SowAttention(nn.Module): method __init__ (line 119) | def __init__(self, window_size, in_channels, proj_channels, value_chan... method forward (line 128) | def forward(self, fea_q, fea_k, fea_v, mask_q=None, mask_k=None): class StridedwindowAttention (line 182) | class StridedwindowAttention(nn.Module): method __init__ (line 183) | def __init__(self, stride, in_channels, proj_channels, value_channels,... method make_window (line 203) | def make_window(self, x: torch.Tensor): method demake_window (line 218) | def demake_window(self, x: torch.Tensor, h, w): method make_mask_window (line 231) | def make_mask_window(self, mask: torch.Tensor): method forward (line 244) | def forward(self, fea_q, fea_k, fea_v, mask_q=None, mask_k=None): FILE: models/modules/spectral_norm.py function l2normalize (line 4) | def l2normalize(v, eps=1e-12): class SpectralNorm (line 7) | class SpectralNorm(object): method __init__ (line 8) | def __init__(self): method compute_weight (line 13) | def compute_weight(self, module): method apply (line 27) | def apply(module): method remove (line 59) | def remove(self, module): method __call__ (line 67) | def __call__(self, module, inputs): function spectral_norm (line 70) | def spectral_norm(module): function remove_spectral_norm (line 74) | def remove_spectral_norm(module): FILE: models/modules/tps_transform.py function grid_sample (line 15) | def grid_sample(input, grid, mode='bilinear', canvas=None): function compute_partial_repr (line 27) | def compute_partial_repr(input_points, control_points): function bulid_delta_inverse (line 44) | def bulid_delta_inverse(target_control_points): function build_target_coordinate_matrix (line 62) | def build_target_coordinate_matrix(target_height, target_width, target_c... function tps_sampler (line 81) | def tps_sampler(target_height, target_width, inverse_kernel, target_coor... function tps_spatial_transform (line 102) | def tps_spatial_transform(target_height, target_width, target_control_po... class TPSSpatialTransformer (line 116) | class TPSSpatialTransformer(nn.Module): method __init__ (line 118) | def __init__(self, target_height, target_width, target_control_points): method forward (line 135) | def forward(self, source, source_control_points): FILE: scripts/demo.py function main (line 14) | def main(config, args): FILE: scripts/train.py function main (line 14) | def main(config, args): FILE: training/config.py function get_config (line 94) | def get_config()->CfgNode: FILE: training/dataset.py class MakeupDataset (line 9) | class MakeupDataset(Dataset): method __init__ (line 10) | def __init__(self, config=None): method load_from_file (line 22) | def load_from_file(self, img_name): method __len__ (line 29) | def __len__(self): method __getitem__ (line 32) | def __getitem__(self, index): function get_loader (line 41) | def get_loader(config): FILE: training/inference.py class InputSample (line 13) | class InputSample: method __init__ (line 14) | def __init__(self, inputs, apply_mask=None): method clear (line 20) | def clear(self): class Inference (line 25) | class Inference: method __init__ (line 31) | def __init__(self, config, args, model_path="G.pth"): method prepare_input (line 41) | def prepare_input(self, *data_inputs): method postprocess (line 52) | def postprocess(self, source, crop_face, result): method generate_source_sample (line 74) | def generate_source_sample(self, source_input): method generate_reference_sample (line 81) | def generate_reference_sample(self, reference_input, apply_mask=None, method generate_partial_mask (line 97) | def generate_partial_mask(self, source_mask, mask_area='full', saturat... method interface_transfer (line 124) | def interface_transfer(self, source_sample: InputSample, reference_sam... method transfer (line 184) | def transfer(self, source: Image, reference: Image, postprocess=True): method joint_transfer (line 209) | def joint_transfer(self, source: Image, reference_lip: Image, referenc... FILE: training/preprocess.py class PreProcess (line 15) | class PreProcess: method __init__ (line 17) | def __init__(self, config, need_parser=True, device='cpu'): method mask_process (line 54) | def mask_process(self, mask: torch.Tensor): method save_mask (line 74) | def save_mask(self, mask: torch.Tensor, path): method load_mask (line 80) | def load_mask(self, path): method lms_process (line 87) | def lms_process(self, image:Image): method diff_process (line 108) | def diff_process(self, lms: torch.Tensor, normalize=False): method save_lms (line 121) | def save_lms(self, lms: torch.Tensor, path): method load_lms (line 125) | def load_lms(self, path): method preprocess (line 130) | def preprocess(self, image: Image, is_crop=True): method process (line 170) | def process(self, image: Image, mask: torch.Tensor, lms: torch.Tensor): method __call__ (line 176) | def __call__(self, image:Image, is_crop=True): FILE: training/solver.py class Solver (line 18) | class Solver(): method __init__ (line 19) | def __init__(self, config, args, logger=None, inference=False): method print_network (line 100) | def print_network(self, model, name): method weights_init_xavier (line 110) | def weights_init_xavier(self, m): method build_model (line 117) | def build_model(self): method train (line 154) | def train(self, data_loader): method get_loss_tmp (line 355) | def get_loss_tmp(self): method log_loss (line 374) | def log_loss(self, loss_tmp): method plot_loss (line 392) | def plot_loss(self): method load_checkpoint (line 410) | def load_checkpoint(self): method save_models (line 426) | def save_models(self): method de_norm (line 435) | def de_norm(self, x): method vis_train (line 439) | def vis_train(self, img_train_batch): method generate (line 446) | def generate(self, image_A, image_B, mask_A=None, mask_B=None, method test (line 453) | def test(self, image_A, mask_A, diff_A, lms_A, image_B, mask_B, diff_B... FILE: training/utils.py function create_logger (line 6) | def create_logger(save_path='', file_type='', level='debug', console=True): function print_args (line 29) | def print_args(args, logger=None): function plot_single_curve (line 36) | def plot_single_curve(path, name, point, freq=1, xlabel='Epoch',ylabel=N... function plot_curves (line 47) | def plot_curves(path, name, point_list, curve_names=None, freq=1, xlabel...