MCPcopy Create free account

hub / github.com/fudan-generative-vision/hallo2 / functions

Functions805 in github.com/fudan-generative-vision/hallo2

↓ 120 callersMethodget
(self, name)
basicsr/utils/registry.py:62
↓ 25 callersMethodupdate
Update the model's parameters. Args: writer (torch.nn.Module): The model's writer object. dtype (torch.dtype
hallo/models/mutual_self_attention.py:404
↓ 23 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` is
basicsr/utils/logger.py:105
↓ 21 callersMethodkeys
(self)
basicsr/utils/registry.py:74
↓ 16 callersMethodaugmentation
Apply the given transformation to the input images. Args: images (List[PIL.Image] or PIL.Image): The input image
hallo/datasets/talk_video.py:175
↓ 14 callersMethod_augmentation
(self, images, transform, state=None)
hallo/datasets/image_processor.py:198
↓ 13 callersFunctionconv_dw
(inp, oup, stride, leaky=0.1)
facelib/detection/retinaface/retinaface_net.py:25
↓ 13 callersMethodsave
(self, epoch, current_iter)
basicsr/models/sr_model.py:204
↓ 12 callersMethodclose
(self)
basicsr/utils/lmdb_util.py:193
↓ 12 callersFunctiontorch_dfs
Perform a depth-first search (DFS) traversal on a PyTorch model's neural network architecture. This function recursively traverses all the c
hallo/models/mutual_self_attention.py:19
↓ 11 callersMethodencode
Encodes the input features into the output space. Args: extract_features (torch.Tensor): The extracted features from the
hallo/models/wav2vec.py:133
↓ 10 callersMethod__init__
(self, c1, c2, n=1, shortcut=True, g=1, e=0.5)
facelib/detection/yolov5face/models/common.py:108
↓ 9 callersMethod__init__
(self, in_channels, nf, emb_dim, ch_mult, num_res_blocks, resolution, attn_resolutions)
basicsr/archs/vqgan_arch.py:231
↓ 9 callersMethodclear
Clears the attention bank of all reader attention modules. This method is used when the `reference_attn` attribute is set to `True`.
hallo/models/mutual_self_attention.py:456
↓ 9 callersFunctionnormalize
(in_channels)
basicsr/archs/vqgan_arch.py:15
↓ 9 callersMethodpreprocess
Apply preprocessing to the source image to prepare for face analysis. Parameters: source_image_path (str): The path to t
hallo/datasets/image_processor.py:107
↓ 8 callersFunctionmesh_grid
Generate the mesh grid, centering at zero. Args: kernel_size (int): Returns: xy (ndarray): with the shape (kernel_size, kernel
basicsr/data/gaussian_kernels.py:23
↓ 7 callersMethodbackward
(ctx, grad_output)
basicsr/ops/upfirdn2d/upfirdn2d.py:129
↓ 7 callersFunctionconstruct_paths
Construct a new path by replacing the base directory and extension in the original path. Args: video_path (str): The original video
scripts/extract_meta_info_stage2.py:64
↓ 7 callersFunctionfile_exists
Check if a file exists. Args: file_path (str): The path to the file. Returns: bool: True if the file exists, False othe
scripts/extract_meta_info_stage2.py:51
↓ 7 callersMethodsave_network
Save networks. Args: net (nn.Module | list[nn.Module]): Network(s) to be saved. net_label (str): Network label.
basicsr/models/base_model.py:171
↓ 7 callersFunctionscandir
Scan a directory to find the interested files. Args: dir_path (str): Path of the directory. suffix (str | tuple(str), optional):
basicsr/utils/misc.py:74
↓ 7 callersFunctiontensor2img
Convert torch Tensors into image numpy arrays. After clamping to [min, max], values will be normalized to [0, 1]. Args: tensor (Tens
basicsr/utils/img_util.py:38
↓ 6 callersMethod__init__
(self, loss_weight=1.0, reduction='mean')
basicsr/losses/losses.py:40
↓ 6 callersMethod__init__
( self, in_channels: int, prev_output_channel: int, out_channels: int,
hallo/models/unet_2d_blocks.py:1217
↓ 6 callersFunctionbuild_network
(opt)
basicsr/archs/__init__.py:19
↓ 6 callersMethodmodel_ema
(self, decay=0.999)
basicsr/models/base_model.py:51
↓ 5 callersMethod__init__
(self, in_channel, out_channel)
facelib/detection/retinaface/retinaface_net.py:38
↓ 5 callersMethod__init__
(self, num_class)
facelib/parsing/bisenet.py:112
↓ 5 callersFunctionbuild_loss
Build loss from options. Args: opt (dict): Configuration. It must constain: type (str): Model type.
basicsr/losses/__init__.py:14
↓ 5 callersFunctionconv_bn
(inp, oup, stride=1, leaky=0)
facelib/detection/retinaface/retinaface_net.py:6
↓ 5 callersMethodget_bare_model
Get bare model, especially under wrapping with DistributedDataParallel or DataParallel.
basicsr/models/base_model.py:99
↓ 5 callersFunctionget_motion_module
This function returns a motion module based on the given type and parameters. Args: - in_channels (int): The number of input channel
hallo/models/motion_module.py:102
↓ 5 callersMethodload_network
Load network. Args: load_path (str): The path of networks to be loaded. net (nn.Module): Network. strict
basicsr/models/base_model.py:236
↓ 5 callersMethodput
(self, img_byte, key, img_shape)
basicsr/utils/lmdb_util.py:182
↓ 5 callersFunctionsave_checkpoint
Save the model's state_dict to a checkpoint file. If `total_limit` is provided, this function will remove the oldest checkpoints until t
hallo/utils/util.py:753
↓ 5 callersFunctiontformfwd
Function: ---------- apply affine transform 'trans' to uv Parameters: ---------- @trans: 3x3 np.array tr
facelib/detection/matlab_cp2tform.py:13
↓ 4 callersMethod__init__
(self, in_size=128, out_size=128, min_feat_size=32,
facelib/parsing/parsenet.py:142
↓ 4 callersMethod__init__
(self, inplanes, planes, stride=1, downsample=None, use_se=True)
basicsr/archs/arcface_arch.py:68
↓ 4 callersMethod__init__
( self, in_channels: int, prev_output_channel: int, out_channels: int,
hallo/models/unet_3d_blocks.py:1281
↓ 4 callersMethod__init__
(self, d_model, dropout=0.0, max_len=24)
hallo/models/motion_module.py:435
↓ 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-
basicsr/utils/matlab_functions.py:293
↓ 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
basicsr/utils/matlab_functions.py:320
↓ 4 callersMethod_gram_mat
Calculate Gram matrix. Args: x (torch.Tensor): Tensor with shape of (n, c, h, w). Returns: torch.Tensor: Gra
basicsr/losses/losses.py:240
↓ 4 callersMethod_make_layer
(self, block, planes, num_blocks, stride=1)
basicsr/archs/arcface_arch.py:214
↓ 4 callersFunction_ntuple
(n)
basicsr/archs/arch_util.py:304
↓ 4 callersMethodclose
Closes the ImageProcessor and releases any resources held by the FaceAnalysis instance. Args: self: The ImageProcessor i
hallo/datasets/image_processor.py:184
↓ 4 callersFunctionconv3x3
A simple wrapper for 3x3 convolution with padding. Args: inplanes (int): Channel number of inputs. outplanes (int): Channel numbe
basicsr/archs/arcface_arch.py:5
↓ 4 callersFunctioncreate_layer_basic
(in_chan, out_chan, bnum, stride=1)
facelib/parsing/resnet.py:41
↓ 4 callersFunctionget_device
(gpu_id=None)
basicsr/utils/misc.py:21
↓ 4 callersFunctionget_dist_info
()
basicsr/utils/dist_util.py:60
↓ 4 callersFunctionget_location
(val, length)
facelib/utils/face_restoration_helper.py:21
↓ 4 callersMethodget_optimizer
(self, optim_type, params, lr, **kwargs)
basicsr/models/base_model.py:79
↓ 4 callersFunctionmove_final_checkpoint
Move the final checkpoint file to the save directory. This function identifies the latest checkpoint file based on the given prefix and move
hallo/utils/util.py:1006
↓ 4 callersFunctionreorder_image
Reorder images to 'HWC' order. If the input_order is (h, w), return (h, w, 1); If the input_order is (c, h, w), return (h, w, c); If the
basicsr/metrics/metric_util.py:6
↓ 4 callersFunctionsigma_matrix2
Calculate the rotated sigma matrix (two dimensional matrix). Args: sig_x (float): sig_y (float): theta (float): Radian mea
basicsr/data/gaussian_kernels.py:8
↓ 4 callersFunctionto_y_channel
Change to Y channel of YCbCr. Args: img (ndarray): Images with range [0, 255]. Returns: (ndarray): Images with range [0, 255
basicsr/metrics/metric_util.py:32
↓ 4 callersMethodtolist
(self)
facelib/detection/yolov5face/models/common.py:293
↓ 4 callersFunctionzero_module
Zeroes out the parameters of a given module. Args: module (nn.Module): The module whose parameters need to be zeroed out. Retur
hallo/models/attention.py:909
↓ 3 callersMethod__init__
(self, in_channels, out_channels, kernel_size,
basicsr/ops/dcn/deform_conv.py:188
↓ 3 callersMethod__init__
(self, dim_embd=512, n_head=8, n_layers=9, codebook_size=1024, latent_size=256,
basicsr/archs/codeformer_arch.py:192
↓ 3 callersMethod__init__
( self, dim: int, num_attention_heads: int, attention_head_dim: int, d
hallo/models/attention.py:114
↓ 3 callersMethodaugmentation
Apply data augmentation to the input image. Args: image (PIL.Image): The input image. transform (torchvision
hallo/datasets/mask_image.py:78
↓ 3 callersFunctionblur_mask
Read, resize, blur, normalize, and save an image. Parameters: file_path (str): Path to the input image file. resize_dim (tuple): Dim
hallo/utils/util.py:635
↓ 3 callersFunctioncalculate_metric
Calculate metric from data and options. Args: opt (dict): Configuration. It must constain: type (str): Model type.
basicsr/metrics/__init__.py:9
↓ 3 callersFunctionconv_bn1X1
(inp, oup, stride, leaky=0)
facelib/detection/retinaface/retinaface_net.py:19
↓ 3 callersFunctionconv_bn_no_relu
(inp, oup, stride)
facelib/detection/retinaface/retinaface_net.py:12
↓ 3 callersMethoddetect_faces
Params: imgs: BGR image
facelib/detection/retinaface/retinaface.py:194
↓ 3 callersFunctionfindNonreflectiveSimilarity
(uv, xy, options=None)
facelib/detection/matlab_cp2tform.py:60
↓ 3 callersMethodfrom_pretrained_2d
Load a pre-trained 2D UNet model from a given directory. Parameters: pretrained_model_path (`str` or `PathLike`):
hallo/models/unet_3d.py:718
↓ 3 callersFunctionget_attention_mask
Rearrange the mask tensors to the required format. Args: mask (torch.Tensor): The input mask tensor. weight_dtype (torch.dty
scripts/train_stage2_long.py:186
↓ 3 callersMethodget_codebook_feat
(self, indices, shape)
basicsr/archs/vqgan_arch.py:73
↓ 3 callersFunctionimwrite
Write image to file. Args: img (ndarray): Image array to be written. file_path (str): Image file path. params (None or li
facelib/utils/misc.py:38
↓ 3 callersFunctionimwrite
Write image to file. Args: img (ndarray): Image array to be written. file_path (str): Image file path. params (None or li
basicsr/utils/img_util.py:135
↓ 3 callersFunctionload_file_from_url
Ref:https://github.com/1adrianb/face-alignment/blob/master/face_alignment/utils.py
facelib/utils/misc.py:86
↓ 3 callersFunctionload_file_from_url
Load file form http url, will download models if necessary. Ref:https://github.com/1adrianb/face-alignment/blob/master/face_alignment/utils.py
basicsr/utils/download_util.py:69
↓ 3 callersFunctionmake_cuda_ext
(name, module, sources, sources_cuda=None)
basicsr/setup.py:84
↓ 3 callersFunctionmake_divisible
(x, divisor)
facelib/detection/yolov5face/utils/general.py:17
↓ 3 callersFunctionmkdir_and_rename
mkdirs. If path exists, rename it with timestamp and create a new one. Args: path (str): Folder path.
basicsr/utils/misc.py:48
↓ 3 callersMethodnms
(self, mode=True)
facelib/detection/yolov5face/models/yolo.py:160
↓ 3 callersFunctionpdf2
Calculate PDF of the bivariate Gaussian distribution. Args: sigma_matrix (ndarray): with the shape (2, 2) grid (ndarray): generate
basicsr/data/gaussian_kernels.py:40
↓ 3 callersMethodpreload
(self)
basicsr/data/prefetch_dataloader.py:105
↓ 3 callersMethodpreprocess
Preprocess a WAV audio file by separating the vocals from the background and resampling it to a 16 kHz sample rate. The separated voc
hallo/datasets/audio_processor.py:76
↓ 3 callersMethodreduce_loss_dict
reduce loss dict. In distributed training, it averages the losses among different GPUs . Args: loss_dict (OrderedDict):
basicsr/models/base_model.py:297
↓ 3 callersMethodsave_training_state
Save training states during training, which will be used for resuming. Args: epoch (int): Current epoch. curr
basicsr/models/base_model.py:264
↓ 3 callersMethodsetup_schedulers
Set up schedulers.
basicsr/models/base_model.py:86
↓ 2 callersMethod__detect_faces
(self, inputs)
facelib/detection/retinaface/retinaface.py:147
↓ 2 callersMethod__init__
(self, num_feat, num_grow_ch=32)
basicsr/archs/rrdbnet_arch.py:52
↓ 2 callersMethod__init__
(self, loader)
basicsr/data/prefetch_dataloader.py:70
↓ 2 callersMethod__init__
( self, channels, use_conv=False, use_conv_transpose=False, out_channe
hallo/models/resnet.py:115
↓ 2 callersMethod_do_register
(self, name, obj)
basicsr/utils/registry.py:38
↓ 2 callersFunction_totensor
(img, bgr2rgb, float32)
facelib/utils/misc.py:70
↓ 2 callersFunction_totensor
(img, bgr2rgb, float32)
basicsr/utils/img_util.py:22
↓ 2 callersFunctionadaptive_instance_normalization
Adaptive instance normalization. Adjust the reference features to have the similar color and illuminations as those in the degradate features
basicsr/archs/codeformer_arch.py:33
↓ 2 callersFunctionbivariate_anisotropic_Gaussian
Generate a bivariate anisotropic Gaussian kernel. Args: kernel_size (int): sig_x (float): sig_y (float): theta (fl
basicsr/data/gaussian_kernels.py:139
↓ 2 callersFunctionbivariate_generalized_Gaussian
Generate a bivariate generalized Gaussian kernel. Described in `Parameter Estimation For Multivariate Generalized Gaussian Distributions`_
basicsr/data/gaussian_kernels.py:181
↓ 2 callersFunctionbivariate_isotropic_Gaussian
Generate a bivariate isotropic Gaussian kernel. Args: kernel_size (int): sig (float): grid (ndarray, optional): generated
basicsr/data/gaussian_kernels.py:163
↓ 2 callersFunctionbivariate_skew_Gaussian_center
Generate a bivariate skew Gaussian kernel at center. Shift with nearest padding. Args: kernel_size (int): sig_x (float): s
basicsr/data/gaussian_kernels.py:112
↓ 2 callersFunctionbox_area
(box)
facelib/detection/yolov5face/utils/general.py:79
↓ 2 callersFunctionbox_iou
Return intersection-over-union (Jaccard index) of boxes. Both sets of boxes are expected to be in (x1, y1, x2, y2) format. Arguments:
facelib/detection/yolov5face/utils/general.py:66
next →1–100 of 805, ranked by callers