MCPcopy Create free account

hub / github.com/Tencent-Hunyuan/HunyuanPortrait / functions

Functions229 in github.com/Tencent-Hunyuan/HunyuanPortrait

↓ 19 callersMethod__init__
(self, num_channels: int, flip_sin_to_cos: bool, downscale_freq_shift: float, scale: int = 1)
src/models/condition/unet_3d_blocks.py:96
↓ 5 callersMethod__init__
(self)
src/models/condition/coarse_motion.py:173
↓ 4 callersMethod_make_layer
(self, block, planes, num_blocks, stride)
src/models/condition/coarse_motion.py:84
↓ 4 callersMethod_make_layer
(self, block, planes, blocks, stride=1, groups=1, base_width=64)
src/models/condition/coarse_motion.py:121
↓ 4 callersMethodprepare_tokens_with_masks
(self, x, masks=None)
src/models/dinov2/models/vision_transformer.py:242
↓ 3 callersMethod__init__
( self, dim: int, num_heads: int, mlp_ratio: float = 4.0, qkv_bias: bo
src/models/dinov2/layers/block.py:148
↓ 3 callersMethod__init__
(self, embedding_dim: int, intensity_embedding_dim: Optional[int] = None)
src/models/condition/refine_motion.py:10
↓ 3 callersFunctionbox_area
(box)
src/dataset/test_preprocess.py:138
↓ 3 callersFunctionsave_videos_from_pil
(pil_images, path, fps=8)
src/dataset/utils.py:283
↓ 3 callersFunctionseed_everything
(seed)
src/dataset/utils.py:277
↓ 2 callersMethod__init__
(self)
src/models/condition/attention_processor.py:103
↓ 2 callersFunction_filter2d
(input, kernel)
src/pipelines/hunyuan_svd_pipeline.py:705
↓ 2 callersFunction_gaussian
(window_size: int, sigma)
src/pipelines/hunyuan_svd_pipeline.py:728
↓ 2 callersFunctionbox_area
(box)
src/dataset/utils.py:36
↓ 2 callersFunctioncreate_soft_mask
create a soft mask with edge blurring for smooth blending.
gradio_app.py:130
↓ 2 callersFunctioncreate_soft_mask
create a soft mask with edge blurring for smooth blending. size: (width, height)
inference.py:24
↓ 2 callersFunctioncrop_resize_img
(img, bbox, image_size)
src/dataset/test_preprocess.py:108
↓ 2 callersFunctiondrop_add_residual_stochastic_depth
( x: Tensor, residual_func: Callable[[Tensor], Tensor], sample_drop_ratio: float = 0.0, )
src/models/dinov2/layers/block.py:233
↓ 2 callersFunctiondrop_add_residual_stochastic_depth_list
( x_list: List[Tensor], residual_func: Callable[[Tensor, Any], Tensor], sample_drop_ratio: float =
src/models/dinov2/layers/block.py:304
↓ 2 callersMethodforward_features
(self, x, masks=None, text_features=None)
src/models/dinov2/models/vision_transformer.py:283
↓ 2 callersFunctionget_attn_bias_and_cat
this will perform the index select, cat the tensors, and provide the attn_bias from cache
src/models/dinov2/layers/block.py:280
↓ 2 callersFunctionget_head_exp_motion_bucketid
(lmks, nose_index=2, max_value=127)
src/dataset/utils.py:325
↓ 2 callersFunctioninit_ip_adapters
(unet, num_adapter_embeds=[], scale=1.0)
src/models/condition/unet_3d_svd_condition_ip.py:501
↓ 2 callersMethodinterpolate_pos_encoding
(self, x, w, h)
src/models/dinov2/models/vision_transformer.py:208
↓ 2 callersMethodload_weights
(self, weights_path, strict=True)
src/models/dinov2/models/vision_transformer.py:35
↓ 2 callersFunctionmake_2tuple
(x)
src/models/dinov2/layers/patch_embed.py:16
↓ 2 callersFunctionpreprocess
(image_path, video_path, limit=100, image_size=512, area=1.25, det_path=None)
src/dataset/test_preprocess.py:143
↓ 2 callersFunctionprocess_bbox
raw_vid_path: bbox: format: x1, y1, x2, y2 radio: expand radio against bbox size height,width: source image height and width
src/dataset/test_preprocess.py:49
↓ 2 callersFunctionsave_videos_grid
(videos: torch.Tensor, path: str, rescale=False, n_rows=6, fps=8)
src/dataset/utils.py:308
↓ 2 callersMethodset_attn_processor
r""" Sets the attention processor to use to compute attention. Parameters: processor (`dict` of `AttentionProcessor` or o
src/models/condition/unet_3d_svd_condition_ip.py:276
↓ 2 callersFunctionvit_large
(patch_size=16, num_register_tokens=0, **kwargs)
src/models/dinov2/models/vision_transformer.py:428
↓ 2 callersMethodwriteframe
(self, frame)
src/dataset/utils.py:271
↓ 1 callersMethod__init__
( self, in_features: int, hidden_features: Optional[int] = None, out_features:
src/models/dinov2/layers/swiglu_ffn.py:15
↓ 1 callersMethod__init__
(self, in_features, out_features, dtype=torch.float32)
src/models/dinov2/models/vision_transformer.py:27
↓ 1 callersFunction_build_mlp
(nlayers, in_dim, bottleneck_dim, hidden_dim=None, use_bn=False, bias=True)
src/models/dinov2/layers/dino_head.py:44
↓ 1 callersFunction_compute_padding
Compute padding tuple.
src/pipelines/hunyuan_svd_pipeline.py:682
↓ 1 callersMethod_encode_image
(self, image, arcface_embeddings, prompts, uncond_prompts, num_frames, device, num_videos_per_prompt, do_class
src/pipelines/hunyuan_svd_pipeline.py:115
↓ 1 callersMethod_encode_vae_image
( self, image: torch.Tensor, device, num_videos_per_prompt, do_classif
src/pipelines/hunyuan_svd_pipeline.py:139
↓ 1 callersFunction_gaussian_blur2d
(input, kernel_size, sigma)
src/pipelines/hunyuan_svd_pipeline.py:744
↓ 1 callersMethod_get_add_time_ids
( self, fps, motion_bucket_id, noise_aug_strength, dtype, batc
src/pipelines/hunyuan_svd_pipeline.py:157
↓ 1 callersMethod_get_intermediate_layers_chunked
(self, x, n=1)
src/models/dinov2/models/vision_transformer.py:336
↓ 1 callersMethod_get_intermediate_layers_not_chunked
(self, x, n=1)
src/models/dinov2/models/vision_transformer.py:324
↓ 1 callersMethod_initialize_weights
(self)
src/models/dinov2/layers/block.py:113
↓ 1 callersMethodadd_noise
( self, original_samples: torch.Tensor, noise: torch.Tensor, timesteps: torch.
src/schedulers/scheduling_euler_discrete.py:45
↓ 1 callersFunctionadd_residual
(x, brange, residual, residual_scale_factor, scaling_vector=None)
src/models/dinov2/layers/block.py:265
↓ 1 callersFunctionalign_face
(image, landmark, output_shape=(112, 112))
src/dataset/test_preprocess.py:12
↓ 1 callersMethodattention
(self, q: torch.Tensor, kv: torch.Tensor)
src/models/condition/refine_motion.py:58
↓ 1 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:
src/dataset/utils.py:23
↓ 1 callersFunctionbuild_model
(args, only_teacher=False, img_size=224)
src/models/dinov2/models/__init__.py:14
↓ 1 callersFunctioncenter_crop
(img_driven, face_bbox, scale=1.0)
src/dataset/test_preprocess.py:28
↓ 1 callersMethodcheck_inputs
(self, image, height, width)
src/pipelines/hunyuan_svd_pipeline.py:212
↓ 1 callersFunctioncrop_face_motion
(image, landmark, motion_transform, bbox, scale=0.45)
src/dataset/test_preprocess.py:116
↓ 1 callersMethoddecode_latents
(self, latents, num_frames, decode_chunk_size=14)
src/pipelines/hunyuan_svd_pipeline.py:185
↓ 1 callersFunctiondrop_path
(x, drop_prob: float = 0.0, training: bool = False)
src/models/dinov2/layers/drop_path.py:14
↓ 1 callersFunctionencode_image_with_id_features
img: B, 3, 224, 224 id_features: B, 1, 512
src/pipelines/hunyuan_svd_pipeline.py:17
↓ 1 callersFunctionexpand
(bbox, ratio, height, width)
src/dataset/test_preprocess.py:57
↓ 1 callersMethodforward
(self, x: Tensor, id_features = None)
src/models/dinov2/layers/block.py:199
↓ 1 callersMethodforward
(self, x: Tensor)
src/models/dinov2/layers/attention.py:56
↓ 1 callersMethodforward
(self, conditioning)
src/models/condition/pose_guider.py:62
↓ 1 callersMethodforward_features_list
(self, x_list, masks_list)
src/models/dinov2/models/vision_transformer.py:263
↓ 1 callersMethodforward_nested
x_list contains a list of tensors to nest together and run
src/models/dinov2/layers/block.py:328
↓ 1 callersMethodget_alpha
(self, image_only_indicator: torch.Tensor, ndims: int)
src/models/condition/unet_3d_blocks.py:146
↓ 1 callersFunctionget_branges_scales
(x, sample_drop_ratio=0.0)
src/models/dinov2/layers/block.py:257
↓ 1 callersFunctionget_down_block
( down_block_type: str, num_layers: int, in_channels: int, out_channels: int, temb_channel
src/models/condition/unet_3d_blocks.py:416
↓ 1 callersFunctionget_dwpose
(image)
src/dataset/test_preprocess.py:132
↓ 1 callersFunctionget_timestep_embedding
This matches the implementation in Denoising Diffusion Probabilistic Models: Create sinusoidal timestep embeddings. Args timesteps (
src/models/condition/unet_3d_blocks.py:40
↓ 1 callersMethodget_timesteps
(self, num_inference_steps, strength, device)
src/pipelines/hunyuan_svd_pipeline.py:267
↓ 1 callersFunctionget_up_block
( up_block_type: str, num_layers: int, in_channels: int, out_channels: int, prev_output_ch
src/models/condition/unet_3d_blocks.py:544
↓ 1 callersMethodinit_weights
(self)
src/models/dinov2/models/vision_transformer.py:201
↓ 1 callersFunctionmain
(cfg, args)
inference.py:82
↓ 1 callersFunctionnamed_apply
(fn: Callable, module: nn.Module, name="", depth_first=True, include_root=False)
src/models/dinov2/models/vision_transformer.py:40
↓ 1 callersFunctionnon_max_suppression_face
Performs Non-Maximum Suppression (NMS) on inference results Returns: detections with shape: nx6 (x1, y1, x2, y2, conf, cls)
src/dataset/utils.py:49
↓ 1 callersFunctionpaste_back_frame
paste the generated cropped frame back to the original image
gradio_app.py:146
↓ 1 callersFunctionpaste_back_frame
paste the generated cropped frame back to the original image original_img: original image numpy array generated_crop: generated 512x512 f
inference.py:49
↓ 1 callersMethodprepare_latents
( self, batch_size, num_frames, num_channels_latents, height,
src/pipelines/hunyuan_svd_pipeline.py:226
↓ 1 callersMethodstep
Predict the sample from the previous timestep by reversing the SDE. This function propagates the diffusion process from the learned m
src/schedulers/scheduling_euler_discrete.py:78
↓ 1 callersFunctionto_square
(bbox_src, bbox_expend, height, width)
src/dataset/test_preprocess.py:69
↓ 1 callersFunctionxywh2xyxy
(x)
src/dataset/utils.py:13
↓ 1 callersFunctionzero_module
(module)
src/models/condition/pose_guider.py:9
Method__call__
r""" The call function to the pipeline for generation. Args: image (`PIL.Image.Image` or `List[PIL.Image.Image]` or `torc
src/pipelines/hunyuan_svd_pipeline.py:296
Method__call__
( self, attn: Attention, hidden_states: torch.Tensor, encoder_hidden_states: O
src/models/condition/attention_processor.py:32
Method__call__
( self, attn: Attention, hidden_states: torch.Tensor, encoder_hidden_states: O
src/models/condition/attention_processor.py:108
Method__call__
( self, attn: Attention, hidden_states: torch.Tensor, encoder_hidden_states: O
src/models/condition/attention_processor.py:225
Method__call__
( self, attn: Attention, hidden_states: torch.Tensor, encoder_hidden_states: O
src/models/condition/attention_processor.py:428
Method__init__
(self, pt_path='checkpoints/yolov5m-face.pt', confThreshold=0.5, nmsThreshold=0.45, device='cuda')
src/dataset/utils.py:123
Method__init__
(self, video_path=None, output_video_path=None, bit_rate='origin', fps=25)
src/dataset/utils.py:188
Method__init__
( self, vae, image_encoder, image_proj, unet, pose_guider,
src/pipelines/hunyuan_svd_pipeline.py:83
Method__init__
( self, num_train_timesteps: int = 1000, beta_start: float = 0.0001, beta_end:
src/schedulers/scheduling_euler_discrete.py:19
Method__init__
(self, drop_prob=None)
src/models/dinov2/layers/drop_path.py:29
Method__init__
(self, in_channels: int, out_channels: int, **kwargs: Any)
src/models/dinov2/layers/block.py:45
Method__init__
(self, image_dim, id_dim, embed_dim, num_heads, dropout=0.1)
src/models/dinov2/layers/block.py:57
Method__init__
( self, fc_in_channels: int, in_channels: int, ch1x1: int, ch3x3red: i
src/models/dinov2/layers/block.py:80
Method__init__
( self, in_dim, out_dim, use_bn=False, nlayers=3, hidden_dim=2
src/models/dinov2/layers/dino_head.py:13
Method__init__
( self, dim: int, init_values: Union[float, Tensor] = 1e-5, inplace: bool = Fa
src/models/dinov2/layers/layer_scale.py:16
Method__init__
( self, dim: int, num_heads: int = 8, qkv_bias: bool = False, proj_bia
src/models/dinov2/layers/attention.py:37
Method__init__
( self, in_features: int, hidden_features: Optional[int] = None, out_features:
src/models/dinov2/layers/mlp.py:17
Method__init__
( self, in_features: int, hidden_features: Optional[int] = None, out_features:
src/models/dinov2/layers/swiglu_ffn.py:55
Method__init__
( self, img_size: Union[int, Tuple[int, int]] = 224, patch_size: Union[int, Tuple[int,
src/models/dinov2/layers/patch_embed.py:37
Method__init__
Args: img_size (int, tuple): input image size patch_size (int, tuple): patch size in_chans (int): number
src/models/dinov2/models/vision_transformer.py:60
Method__init__
(self, in_planes, planes, stride=1, expansion = 1)
src/models/condition/coarse_motion.py:7
next →1–100 of 229, ranked by callers