Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -95,19 +95,19 @@ with app_tab:
|
|
95 |
else:
|
96 |
# st.write("Similarity Scores:", prediction_scores)
|
97 |
for match in matches:
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
|
112 |
# Send attendance via POST
|
113 |
url = "https://nielit-attendance.glitch.me/adds"
|
|
|
95 |
else:
|
96 |
# st.write("Similarity Scores:", prediction_scores)
|
97 |
for match in matches:
|
98 |
+
x1, y1, x2, y2 = match['bbox']
|
99 |
+
name = match['name']
|
100 |
+
color = (0, 255, 0) if name != "Unknown" else (0, 0, 255)
|
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:
|
108 |
+
# matched_name = os.path.basename(image_paths[match_idx]).split('.')[0]
|
109 |
+
# st.success(f"β
Welcome: {matched_name}")
|
110 |
+
# recognizes=True
|
111 |
|
112 |
# Send attendance via POST
|
113 |
url = "https://nielit-attendance.glitch.me/adds"
|