Dricz commited on
Commit
1425272
·
verified ·
1 Parent(s): fd0e675

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -17,12 +17,13 @@ def response(image):
17
  print(image)
18
  results = model(image)
19
  text=""
20
- for r in results:
21
-
22
- conf = results.boxes.conf
23
- cls = results.boxes.cls
24
-
25
- text += f"Detected {cls} with confidence {conf} at \n"
 
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