MCPcopy Create free account

hub / github.com/Tencent/MimicMotion / functions

Functions75 in github.com/Tencent/MimicMotion

↓ 4 callersMethodfrom_pretrained
load pretrained pose-net weights
mimicmotion/modules/pose_net.py:68
↓ 3 callersFunctioncreate_pipeline
create mimicmotion pipeline and load pretrained weight Args: infer_config (str): device (str or torch.device): "cpu" or "cuda:{d
mimicmotion/utils/loader.py:35
↓ 2 callersFunction_get_3rd_point
To calculate the affine matrix, three pairs of points are required. This function is used to get the 3rd point, given 2D points a & b. The 3r
mimicmotion/dwpose/onnxpose.py:182
↓ 2 callersFunctionalpha_blend_color
blend color according to point conf
mimicmotion/dwpose/util.py:9
↓ 2 callersFunctiondraw_pose
vis dwpose outputs Args: pose (List): DWposeDetector outputs in dwpose_detector.py H (int): height W (int): width
mimicmotion/dwpose/util.py:100
↓ 2 callersFunctionget_image_pose
process image pose Args: ref_image (np.ndarray): reference image pixel value Returns: np.ndarray: pose visual image in RGB-m
mimicmotion/dwpose/preprocess.py:61
↓ 2 callersFunctionget_video_pose
preprocess ref image pose and video pose Args: video_path (str): video pose path ref_image (np.ndarray): reference image
mimicmotion/dwpose/preprocess.py:9
↓ 2 callersMethodpreprocess
(self, video_path, image_path, resolution=576, sample_stride=2)
predict.py:288
↓ 2 callersFunctionsave_to_mp4
(frames, save_path, fps=7)
mimicmotion/utils/utils.py:8
↓ 1 callersMethod__init__
( self, num_attention_heads: int = 16, attention_head_dim: int = 88,
mimicmotion/modules/attention.py:57
↓ 1 callersFunction_append_dims
Appends dimensions to the end of a tensor until it has target_dims dimensions.
mimicmotion/pipelines/pipeline_mimicmotion.py:25
↓ 1 callersMethod_encode_image
( self, image: PipelineImageInput, device: Union[str, torch.device], num_vi
mimicmotion/pipelines/pipeline_mimicmotion.py:117
↓ 1 callersMethod_encode_vae_image
( self, image: torch.Tensor, device: Union[str, torch.device], num_videos_per_
mimicmotion/pipelines/pipeline_mimicmotion.py:164
↓ 1 callersFunction_fix_aspect_ratio
Extend the scale to match the given aspect ratio. Args: scale (np.ndarray): The image scale (w, h) in shape (2, ) aspect_ratio (f
mimicmotion/dwpose/onnxpose.py:149
↓ 1 callersMethod_get_add_time_ids
( self, fps: int, motion_bucket_id: int, noise_aug_strength: float, dt
mimicmotion/pipelines/pipeline_mimicmotion.py:187
↓ 1 callersMethod_initialize_weights
Initialize weights with He. initialization and zero out the biases
mimicmotion/modules/pose_net.py:46
↓ 1 callersFunction_rotate_point
Rotate a point by an angle. Args: pt (np.ndarray): 2D point coordinates (x, y) in shape (2, ) angle_rad (float): rotation angle i
mimicmotion/dwpose/onnxpose.py:167
↓ 1 callersFunctionbbox_xyxy2cs
Transform the bbox format from (x,y,w,h) into (center, scale) Args: bbox (ndarray): Bounding box(es) in shape (4,) or (n, 4), formatted
mimicmotion/dwpose/onnxpose.py:115
↓ 1 callersMethodcheck_inputs
(self, image, height, width)
mimicmotion/pipelines/pipeline_mimicmotion.py:250
↓ 1 callersFunctiondecode
Modulate simcc distribution with Gaussian. Args: simcc_x (np.ndarray[K, Wx]): model predicted simcc in x. simcc_y (np.ndarray[K,
mimicmotion/dwpose/onnxpose.py:333
↓ 1 callersMethoddecode_latents
( self, latents: torch.Tensor, num_frames: int, decode_chunk_size: int = 8)
mimicmotion/pipelines/pipeline_mimicmotion.py:217
↓ 1 callersFunctiondemo_postprocess
(outputs, img_size, p6=False)
mimicmotion/dwpose/onnxdet.py:76
↓ 1 callersFunctiondownload_weights
(url: str, dest: str)
predict.py:27
↓ 1 callersFunctiondraw_bodypose
(canvas, candidate, subset, score)
mimicmotion/dwpose/util.py:14
↓ 1 callersFunctiondraw_facepose
(canvas, all_lmks, all_scores)
mimicmotion/dwpose/util.py:88
↓ 1 callersFunctiondraw_handpose
(canvas, all_hand_peaks, all_hand_scores)
mimicmotion/dwpose/util.py:59
↓ 1 callersFunctionget_simcc_maximum
Get maximum response location and value from simcc representations. Note: instance number: N num_keypoints: K heatmap hei
mimicmotion/dwpose/onnxpose.py:288
↓ 1 callersFunctionget_warp_matrix
Calculate the affine transformation matrix that can warp the bbox area in the input image to the output size. Args: center (np.ndarra
mimicmotion/dwpose/onnxpose.py:201
↓ 1 callersFunctioninference
Inference RTMPose model. Args: sess (ort.InferenceSession): ONNXRuntime session. img (np.ndarray): Input image in shape. Ret
mimicmotion/dwpose/onnxpose.py:52
↓ 1 callersFunctioninference_detector
run human detect
mimicmotion/dwpose/onnxdet.py:116
↓ 1 callersFunctioninference_pose
run pose detect Args: session (ort.InferenceSession): ONNXRuntime session. out_bbox (np.ndarray): bbox list oriImg (np.n
mimicmotion/dwpose/onnxpose.py:353
↓ 1 callersFunctionmain
(args)
inference.py:86
↓ 1 callersFunctionmulticlass_nms
Multiclass NMS implemented in Numpy. Class-aware version. Args: boxes (np.ndarray): shape=(N,4); N is number of boxes scores (np.
mimicmotion/dwpose/onnxdet.py:43
↓ 1 callersFunctionnms
Single class NMS implemented in Numpy. Args: boxes (np.ndarray): shape=(N,4); N is number of boxes scores (np.ndarray): the score
mimicmotion/dwpose/onnxdet.py:5
↓ 1 callersFunctionpatch_geglu_inplace
Patch GEGLU with inplace multiplication to save GPU memory.
mimicmotion/utils/geglu_patch.py:4
↓ 1 callersFunctionpostprocess
Postprocess for RTMPose model output. Args: outputs (np.ndarray): Output of RTMPose model. model_input_size (tuple): RTMPose mode
mimicmotion/dwpose/onnxpose.py:80
↓ 1 callersMethodprepare_extra_step_kwargs
(self, generator, eta)
mimicmotion/pipelines/pipeline_mimicmotion.py:315
↓ 1 callersMethodprepare_latents
( self, batch_size: int, num_frames: int, num_channels_latents: int, h
mimicmotion/pipelines/pipeline_mimicmotion.py:264
↓ 1 callersFunctionpreprocess
preprocess ref image pose and video pose Args: video_path (str): input video pose path image_path (str): reference image path
inference.py:31
↓ 1 callersFunctionpreprocess
(img, input_size, swap=(2, 0, 1))
mimicmotion/dwpose/onnxdet.py:98
↓ 1 callersFunctionpreprocess
Do preprocessing for RTMPose model inference. Args: img (np.ndarray): Input image in shape. input_size (tuple): Input image size
mimicmotion/dwpose/onnxpose.py:7
↓ 1 callersMethodrelease_memory
(self)
mimicmotion/dwpose/dwpose_detector.py:25
↓ 1 callersFunctionrun_pipeline
(pipeline: MimicMotionPipeline, image_pixels, pose_pixels, device, task_config)
inference.py:64
↓ 1 callersMethodrun_pipeline
( self, image_pixels, pose_pixels, num_frames, frames_overlap,
predict.py:321
↓ 1 callersMethodset_attn_processor
r""" Sets the attention processor to use to compute attention. Parameters: processor (`dict` of `AttentionProcessor` or o
mimicmotion/modules/unet.py:282
↓ 1 callersFunctionset_logger
(log_file=None, log_level=logging.INFO)
inference.py:113
↓ 1 callersFunctiontensor2vid
(video: torch.Tensor, processor: "VaeImageProcessor", output_type: str = "np")
mimicmotion/pipelines/pipeline_mimicmotion.py:34
↓ 1 callersFunctiontop_down_affine
Get the bbox image as the model input by affine transform. Args: input_size (dict): The input size of the model. bbox_scale (dict
mimicmotion/dwpose/onnxpose.py:255
Method__call__
r""" The call function to the pipeline for generation. Args: image (`PIL.Image.Image` or `List[PIL.Image.Image]` or `torc
mimicmotion/pipelines/pipeline_mimicmotion.py:333
Method__call__
call to process dwpose-detect Args: oriImg (np.ndarray): detected image
mimicmotion/dwpose/wholebody.py:22
Method__call__
(self, oriImg)
mimicmotion/dwpose/dwpose_detector.py:30
Method__init__
( self, sample_size: Optional[int] = None, in_channels: int = 8,
mimicmotion/modules/unet.py:72
Method__init__
( self, num_attention_heads: int = 16, attention_head_dim: int = 88,
mimicmotion/modules/attention.py:203
Method__init__
(self, noise_latent_channels=320, *args, **kwargs)
mimicmotion/modules/pose_net.py:13
Method__init__
construnct base model components and load pretrained svd model except pose-net Args: base_model_path (str): pretrained svd model p
mimicmotion/utils/loader.py:16
Method__init__
( self, vae: AutoencoderKLTemporalDecoder, image_encoder: CLIPVisionModelWithProjectio
mimicmotion/pipelines/pipeline_mimicmotion.py:95
Method__init__
(self, model_det, model_pose, device="cpu")
mimicmotion/dwpose/wholebody.py:11
Method__init__
(self, model_det, model_pose, device='cpu')
mimicmotion/dwpose/dwpose_detector.py:22
Method_set_gradient_checkpointing
(self, module, value=False)
mimicmotion/modules/unet.py:330
Methodattn_processors
r""" Returns: `dict` of attention processors: A dictionary containing all attention processors used in the model with
mimicmotion/modules/unet.py:255
Methoddo_classifier_free_guidance
(self)
mimicmotion/pipelines/pipeline_mimicmotion.py:306
Methodenable_forward_chunking
Sets the attention processor to use [feed forward chunking](https://huggingface.co/blog/reformer#2-chunked-feed-forward-layers).
mimicmotion/modules/unet.py:335
Methodfn_recursive_add_processors
( name: str, module: torch.nn.Module, processors: Dict[str, At
mimicmotion/modules/unet.py:264
Methodfn_recursive_attn_processor
(name: str, module: torch.nn.Module, processor)
mimicmotion/modules/unet.py:303
Methodfn_recursive_feed_forward
(module: torch.nn.Module, chunk_size: int, dim: int)
mimicmotion/modules/unet.py:354
Functionforward
(self, hidden_states)
mimicmotion/utils/geglu_patch.py:6
Methodforward
r""" The [`UNetSpatioTemporalConditionModel`] forward method. Args: sample (`torch.FloatTensor`): The noi
mimicmotion/modules/unet.py:364
Methodforward
The [`TransformerTemporal`] forward method. Args: hidden_states (`torch.LongTensor` of shape `(batch size, num latent pi
mimicmotion/modules/attention.py:107
Methodforward
Args: hidden_states (`torch.FloatTensor` of shape `(batch size, channel, height, width)`): Input hidden_states.
mimicmotion/modules/attention.py:263
Methodforward
(self, x)
mimicmotion/modules/pose_net.py:59
Methodguidance_scale
(self)
mimicmotion/pipelines/pipeline_mimicmotion.py:299
Methodnum_timesteps
(self)
mimicmotion/pipelines/pipeline_mimicmotion.py:312
Methodpredict
Run a single prediction on the model
predict.py:89
Methodset_default_attn_processor
Disables custom attention processors and sets the default attention implementation.
mimicmotion/modules/unet.py:316
Methodsetup
Load the model into memory to make running multiple predictions efficient
predict.py:47