Skip to content

Commit

Permalink
Merge pull request #133 from QuantumLiu/patch-1
Browse files Browse the repository at this point in the history
Fix face enhancement bug
  • Loading branch information
cszn authored Apr 24, 2022
2 parents f4573f3 + 7f19443 commit 2edf3f7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main_test_face_enhancement.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ def process(self, img):
img: uint8 RGB image, (W, H, 3)
img, orig_faces, enhanced_faces: uint8 RGB image / cropped face images
'''
img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
facebs, landms = self.facedetector.detect(img)
img_bgr = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
facebs, landms = self.facedetector.detect(img_bgr)

orig_faces, enhanced_faces = [], []
height, width = img.shape[:2]
Expand All @@ -108,7 +108,7 @@ def process(self, img):

facial5points = np.reshape(facial5points, (2, 5))

img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
#img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
of, tfm_inv = warp_and_crop_face(img, facial5points, reference_pts=self.reference_5pts, crop_size=(self.size, self.size))
# Enhance the face image!

Expand Down

0 comments on commit 2edf3f7

Please sign in to comment.