Update app.py
Browse files
app.py
CHANGED
@@ -17,12 +17,13 @@ def response(image):
|
|
17 |
print(image)
|
18 |
results = model(image)
|
19 |
text=""
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
cls =
|
24 |
-
|
25 |
-
|
|
|
26 |
|
27 |
# im_rgb = Image.fromarray(im_rgb)
|
28 |
|
|
|
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)
|
29 |
|