MCPcopy Create free account
hub / github.com/Francis-Rings/StableAnimator / get_aligned_face

Function get_aligned_face

animation/utils/utils.py:69–78  ·  view source on GitHub ↗
(face_loss_helper, frames, device)

Source from the content-addressed store, hash-verified

67
68
69def get_aligned_face(face_loss_helper, frames, device):
70 print("This is the process of getting aligned faces")
71 print("Please check the number of detected faces")
72 print(frames.shape)
73 print(1/0)
74 face_loss_helper.clean_all()
75 faces = mtcnn.align(frames)
76 transfroms = Compose(
77 [ToTensor(), Normalize([0.5, 0.5, 0.5], [0.5, 0.5, 0.5])])
78 return transfroms(faces).to(device)
79
80
81def save_to_mp4(frames, save_path, fps=7):

Callers 1

faceid_loss_computeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected