Update app.py
Browse files
app.py
CHANGED
@@ -7,17 +7,21 @@ import numpy as np
|
|
7 |
|
8 |
model = YOLO('best (1).pt')
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
def response(image):
|
11 |
print(image)
|
12 |
results = model(image)
|
13 |
text=""
|
14 |
-
for
|
15 |
|
16 |
conf = results.boxes.conf
|
17 |
cls = results.boxes.cls
|
18 |
-
|
19 |
-
im_bgr = r.plot()
|
20 |
-
im_rgb = im_bgr[..., ::-1] # Convert BGR to RGB
|
21 |
text += f"Detected {cls} with confidence {conf} at \n"
|
22 |
|
23 |
# im_rgb = Image.fromarray(im_rgb)
|
|
|
7 |
|
8 |
model = YOLO('best (1).pt')
|
9 |
|
10 |
+
# for i, r in enumerate(results):
|
11 |
+
|
12 |
+
# # Plot results image
|
13 |
+
# im_bgr = r.plot()
|
14 |
+
# im_rgb = im_bgr[..., ::-1] # Convert BGR to RGB
|
15 |
+
|
16 |
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)
|