(self)
| 345 | return x |
| 346 | |
| 347 | def GetMaskImg(self): |
| 348 | if self.mask_img is None: |
| 349 | path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "./LivePortrait/utils/resources/mask_template.png") |
| 350 | self.mask_img = cv2.imread(path, cv2.IMREAD_COLOR) |
| 351 | return self.mask_img |
| 352 | |
| 353 | def crop_face(self, img_rgb, crop_factor): |
| 354 | crop_region = self.detect_face(img_rgb, crop_factor) |