Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -56,14 +56,18 @@ def yolov8_img_inference(
|
|
56 |
# count 'car' objects in the results
|
57 |
# count_result = results[0].boxes.cls[0].item()
|
58 |
# count_result = results[0].boxes.cls.tolist()
|
|
|
|
|
|
|
|
|
59 |
|
60 |
-
clist= results[0].boxes.cls.tolist()
|
61 |
-
cls = set()
|
62 |
# for cno in clist:
|
63 |
# cls.add(model.names[int(cno)])
|
64 |
|
65 |
# count_result = results.pandas().xyxy[0].value_counts('name')
|
66 |
-
return render,
|
67 |
|
68 |
# results = model.predict(image, imgsz=image_size, return_outputs=True)
|
69 |
# results = model.predict(image)
|
|
|
56 |
# count 'car' objects in the results
|
57 |
# count_result = results[0].boxes.cls[0].item()
|
58 |
# count_result = results[0].boxes.cls.tolist()
|
59 |
+
|
60 |
+
for r in results:
|
61 |
+
for c in r.boxes.cls:
|
62 |
+
count = (names[int(c)])
|
63 |
|
64 |
+
# clist= results[0].boxes.cls.tolist()
|
65 |
+
# cls = set()
|
66 |
# for cno in clist:
|
67 |
# cls.add(model.names[int(cno)])
|
68 |
|
69 |
# count_result = results.pandas().xyxy[0].value_counts('name')
|
70 |
+
return render, count
|
71 |
|
72 |
# results = model.predict(image, imgsz=image_size, return_outputs=True)
|
73 |
# results = model.predict(image)
|