INNER CODE UNIT · Python
arcface_embeddings
Tencent-Hunyuan/HunyuanPortrait · gradio_app.py:224
arcface_embeddings = arcface_embeddings / np.linalg.norm(arcface_embeddings)
dwpose_images = sample['img_pose']
motion_pose_images = sample['motion_pose_image']
motion_face_images = sample['motion_face_image']
driven_images = sample['driven_image']
# Feature Extraction Loop
pose_cond_tensor_all = []
driven_feat_all = []
uncond_driven_feat_all = []
num_frames_all = 0
driven_video_all = []
batch = cfg.n_sample_frames
print("Extracting Motion Features...")
for idx in range(0, motion_pose_images.shape[0], batch):
driven_video = driven_images[idx:idx+batch].to('cuda')