Update app.py
Browse files
app.py
CHANGED
@@ -16,13 +16,13 @@ model = YOLO('best (1).pt')
|
|
16 |
def response(image):
|
17 |
print(image)
|
18 |
results = model(image)
|
19 |
-
text=""
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
|
27 |
|
28 |
# im_rgb = Image.fromarray(im_rgb)
|
|
|
16 |
def response(image):
|
17 |
print(image)
|
18 |
results = model(image)
|
19 |
+
text=""
|
20 |
+
for r in results:
|
21 |
+
conf = np.array(r.boxes.conf)
|
22 |
+
cls = np.array(r.boxes.cls)
|
23 |
+
cls = cls.astype(int)
|
24 |
+
for con, cl in zip(conf,cls):
|
25 |
+
text += (f"Detected {name[cl]} with confidence {con} at \n")
|
26 |
|
27 |
|
28 |
# im_rgb = Image.fromarray(im_rgb)
|