linhcuem commited on
Commit
74e15c3
1 Parent(s): 2fb56ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -56,13 +56,15 @@ 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
- clist= results[0].boxes.cls
60
- cls = set()
61
- for cno in clist:
62
- cls.add(model.names[int(cno)]).count()
63
-
 
 
64
  # count_result = results.pandas().xyxy[0].value_counts('name')
65
- return render, cls
66
 
67
  # results = model.predict(image, imgsz=image_size, return_outputs=True)
68
  # 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
+ # clist= results[0].boxes.cls
60
+ # cls = set()
61
+ # for cno in clist:
62
+ # cls.add(model.names[int(cno)])
63
+ for r in results:
64
+ for c in r.boxes.cls:
65
+ count = names[int(c)]
66
  # count_result = results.pandas().xyxy[0].value_counts('name')
67
+ return render, count
68
 
69
  # results = model.predict(image, imgsz=image_size, return_outputs=True)
70
  # results = model.predict(image)