Rasleen commited on
Commit
ecd4291
Β·
verified Β·
1 Parent(s): 15eac66

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -59,9 +59,9 @@ def prod_function(app, prod_path, webcam_img_pil):
59
  # Get coordinates
60
  x1, y1, x2, y2 = [int(i) for i in webcam_face.bbox]
61
  if best_score >= 0.6:
62
- name = os.path.basename(prod_path[best_match_idx]).split('.')[0]
63
  else:
64
- name = "Unknown"
65
  results.append({'bbox': (x1, y1, x2, y2), 'name': name})
66
 
67
 
@@ -101,7 +101,7 @@ with app_tab:
101
  cv2.rectangle(image_bgr, (x1, y1), (x2, y2), color, 2)
102
  cv2.putText(image_bgr, name, (x1, y2 + 20), cv2.FONT_HERSHEY_SIMPLEX, 0.8, color, 2)
103
 
104
- if name != "Unknown":
105
  # recognized = False
106
  # for score, idx in matches:
107
  # if matched_score >= 0.6:
 
59
  # Get coordinates
60
  x1, y1, x2, y2 = [int(i) for i in webcam_face.bbox]
61
  if best_score >= 0.6:
62
+ matched_name = os.path.basename(prod_path[best_match_idx]).split('.')[0]
63
  else:
64
+ matched_name = "Unknown"
65
  results.append({'bbox': (x1, y1, x2, y2), 'name': name})
66
 
67
 
 
101
  cv2.rectangle(image_bgr, (x1, y1), (x2, y2), color, 2)
102
  cv2.putText(image_bgr, name, (x1, y2 + 20), cv2.FONT_HERSHEY_SIMPLEX, 0.8, color, 2)
103
 
104
+ if matched_name != "Unknown":
105
  # recognized = False
106
  # for score, idx in matches:
107
  # if matched_score >= 0.6: