sabaridsnfuji
commited on
Commit
•
49e4f98
1
Parent(s):
7be5544
Update app.py
Browse files
app.py
CHANGED
@@ -54,6 +54,7 @@ def predict_image(image):
|
|
54 |
for result in results:
|
55 |
boxes = result[:4]
|
56 |
prob = result[4]
|
|
|
57 |
classes = int(result[5])
|
58 |
boxes = boxes/img_size
|
59 |
|
@@ -66,7 +67,7 @@ def predict_image(image):
|
|
66 |
|
67 |
if prob > 0.2:
|
68 |
cv2.rectangle(temp_image, (x1, y1), (x2, y2), (0, 0, 255), 2)
|
69 |
-
label_text = f"{classes} {
|
70 |
cv2.putText(temp_image, label_text, (x1, y1), 0, 0.5, (0, 255, 0), 2)
|
71 |
|
72 |
# Store prediction info in a JSON-compatible format
|
|
|
54 |
for result in results:
|
55 |
boxes = result[:4]
|
56 |
prob = result[4]
|
57 |
+
prob0 = round(prob, 2)
|
58 |
classes = int(result[5])
|
59 |
boxes = boxes/img_size
|
60 |
|
|
|
67 |
|
68 |
if prob > 0.2:
|
69 |
cv2.rectangle(temp_image, (x1, y1), (x2, y2), (0, 0, 255), 2)
|
70 |
+
label_text = f"{classes} {prob0}"
|
71 |
cv2.putText(temp_image, label_text, (x1, y1), 0, 0.5, (0, 255, 0), 2)
|
72 |
|
73 |
# Store prediction info in a JSON-compatible format
|