N3tron commited on
Commit
7a45d03
·
verified ·
1 Parent(s): 4de5d4d

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -45,6 +45,9 @@ def verify(img1, img2, model_name, backend, metric):
45
  img1p = cv2.imread(temp_img1_path)
46
  img2p = cv2.imread(temp_img2_path)
47
 
 
 
 
48
  face_detect = mediapipe.solutions.face_detection
49
  face_detector = face_detect.FaceDetection(min_detection_confidence=0.6)
50
 
@@ -53,7 +56,7 @@ def verify(img1, img2, model_name, backend, metric):
53
 
54
  result1 = face_detector.process(img1p)
55
  result2 = face_detector.process(img2p)
56
- if result2.detections is not None:
57
  for face in result1.detections:
58
  if face.score[0] > 0.80:
59
  bounding_box = face.location_data.relative_bounding_box
 
45
  img1p = cv2.imread(temp_img1_path)
46
  img2p = cv2.imread(temp_img2_path)
47
 
48
+ img1p = cv2.cvtColor(img1p, cv2.COLOR_BGR2RGB)
49
+ img2p = cv2.cvtColor(img2p, cv2.COLOR_BGR2RGB)
50
+
51
  face_detect = mediapipe.solutions.face_detection
52
  face_detector = face_detect.FaceDetection(min_detection_confidence=0.6)
53
 
 
56
 
57
  result1 = face_detector.process(img1p)
58
  result2 = face_detector.process(img2p)
59
+ if result1.detections is not None:
60
  for face in result1.detections:
61
  if face.score[0] > 0.80:
62
  bounding_box = face.location_data.relative_bounding_box