Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/cangcz/AnchorCrafter
/ functions
Functions
139 in github.com/cangcz/AnchorCrafter
⨍
Functions
139
◇
Types & classes
25
↓ 6 callers
Function
process_frames
Process multiple frames. Args: video: VideoReader object frame_ids: List of frame indices to process
anchor_dataset.py:73
↓ 4 callers
Function
_resize_with_antialiasing
(input, size, interpolation="bicubic", align_corners=True)
train.py:129
↓ 4 callers
Function
center_crop
Center crop and resize image to maintain aspect ratio. Args: image: Input image (PIL Image or numpy array) as
anchor_dataset.py:48
↓ 3 callers
Method
__init__
( self, hidden_size=None, cross_attention_dim=None, )
anchor_crafter/modules/attention_processor.py:23
↓ 3 callers
Function
get_image_pose
process image pose Args: ref_image (np.ndarray): reference image pixel value Returns: np.ndarray: pose visual image in RGB-m
anchor_crafter/dwpose/preprocess.py:67
↓ 3 callers
Function
make_layers
(block, no_relu_layers)
evalution/preprocess/src/model.py:7
↓ 3 callers
Method
set_attn_processor
r""" Sets the attention processor to use to compute attention. Parameters: processor (`dict` of `AttentionProcessor` or o
anchor_crafter/modules/unet.py:282
↓ 3 callers
Function
tensor_to_vae_latent
(t, vae)
train.py:272
↓ 2 callers
Method
_encode_vae_image
( self, image: torch.Tensor, device: Union[str, torch.device],
anchor_crafter/pipelines/pipeline.py:205
↓ 2 callers
Function
_filter2d
(input, kernel)
train.py:182
↓ 2 callers
Function
_gaussian
(window_size: int, sigma)
train.py:207
↓ 2 callers
Function
_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
anchor_crafter/dwpose/onnxpose.py:182
↓ 2 callers
Method
_memory_efficient_attention_xformers
(self, query, key, value, attention_mask)
anchor_crafter/modules/attention_processor.py:222
↓ 2 callers
Function
alpha_blend_color
blend color according to point conf
anchor_crafter/dwpose/util.py:9
↓ 2 callers
Function
draw_pose
vis dwpose outputs Args: pose (List): DWposeDetector outputs in dwpose_detector.py H (int): height W (int): width
anchor_crafter/dwpose/util.py:100
↓ 2 callers
Function
draw_text
Add watermark text to the image. Args: image: Input image as numpy array (H,W,C) Returns:
anchor_dataset.py:98
↓ 2 callers
Function
process_video_reference
Reads a video using decord, resizes frames, limits the frame count, and aligns frames. Args: video_path (str): Path to the video
inference.py:33
↓ 2 callers
Function
rand_log_normal
Draws samples from an lognormal distribution.
train.py:121
↓ 2 callers
Function
to_input
(pil_rgb_image)
evalution/face_cos.py:26
↓ 1 callers
Method
__init__
( self, num_attention_heads: int = 16, attention_head_dim: int = 88,
anchor_crafter/modules/attention.py:57
↓ 1 callers
Method
__init__
(self)
evalution/preprocess/src/model.py:25
↓ 1 callers
Function
_append_dims
Appends dimensions to the end of a tensor until it has target_dims dimensions.
anchor_crafter/pipelines/pipeline.py:34
↓ 1 callers
Function
_compute_padding
Compute padding tuple.
train.py:159
↓ 1 callers
Function
_encode_image
( image: Image, obj_pixels: Image, device: Union[str, torch.device], )
train.py:847
↓ 1 callers
Method
_encode_image
( self, image: PipelineImageInput, obj_pixels: PipelineImageInput,
anchor_crafter/pipelines/pipeline.py:136
↓ 1 callers
Function
_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
anchor_crafter/dwpose/onnxpose.py:149
↓ 1 callers
Function
_gaussian_blur2d
(input, kernel_size, sigma)
train.py:224
↓ 1 callers
Function
_get_add_time_ids
( fps, motion_bucket_id, noise_aug_strength, dtype,
train.py:908
↓ 1 callers
Method
_get_add_time_ids
( self, fps: int, motion_bucket_id: int, noise_aug_strength: f
anchor_crafter/pipelines/pipeline.py:234
↓ 1 callers
Method
_initialize_weights
Initialize weights with He. initialization and zero out the biases
anchor_crafter/modules/pose_hand_net.py:59
↓ 1 callers
Method
_initialize_weights
Initialize weights with He. initialization and zero out the biases
anchor_crafter/modules/track_net.py:59
↓ 1 callers
Method
_load_base_samples
(self, folder, type)
anchor_dataset.py:265
↓ 1 callers
Method
_load_noobj_samples
(self, folder, type)
anchor_dataset.py:283
↓ 1 callers
Function
_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
anchor_crafter/dwpose/onnxpose.py:167
↓ 1 callers
Function
align_pic
Aligns the input image using scaling and bias parameters. If the input is in channel-first format (C, H, W), it will be converted to
anchor_crafter/dwpose/preprocess.py:82
↓ 1 callers
Function
align_track_video
Aligns all frames of the input video. Args: video (np.ndarray): Video tensor with shape (F, C, H, W). p_scale (tuple): S
anchor_crafter/dwpose/preprocess.py:134
↓ 1 callers
Function
bbox_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
anchor_crafter/dwpose/onnxpose.py:115
↓ 1 callers
Function
calculate_average_similarity
(model, image_paths, folder_paths)
evalution/face_cos.py:45
↓ 1 callers
Function
calculate_pixel_similarity_ratio
Calculate pixel-wise similarity ratio between reference and generated videos. Args: reference_folder: Path to directory containing re
evalution/obj_iou.py:5
↓ 1 callers
Method
check_inputs
(self, image, height, width)
anchor_crafter/pipelines/pipeline.py:297
↓ 1 callers
Function
create_pipeline
create mimicmotion pipeline and load pretrained weight Args: infer_config (str): device (str or torch.device): "cpu" or "cuda:{d
anchor_crafter/utils/loader.py:57
↓ 1 callers
Function
decode
Modulate simcc distribution with Gaussian. Args: simcc_x (np.ndarray[K, Wx]): model predicted simcc in x. simcc_y (np.ndarray[K,
anchor_crafter/dwpose/onnxpose.py:333
↓ 1 callers
Method
decode_latents
( self, latents: torch.Tensor, num_frames: int, decode_chunk_s
anchor_crafter/pipelines/pipeline.py:264
↓ 1 callers
Function
demo_postprocess
(outputs, img_size, p6=False)
anchor_crafter/dwpose/onnxdet.py:76
↓ 1 callers
Function
draw_bodypose
(canvas, candidate, subset, score)
anchor_crafter/dwpose/util.py:14
↓ 1 callers
Function
draw_facepose
(canvas, all_lmks, all_scores)
anchor_crafter/dwpose/util.py:88
↓ 1 callers
Function
draw_handpose
(canvas, all_hand_peaks, all_hand_scores)
anchor_crafter/dwpose/util.py:59
↓ 1 callers
Function
eval
(generated_images_folder, reference_images_folder, vid, model, processor, device)
evalution/obj_clip.py:10
↓ 1 callers
Function
get_aligned_rgb_img_or_black
(path)
evalution/face_cos.py:34
↓ 1 callers
Function
get_simcc_maximum
Get maximum response location and value from simcc representations. Note: instance number: N num_keypoints: K heatmap hei
anchor_crafter/dwpose/onnxpose.py:288
↓ 1 callers
Function
get_video_pose
preprocess ref image pose and video pose Args: video_path (str): video pose path ref_image (np.ndarray): reference image
anchor_crafter/dwpose/preprocess.py:9
↓ 1 callers
Function
get_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
anchor_crafter/dwpose/onnxpose.py:201
↓ 1 callers
Function
inference
Inference RTMPose model. Args: sess (ort.InferenceSession): ONNXRuntime session. img (np.ndarray): Input image in shape. Ret
anchor_crafter/dwpose/onnxpose.py:52
↓ 1 callers
Function
inference_detector
run human detect
anchor_crafter/dwpose/onnxdet.py:116
↓ 1 callers
Function
inference_pose
run pose detect Args: session (ort.InferenceSession): ONNXRuntime session. out_bbox (np.ndarray): bbox list oriImg (np.n
anchor_crafter/dwpose/onnxpose.py:353
↓ 1 callers
Function
load_pretrained_model
(architecture='ir_50')
evalution/face_cos.py:16
↓ 1 callers
Function
main
()
train.py:557
↓ 1 callers
Function
main
(args)
inference.py:268
↓ 1 callers
Function
multiclass_nms
Multiclass NMS implemented in Numpy. Class-aware version. Args: boxes (np.ndarray): shape=(N,4); N is number of boxes scores (np.
anchor_crafter/dwpose/onnxdet.py:43
↓ 1 callers
Function
nms
Single class NMS implemented in Numpy. Args: boxes (np.ndarray): shape=(N,4); N is number of boxes scores (np.ndarray): the score
anchor_crafter/dwpose/onnxdet.py:5
↓ 1 callers
Function
parse_args
()
train.py:282
↓ 1 callers
Function
patch_geglu_inplace
Patch GEGLU with inplace multiplication to save GPU memory.
anchor_crafter/utils/geglu_patch.py:4
↓ 1 callers
Function
postprocess
Postprocess for RTMPose model output. Args: outputs (np.ndarray): Output of RTMPose model. model_input_size (tuple): RTMPose mode
anchor_crafter/dwpose/onnxpose.py:80
↓ 1 callers
Method
prepare_extra_step_kwargs
(self, generator, eta)
anchor_crafter/pipelines/pipeline.py:362
↓ 1 callers
Method
prepare_latents
( self, batch_size: int, num_frames: int, num_channels_noise_l
anchor_crafter/pipelines/pipeline.py:311
↓ 1 callers
Function
preprocess
Preprocess input data for training phase. Args: video_path: Path to the input video pose_path: Path to the pose video
anchor_dataset.py:26
↓ 1 callers
Function
preprocess
Preprocess the reference image pose and video pose, and extract additional references for object appearance, object trajectory, and hand vide
inference.py:72
↓ 1 callers
Function
preprocess
(img, input_size, swap=(2, 0, 1))
anchor_crafter/dwpose/onnxdet.py:98
↓ 1 callers
Function
preprocess
Do preprocessing for RTMPose model inference. Args: img (np.ndarray): Input image in shape. input_size (tuple): Input image size
anchor_crafter/dwpose/onnxpose.py:7
↓ 1 callers
Function
process_image
(images)
evalution/preprocess/dwpose_hand.py:13
↓ 1 callers
Function
process_single_frame
Process single frame from video. Args: video: VideoReader object frame_id: Frame index to process
anchor_dataset.py:130
↓ 1 callers
Function
run_pipeline
Run the anchor crafter pipeline to synthesize video frames based on multiple inputs. Args: pipeline (AnchorCrafterPipeline): The pipe
inference.py:196
↓ 1 callers
Function
save_to_mp4
(frames, save_path, fps=7)
anchor_crafter/utils/utils.py:9
↓ 1 callers
Function
tensor2vid
(video: torch.Tensor, processor: "VaeImageProcessor", output_type: str = "np")
anchor_crafter/pipelines/pipeline.py:43
↓ 1 callers
Function
top_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
anchor_crafter/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
anchor_crafter/pipelines/pipeline.py:380
Method
__call__
call to process dwpose-detect Args: oriImg (np.ndarray): detected image
anchor_crafter/dwpose/wholebody.py:22
Method
__call__
(self, oriImg)
anchor_crafter/dwpose/dwpose_detector.py:33
Method
__call__
(self, oriImg)
evalution/preprocess/src/hand.py:24
Method
__call__
(self, oriImg)
evalution/preprocess/src/body.py:23
Method
__getitem__
(self, idx)
anchor_dataset.py:302
Method
__init__
(self, unet, pose_net, track_net, obj_proj_net, obj_attn_net)
train.py:56
Method
__init__
(self, base_folder: str, noobj_folder: str, resolution=576, sample_frames=16, sample_stride=2
anchor_dataset.py:249
Method
__init__
(self)
anchor_crafter/modules/attention_processor.py:15
Method
__init__
(self, hidden_size, cross_attention_dim=None, scale=1.0, num_tokens=4)
anchor_crafter/modules/attention_processor.py:105
Method
__init__
( self, hidden_size=None, cross_attention_dim=None, )
anchor_crafter/modules/attention_processor.py:236
Method
__init__
(self, hidden_size, cross_attention_dim=None, scale=1.0, num_tokens=4)
anchor_crafter/modules/attention_processor.py:333
Method
__init__
( self, sample_size: Optional[int] = None, in_channels: int = 8,
anchor_crafter/modules/unet.py:72
Method
__init__
(self, noise_latent_channels=320, *args, **kwargs)
anchor_crafter/modules/pose_hand_net.py:25
Method
__init__
(self, noise_latent_channels=320, *args, **kwargs)
anchor_crafter/modules/track_net.py:25
Method
__init__
( self, num_attention_heads: int = 16, attention_head_dim: int = 88,
anchor_crafter/modules/attention.py:203
Method
__init__
(self, cross_attention_dim=1024, clip_embeddings_dim=3072, clip_extra_context_tokens=4, inner
anchor_crafter/modules/obj_proj_net.py:9
Method
__init__
(self, inner_dim=1024, num_heads=32, out_dim=1024, emb_size=1370)
anchor_crafter/modules/obj_attn_net.py:10
Method
__init__
construnct base model components and load pretrained svd model except pose-net Args: base_model_path (str): pretrained svd model p
anchor_crafter/utils/loader.py:29
Method
__init__
( self, vae: AutoencoderKLTemporalDecoder, image_encoder: CLIPVisionModelW
anchor_crafter/pipelines/pipeline.py:104
Method
__init__
(self, model_det, model_pose, device="cpu")
anchor_crafter/dwpose/wholebody.py:12
Method
__init__
(self, model_det, model_pose, device='cpu')
anchor_crafter/dwpose/dwpose_detector.py:23
Method
__init__
(self, model_path)
evalution/preprocess/src/hand.py:16
Method
__init__
(self, model_path)
evalution/preprocess/src/body.py:15
Method
__init__
(self)
evalution/preprocess/src/model.py:144
next →
1–100 of 139, ranked by callers