Asarkar07 commited on
Commit
ed83796
·
verified ·
1 Parent(s): 075ef94

Update method.py

Browse files
Files changed (1) hide show
  1. method.py +11 -2
method.py CHANGED
@@ -76,6 +76,15 @@ def search_query(text, index):
76
  print('in search query', D, I)
77
  return I[0][0]
78
 
79
- def face_crop(image):
80
- img = DeepFace.extract_faces(image, detector_backend = detectors[4])
 
 
 
 
 
 
 
 
 
81
  return img
 
76
  print('in search query', D, I)
77
  return I[0][0]
78
 
79
+ # def face_crop(image):
80
+ # img = DeepFace.extract_faces(image, detector_backend = detectors[4])
81
+ # return img
82
+
83
+ def face_crop(image_pil):
84
+ # Convert PIL.Image to OpenCV BGR format
85
+ img_rgb = np.array(image_pil)
86
+ img_bgr = cv2.cvtColor(img_rgb, cv2.COLOR_RGB2BGR)
87
+
88
+ # Now pass to DeepFace
89
+ img = DeepFace.extract_faces(img_bgr, detector_backend=detectors[4])
90
  return img