MCPcopy Create free account
hub / github.com/Francis-Rings/FlashPortrait / __init__

Method __init__

wan/models/face_align.py:12–25  ·  view source on GitHub ↗
(self, gpu_id=None, alignment_model_path="", det_model_path="")

Source from the content-addressed store, hash-verified

10
11class FaceAlignment(object):
12 def __init__(self, gpu_id=None, alignment_model_path="", det_model_path=""):
13 expand_ratio = 0.15
14
15 self.face_alignment_net_222 = create_onnx_session(
16 alignment_model_path, gpu_id=gpu_id
17 )
18 self.onnx_input_name_222 = self.face_alignment_net_222.get_inputs()[0].name
19 self.onnx_output_name_222 = [
20 output.name for output in self.face_alignment_net_222.get_outputs()
21 ]
22 self.face_image_size = 128
23
24 self.face_detector = FaceDet(det_model_path, gpu_id=gpu_id)
25 self.expand_ratio = expand_ratio
26
27 def onnx_infer(self, input_uint8):
28 assert input_uint8.shape[0] == input_uint8.shape[1] == self.face_image_size

Callers

nothing calls this directly

Calls 2

create_onnx_sessionFunction · 0.85
FaceDetClass · 0.85

Tested by

no test coverage detected