MCPcopy Create free account

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

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

Methodforward
Forward pass for the CrossAttnUpBlock2D class. Args: self (CrossAttnUpBlock2D): An instance of the CrossAttnUpBlock2D cl
hallo/models/unet_2d_blocks.py:1079
Methodforward
Forward pass for the UpBlock2D class. Args: self (UpBlock2D): An instance of the UpBlock2D class. hidden_sta
hallo/models/unet_2d_blocks.py:1268
Methodforward
Forward pass for the UNetMidBlock3DCrossAttn class. Args: self (UNetMidBlock3DCrossAttn): An instance of the UNetMidBloc
hallo/models/unet_3d_blocks.py:407
Methodforward
Defines the forward pass for the CrossAttnDownBlock3D class. Parameters: - hidden_states : torch.Tensor
hallo/models/unet_3d_blocks.py:638
Methodforward
forward method for the DownBlock3D class. Args: hidden_states (Tensor): The input tensor to the DownBlock3D laye
hallo/models/unet_3d_blocks.py:884
Methodforward
Forward pass for the CrossAttnUpBlock3D class. Args: self (CrossAttnUpBlock3D): An instance of the CrossAttnUpBlock3D cl
hallo/models/unet_3d_blocks.py:1092
Methodforward
Forward pass for the UpBlock3D class. Args: self (UpBlock3D): An instance of the UpBlock3D class. hidden_sta
hallo/models/unet_3d_blocks.py:1347
Methodforward
Forward pass of the FaceLocator model. Args: conditioning (Tensor): The input conditioning tensor. Returns:
hallo/models/face_locator.py:94
Methodforward
Forward pass of the InflatedConv3d layer. Args: x (torch.Tensor): Input tensor to the layer. Returns:
hallo/models/resnet.py:50
Methodforward
Performs a forward pass through the CustomClassName. :param x: Input tensor of shape (batch_size, channels, video_length, he
hallo/models/resnet.py:88
Methodforward
Forward pass of the Upsample3D class. Args: hidden_states (torch.Tensor): Input tensor to be upsampled. outp
hallo/models/resnet.py:135
Methodforward
Forward pass for the Downsample3D class. Args: hidden_states (torch.Tensor): Input tensor to be downsampled. Re
hallo/models/resnet.py:232
Methodforward
Forward pass for the ResnetBlock3D class. Args: input_tensor (torch.Tensor): Input tensor to the ResnetBlock3D layer.
hallo/models/resnet.py:372
Methodforward
Forward pass of the TemporalTransformer3DModel. Args: hidden_states (torch.Tensor): The hidden states of the model.
hallo/models/motion_module.py:174
Methodforward
Forward pass for the TemporalTransformer3DModel. Args: hidden_states (torch.Tensor): The input hidden states with shape
hallo/models/motion_module.py:270
Methodforward
Forward pass for the TemporalTransformerBlock. Args: hidden_states (torch.Tensor): The input hidden states with shape
hallo/models/motion_module.py:387
Methodforward
Forward pass of the PositionalEncoding module. This method takes an input tensor `x` and adds the positional encoding to it. The pos
hallo/models/motion_module.py:447
Methodforward
Args: hidden_states (`torch.Tensor`): The hidden states to be passed through the model. encoder_hidde
hallo/models/motion_module.py:553
Methodfuseforward
(self, x)
facelib/detection/yolov5face/models/common.py:53
Functiong_path_regularize
(fake_img, latents, mean_path_length, decay=0.01)
basicsr/losses/losses.py:407
Functiongenerate_frame_indices
Generate an index list for reading `num_frames` frames from a sequence of images. Args: crt_idx (int): Current center index.
basicsr/data/data_util.py:37
Methodget
(self, filepath)
basicsr/utils/file_client.py:14
Methodget
(self, filepath)
basicsr/utils/file_client.py:47
Methodget
(self, filepath)
basicsr/utils/file_client.py:61
Methodget
Get values according to the filepath from one lmdb named client_key. Args: filepath (str | obj:`Path`): Here, filepath is the lmd
basicsr/utils/file_client.py:114
Methodget_component_locations
(self, name, status)
basicsr/data/vfhq_dataset.py:151
Methodget_current_visuals
(self)
basicsr/models/base_model.py:30
Functionget_down_block
Factory function to instantiate a down-block module for the 3D UNet architecture. Down blocks are used in the downsampling part of the U
hallo/models/unet_3d_blocks.py:26
Methodget_embedding
preprocess wav audio file convert to embeddings Args: wav_file (str): The path to the WAV file to be processed. This file should
hallo/datasets/audio_processor.py:136
Functionget_face_region
(image_path: str, detector)
hallo/utils/util.py:722
Functionget_fps
Get the frame rate (FPS) of a video file. Args: video_path (str): The path to the video file. Returns: int: The frame r
hallo/utils/util.py:281
Methodget_frame_from_list
(self)
basicsr/utils/video_util.py:73
Methodget_lr
(self)
basicsr/models/lr_scheduler.py:27
Methodget_lr
(self)
basicsr/models/lr_scheduler.py:86
Methodget_modules
Simple method to avoid too-few-public-methods pylint error
scripts/inference_long.py:91
Methodget_resolution
(self)
basicsr/utils/video_util.py:52
Methodget_sample_shape
Returns the shape of the sample tensor. Returns: Tuple: The shape of the sample tensor.
hallo/models/motion_module.py:92
Methodget_text
(self, filepath)
basicsr/utils/file_client.py:18
Methodget_text
(self, filepath)
basicsr/utils/file_client.py:54
Methodget_text
(self, filepath)
basicsr/utils/file_client.py:67
Methodget_text
(self, filepath)
basicsr/utils/file_client.py:128
Methodget_text
(self, filepath)
basicsr/utils/file_client.py:166
Functionget_up_block
Factory function to instantiate an up-block module for the 3D UNet architecture. Up blocks are used in the upsampling part of the U-Net to i
hallo/models/unet_3d_blocks.py:137
Functionget_valid_bboxes
(bboxes, h, w)
facelib/utils/face_utils.py:23
Functiongradient_penalty_loss
Calculate gradient penalty for wgan-gp. Args: discriminator (nn.Module): Network for the discriminator. real_data (Tensor): Real
basicsr/losses/losses.py:419
Methodhacked_basic_transformer_inner_forward
( self, hidden_states: torch.FloatTensor, attention_mask: Optional[torch.F
hallo/models/mutual_self_attention.py:174
Functionimg_rotate
Rotate image. Args: img (ndarray): Image to be rotated. angle (float): Rotation angle in degrees. Positive values mean
basicsr/data/transforms.py:147
Functionimresize
imresize function same as MATLAB. It now only supports bicubic. The same scale applies for both height and width. Args: img (Ten
basicsr/utils/matlab_functions.py:86
Methodinit_training_settings
(self)
basicsr/models/codeformer_temporal_model.py:31
Methodinit_training_settings
(self)
basicsr/models/vqgan_model.py:22
Methodload_change_cross_attention_dim
Load or change the cross-attention dimension of a pre-trained model. Parameters: pretrained_model_name_or_path (:class:`
hallo/models/unet_2d_condition.py:1361
Functionlog_sum_exp
Utility function for computing log_sum_exp while determining This will be used to determine unaveraged confidence loss across all examples in
facelib/detection/retinaface/retinaface_utils.py:343
Functionmake_frame
(t)
hallo/utils/util.py:314
Functionmake_lmdb_from_imgs
Make lmdb from images. Contents of lmdb. The file structure is: example.lmdb ├── data.mdb ├── lock.mdb ├── meta_info.txt The
basicsr/utils/lmdb_util.py:9
Functionmaster_only
(func)
basicsr/utils/dist_util.py:74
Functionmatch
Match each prior box with the ground truth box of the highest jaccard overlap, encode the bounding boxes, then return the matched indices corr
facelib/detection/retinaface/retinaface_utils.py:142
Functionmatrix_iof
return iof of a and b, numpy version for data augenmentation
facelib/detection/retinaface/retinaface_utils.py:130
Functionmatrix_iou
return iou of a and b, numpy version for data augenmentation
facelib/detection/retinaface/retinaface_utils.py:117
Methodnext
(self)
basicsr/data/prefetch_dataloader.py:74
Functionnms
Apply non-maximum suppression at test time to avoid detecting too many overlapping bounding boxes for a given object. Args: boxes: (te
facelib/detection/retinaface/retinaface_utils.py:357
Methodoptimize_parameters
(self)
basicsr/models/base_model.py:27
Methodoptimize_parameters
(self, current_iter)
basicsr/models/codeformer_temporal_model.py:99
Methodoptimize_parameters
(self, current_iter)
basicsr/models/vqgan_model.py:117
Functionpaired_paths_from_folder
Generate paired paths from folders. Args: folders (list[str]): A list of folder path. The order of list should be [input_fold
basicsr/data/data_util.py:192
Functionpaired_paths_from_lmdb
Generate paired paths from lmdb files. Contents of lmdb. Taking the `lq.lmdb` for example, the file structure is: lq.lmdb ├── data.mdb
basicsr/data/data_util.py:89
Functionpaired_paths_from_meta_info_file
Generate paired paths from an meta information file. Each line in the meta information file contains the image names and image shape (usually
basicsr/data/data_util.py:148
Functionpaired_random_crop
Paired random crop. It crops lists of lq and gt images with corresponding locations. Args: img_gts (list[ndarray] | ndarray): GT ima
basicsr/data/transforms.py:25
Functionparse
(x)
basicsr/archs/arch_util.py:306
Functionpaths_from_folder
Generate paths from folder. Args: folder (str): Folder path. Returns: list[str]: Returned path list.
basicsr/data/data_util.py:228
Functionpaths_from_lmdb
Generate paths from lmdb. Args: folder (str): Folder path. Returns: list[str]: Returned path list.
basicsr/data/data_util.py:243
Methodprepare_condition
Prepares the condition for the face animation pipeline. Args: cond_image (torch.Tensor): The conditional image tensor.
hallo/animate/face_animate_static.py:278
Methodpreprocess
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:265
Functionr1_penalty
R1 regularization for discriminator. The core idea is to penalize the gradient on real data alone: when the generator distribution pro
basicsr/losses/losses.py:390
Functionrandom_ff_mask
Generate a random free form mask with configuration. Args: config: Config should have configuration including IMG_SHAPES, VERT
basicsr/data/data_util.py:365
Functionrandom_mixed_kernels
Randomly generate mixed kernels. Args: kernel_list (tuple): a list name of kenrel types, support ['iso', 'aniso', 'skew', 'gen
basicsr/data/gaussian_kernels.py:519
Functionread_frames
Reads video frames from a given video file. Args: video_path (str): The path to the video file. Returns: container (av.
hallo/utils/util.py:245
Functionread_img_seq
Read a sequence of images from a given folder path. Args: path (list[str] | str): List of image paths or image folder path. requi
basicsr/data/data_util.py:13
Methodregister
Register the given object under the the name `obj.__name__`. Can be used as either a decorator or not. See docstring of this
basicsr/utils/registry.py:43
Methodreset
(self)
basicsr/data/prefetch_dataloader.py:80
Functionresize_flow
Resize a flow according to ratio or shape. Args: flow (Tensor): Precomputed flow. shape [N, 2, H, W]. size_type (str): 'ratio' or
basicsr/archs/arch_util.py:151
Functionrgb2gray
(img, out_channel=3)
facelib/utils/misc.py:162
Functionrgb2ycbcr
Convert a RGB image to YCbCr image. This function produces the same results as Matlab's `rgb2ycbcr` function. It implements the ITU-R BT.601
basicsr/utils/matlab_functions.py:169
Methodrun
(self)
basicsr/utils/realesrgan_utils.py:268
Methodrun
(self)
basicsr/data/prefetch_dataloader.py:25
Methodsave
(self, epoch, current_iter)
basicsr/models/codeformer_temporal_model.py:233
Methodsave
(self, epoch, current_iter)
basicsr/models/vqgan_model.py:279
Functionsave_image_batch
(image_tensor, save_path)
scripts/inference_long.py:125
Functionsave_image_batch
(image_tensor, save_path)
scripts/train_stage2_long.py:253
Functionsave_videos_grid
Save a grid of videos as an animation or video. Args: videos (torch.Tensor): A tensor of shape (batch_size, channels, time, height,
hallo/utils/util.py:207
Functionscandir
Scan a directory to find the interested files. Args: dir_path (str): Path of the directory. suffix (str | tuple(str), optional): F
facelib/utils/misc.py:106
Methodset_attn_processor
r""" Sets the attention processor to use to compute attention. Parameters: processor (`dict` of `AttentionProcessor` or o
hallo/models/unet_3d.py:471
Methodset_chunk_feed_forward
Sets the chunk size for feed-forward processing in the transformer block. Args: chunk_size (Optional[int]): The size of
hallo/models/attention.py:242
Methodset_default_attn_processor
Disables custom attention processors and sets the default attention implementation.
hallo/models/unet_2d_condition.py:774
Methodset_upscale_factor
(self, upscale_factor)
facelib/utils/face_restoration_helper.py:128
Methodset_use_memory_efficient_attention_xformers
Sets the use of memory-efficient attention xformers for the VersatileAttention class. Args: use_memory_efficient_attenti
hallo/models/motion_module.py:507
Functionshow_one_kernel
()
basicsr/data/gaussian_kernels.py:588
Functiontensor2img_fast
This implementation is slightly faster than tensor2img. It now only supports torch tensor with shape (1, c, h, w). Args: tensor (Tens
basicsr/utils/img_util.py:97
Functiontrunc_normal_
r"""Fills the input Tensor with values drawn from a truncated normal distribution. From: https://github.com/rwightman/pytorch-image-models/bl
basicsr/archs/arch_util.py:277
Functionupfirdn2d
(input, kernel, up=1, down=1, pad=(0, 0))
basicsr/ops/upfirdn2d/upfirdn2d.py:147
Functionweighted_loss
Create a weighted version of a given loss function. To use this decorator, the loss function must have the signature like `loss_func(pred, ta
basicsr/losses/loss_util.py:57
← previousnext →701–800 of 805, ranked by callers