MCPcopy Create free account

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

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

↓ 2 callersFunctionbuild_dataloader
Build dataloader. Args: dataset (torch.utils.data.Dataset): Dataset. dataset_opt (dict): Dataset options. It contains the followi
basicsr/data/__init__.py:40
↓ 2 callersFunctionbuild_dataset
Build dataset from options. Args: dataset_opt (dict): Configuration for dataset. It must constain: name (str): Dataset name.
basicsr/data/__init__.py:25
↓ 2 callersFunctionbuild_model
Build model from options. Args: opt (dict): Configuration. It must constain: model_type (str): Model type.
basicsr/models/__init__.py:19
↓ 2 callersFunctioncalc_mean_std
Args: feat (numpy): 3D [w h c]s
facelib/utils/misc.py:177
↓ 2 callersFunctioncalc_mean_std
Calculate mean and std for adaptive_instance_normalization. Args: feat (Tensor): 4D tensor. eps (float): A small value added to t
basicsr/archs/codeformer_arch.py:16
↓ 2 callersFunctioncalculate_weights_indices
Calculate weights and indices, used for imresize function. Args: in_length (int): Input length. out_length (int): Output length.
basicsr/utils/matlab_functions.py:16
↓ 2 callersFunctioncallback
get the image data and update pbar.
basicsr/utils/lmdb_util.py:78
↓ 2 callersFunctioncompute_face_landmarks
Compute face landmarks from a detection result. Args: detection_result (mediapipe.solutions.face_mesh.FaceMesh): The detection resul
hallo/utils/util.py:378
↓ 2 callersFunctioncompute_snr
Computes SNR as per https://github.com/TiankaiHang/Min-SNR-Diffusion-Training/blob/ 521b624bd70c67cee4bdf49225915f5945a872e3/guid
hallo/utils/util.py:868
↓ 2 callersFunctionconv3x3
3x3 convolution with padding
facelib/parsing/resnet.py:5
↓ 2 callersFunctioncubic
cubic function used for calculate_weights_indices.
basicsr/utils/matlab_functions.py:6
↓ 2 callersFunctiondefault_init_weights
Initialize network weights. Args: module_list (list[nn.Module] | nn.Module): Modules to be initialized. scale (float): Scale init
basicsr/archs/arch_util.py:18
↓ 2 callersFunctiondelete_additional_ckpt
Deletes additional checkpoint files in the given directory. Args: base_path (str): The path to the directory containing the checkpoi
hallo/utils/util.py:121
↓ 2 callersMethoddepthwise_conv
(i, o, kernel_size, stride=1, padding=0, bias=False)
facelib/detection/yolov5face/models/common.py:160
↓ 2 callersMethodenhance
(self, img, outscale=None, alpha_upsampler='realesrgan')
basicsr/utils/realesrgan_utils.py:177
↓ 2 callersFunctionexpand_region
Expand the given region by a specified ratio. Args: region (tuple): A tuple containing the coordinates (min_x, max_x, min_y, max_y) o
hallo/utils/util.py:575
↓ 2 callersMethodfeed_data
(self, data)
basicsr/models/sr_model.py:86
↓ 2 callersMethodforward
Args: pred (Tensor): of shape (N, C, H, W). Predicted tensor. target (Tensor): of shape (N, C, H, W). Ground truth te
basicsr/losses/losses.py:48
↓ 2 callersMethodforward
Mish activation function. Args: hidden_states (torch.Tensor): The input tensor to apply the Mish activation function to.
hallo/models/resnet.py:425
↓ 2 callersFunctionget_blur_mask
Read, resize, blur, normalize, and save an image. Parameters: file_path (str): Path to the input image file. output_dir (str): Path
hallo/utils/util.py:613
↓ 2 callersFunctionget_down_block
This function creates and returns a UpBlock2D or CrossAttnUpBlock2D object based on the given up_block_type. Args: up_block_type (str):
hallo/models/unet_2d_blocks.py:35
↓ 2 callersFunctionget_face_mask
Generate a face mask based on the given landmarks. Args: landmarks (numpy.ndarray): The landmarks of the face. height (int):
hallo/utils/util.py:497
↓ 2 callersMethodget_frame
(self)
basicsr/utils/video_util.py:80
↓ 2 callersFunctionget_largest_face
(det_faces, h, w)
facelib/utils/face_restoration_helper.py:19
↓ 2 callersFunctionget_lip_mask
Extracts the lip region from the given landmarks and saves it as an image. Parameters: landmarks (numpy.ndarray): Array of facial la
hallo/utils/util.py:453
↓ 2 callersFunctionget_reference_facial_points
Function: ---------- get reference 5 key points according to crop settings: 0. Set default crop_size: if default_
facelib/detection/align_trans.py:19
↓ 2 callersFunctionget_similarity_transform
Function: ---------- Find Similarity Transform Matrix 'trans': u = src_pts[:, 0] v = src_pts[:, 1]
facelib/detection/matlab_cp2tform.py:130
↓ 2 callersFunctionget_time_str
()
basicsr/utils/misc.py:44
↓ 2 callersFunctionget_union_mask
Compute the union of a list of masks. This function takes a list of masks and computes their union by taking the maximum value at each pixel
hallo/utils/util.py:969
↓ 2 callersFunctionget_up_block
This function ... Args: Returns:
hallo/models/unet_2d_blocks.py:132
↓ 2 callersFunctionimg2tensor
Numpy array to tensor. Args: imgs (list[ndarray] | ndarray): Input images. bgr2rgb (bool): Whether to change bgr to rgb.
facelib/utils/misc.py:57
↓ 2 callersFunctionimg2tensor
Numpy array to tensor. Args: imgs (list[ndarray] | ndarray): Input images. bgr2rgb (bool): Whether to change bgr to rgb.
basicsr/utils/img_util.py:9
↓ 2 callersFunctionimport_filename
Import a module from a given file location. Args: filename (str): The path to the file containing the module to be imported. Re
hallo/utils/util.py:98
↓ 2 callersFunctioninit_detection_model
(model_name, half=False, device='cuda')
facelib/detection/__init__.py:14
↓ 2 callersFunctioninit_dist
(launcher, backend='nccl', **kwargs)
basicsr/utils/dist_util.py:10
↓ 2 callersFunctioninit_output_dir
Initialize the output directories. This function creates the directories specified in the `dir_list`. If a directory already exists, it does
hallo/utils/util.py:817
↓ 2 callersMethodinit_weights
(self)
basicsr/ops/dcn/deform_conv.py:320
↓ 2 callersFunctionis_gray
(img, threshold=10)
facelib/utils/misc.py:146
↓ 2 callersFunctionletterbox
(img, new_shape=(640, 640), color=(114, 114, 114), auto=True, scale_fill=False, scaleup=True)
facelib/detection/yolov5face/utils/datasets.py:5
↓ 2 callersFunctionlinear_interpolation
Transpose the features to interpolate linearly. Args: features (torch.Tensor): The extracted features to be interpolated. se
hallo/models/wav2vec.py:196
↓ 2 callersFunctionload_checkpoint
Load the most recent checkpoint from the specified directory. This function loads the latest checkpoint from the `save_dir` if the `resume_f
hallo/utils/util.py:830
↓ 2 callersFunctionmass_center_shift
Calculate the shift of the mass center of a kenrel. Args: kernel_size (int): kernel (ndarray): normalized kernel. Returns:
basicsr/data/gaussian_kernels.py:96
↓ 2 callersMethodmodel_to_device
Model to device. It also warps models with DistributedDataParallel or DataParallel. Args: net (nn.Module)
basicsr/models/base_model.py:63
↓ 2 callersMethodnext
(self)
basicsr/data/prefetch_dataloader.py:117
↓ 2 callersFunctionnon_max_suppression
Performs Non-Maximum Suppression (NMS) on inference results Returns: detections with shape: nx6 (x1, y1, x2, y2, conf, cls)
facelib/detection/yolov5face/utils/general.py:168
↓ 2 callersMethodnondist_validation
(self, dataloader, current_iter, tb_logger, save_img)
basicsr/models/sr_model.py:135
↓ 2 callersFunctionnorm_cdf
(x)
basicsr/archs/arch_util.py:243
↓ 2 callersMethodpaste_faces_to_input_image
(self, save_path=None, upsample_img_list=None, draw_box=False, face_upsampler=None)
facelib/utils/face_restoration_helper.py:375
↓ 2 callersFunctionpixel_unshuffle
Pixel unshuffle. Args: x (Tensor): Input feature with shape (b, c, hh, hw). scale (int): Downsample ratio. Returns:
basicsr/archs/arch_util.py:190
↓ 2 callersMethodpost_process
(self)
basicsr/utils/realesrgan_utils.py:165
↓ 2 callersMethodpre_process
Pre-process, such as pre-pad and mod pad, so that the images can be divisible
basicsr/utils/realesrgan_utils.py:71
↓ 2 callersMethodprint_network
Print the str and parameter number of a network. Args: net (nn.Module)
basicsr/models/base_model.py:108
↓ 2 callersMethodprocess
(self)
basicsr/utils/realesrgan_utils.py:96
↓ 2 callersFunctionpy_cpu_nms
Pure Python NMS baseline.
facelib/detection/retinaface/retinaface_utils.py:39
↓ 2 callersMethodrun
(self)
basicsr/utils/realesrgan_utils.py:293
↓ 2 callersMethodsave
Save networks and training state.
basicsr/models/base_model.py:33
↓ 2 callersFunctionscale_coords
(img1_shape, coords, img0_shape, ratio_pad=None)
facelib/detection/yolov5face/utils/general.py:42
↓ 2 callersFunctionseed_everything
Seeds all random number generators to ensure reproducibility. Args: seed (int): The seed value to set for all random number generato
hallo/utils/util.py:85
↓ 2 callersFunctionset_realesrgan
()
scripts/video_sr.py:27
↓ 2 callersFunctionsizeof_fmt
Get human readable file size. Args: size (int): File size. suffix (str): Suffix. Default: 'B'. Return: str: Formated
basicsr/utils/misc.py:143
↓ 2 callersFunctionswish
(x)
basicsr/archs/vqgan_arch.py:20
↓ 2 callersMethodtile_process
It will first crop input images to tiles, and then process each tile. Finally, all the processed tiles are merged into one images. Mo
basicsr/utils/realesrgan_utils.py:100
↓ 2 callersMethodvalidation
Validation function. Args: dataloader (torch.utils.data.DataLoader): Validation dataloader. current_iter (int): Curre
basicsr/models/base_model.py:37
↓ 2 callersMethodwith_pos_embed
(self, tensor, pos: Optional[Tensor])
basicsr/archs/codeformer_arch.py:128
↓ 2 callersFunctionxywh2xyxy
(x)
facelib/detection/yolov5face/utils/general.py:32
↓ 1 callersMethod__align_multi
(self, image, boxes, landmarks, limit=None)
facelib/detection/retinaface/retinaface.py:241
↓ 1 callersMethod__init__
(self, cfg="yolov5s.yaml", ch=3, nc=None)
facelib/detection/yolov5face/models/yolo.py:96
↓ 1 callersMethod__init__
(self, c1, c2, k=3, s=1, g=1, e=1.0, shortcut=False)
facelib/detection/yolov5face/models/experimental.py:12
↓ 1 callersMethod__init__
(self)
facelib/parsing/resnet.py:50
↓ 1 callersMethod__init__
(self, opt, que, qid)
basicsr/utils/realesrgan_utils.py:287
↓ 1 callersMethod__init__
(self, scale, num_feat)
basicsr/archs/arch_util.py:103
↓ 1 callersMethod__init__
(self, optimizer, milestones, gamma=0.1, restarts=(0, ), restart_weights=(1, ), last_epoch=-1)
basicsr/models/lr_scheduler.py:19
↓ 1 callersMethod__iter__
(self)
basicsr/data/prefetch_dataloader.py:36
↓ 1 callersFunction_augment
(img)
basicsr/data/transforms.py:106
↓ 1 callersFunction_augment_flow
(flow)
basicsr/data/transforms.py:115
↓ 1 callersFunction_get_activation_fn
Return an activation function given a string
basicsr/archs/codeformer_arch.py:92
↓ 1 callersMethod_get_init_lr
Get the initial lr, which is set by the scheduler.
basicsr/models/base_model.py:136
↓ 1 callersMethod_infer_shape
(ctx, input, weight)
basicsr/ops/dcn/deform_conv.py:172
↓ 1 callersFunction_init_dist_pytorch
(backend, **kwargs)
basicsr/utils/dist_util.py:21
↓ 1 callersFunction_init_dist_slurm
Initialize slurm distributed training environment. If argument ``port`` is not specified, then the master port will be system environment var
basicsr/utils/dist_util.py:28
↓ 1 callersMethod_initialize_biases
(self, cf=None)
facelib/detection/yolov5face/models/yolo.py:134
↓ 1 callersMethod_log_validation_metric_values
(self, current_iter, dataset_name, tb_logger)
basicsr/models/sr_model.py:186
↓ 1 callersMethod_log_validation_metric_values
(self, current_iter, dataset_name, tb_logger)
basicsr/models/codeformer_temporal_model.py:215
↓ 1 callersMethod_log_validation_metric_values
(self, current_iter, dataset_name, tb_logger)
basicsr/models/vqgan_model.py:262
↓ 1 callersMethod_make_grid
(nx=20, ny=20)
facelib/detection/yolov5face/models/yolo.py:89
↓ 1 callersFunction_minimal_ext_cmd
(cmd)
basicsr/setup.py:23
↓ 1 callersFunction_no_grad_trunc_normal_
(tensor, mean, std, a, b)
basicsr/archs/arch_util.py:239
↓ 1 callersMethod_output_size
(input, weight, padding, dilation, stride)
basicsr/ops/dcn/deform_conv.py:101
↓ 1 callersMethod_postprocess
Postprocessing of raw pytorch model output. Returns: bboxes: list of arrays with 4 coordinates of bounding boxes with for
facelib/detection/yolov5face/face_detector.py:69
↓ 1 callersMethod_preprocess
Preprocessing image before passing through the network. Resize and conversion to torch tensor.
facelib/detection/yolov5face/face_detector.py:48
↓ 1 callersMethod_print_different_keys_loading
Print keys with differnet name or different size when loading models. 1. Print keys with differnet names. 2. If strict=False, print t
basicsr/models/base_model.py:202
↓ 1 callersFunction_scandir
(dir_path, suffix, recursive)
facelib/utils/misc.py:125
↓ 1 callersFunction_scandir
(dir_path, suffix, recursive)
basicsr/utils/misc.py:95
↓ 1 callersMethod_set_lr
Set learning rate for warmup. Args: lr_groups_l (list): List for lr_groups, each for an optimizer.
basicsr/models/base_model.py:126
↓ 1 callersFunction_ssim
Calculate SSIM (structural similarity) for one channel images. It is called by func:`calculate_ssim`. Args: img1 (ndarray): Images w
basicsr/metrics/psnr_ssim.py:49
↓ 1 callersFunctionadain_npy
Adaptive instance normalization for numpy. Args: content_feat (numpy): The input feature. style_feat (numpy): The reference featu
facelib/utils/misc.py:191
↓ 1 callersMethodadd_restored_face
(self, restored_face, input_face=None)
facelib/utils/face_restoration_helper.py:367
↓ 1 callersMethodadopt_weight
(self, weight, global_step, threshold=0, value=0.)
basicsr/models/vqgan_model.py:93
↓ 1 callersFunctionalign_crop_face_landmarks
Align and crop face with landmarks. The output_size and transform_size are based on width. The height is adjusted based on shrink_ratio_h/shr
facelib/utils/face_utils.py:31
↓ 1 callersMethodalign_warp_face
Align and warp faces with face template.
facelib/utils/face_restoration_helper.py:322
← previousnext →101–200 of 805, ranked by callers