(self, gpu_id=None, alignment_model_path="", det_model_path="")
| 10 | |
| 11 | class 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 |
nothing calls this directly
no test coverage detected