linhcuem commited on
Commit
d7fd70c
·
1 Parent(s): 6894c6b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -51,7 +51,7 @@ def yolov8_img_inference(
51
  names = model.names
52
  # get the 'car' class id
53
  # obj_id = list(names)[list(names.values()).index('hop_dln','hop_jn','hop_vtg','hop_ytv','lo_kids', 'lo_ytv','loc_dln','loc_jn','loc_kids','loc_ytv')]
54
- obj_id = list(names)[list(names.values()).index('name')]
55
  # count 'car' objects in the results
56
  count_result = results[0].boxes.cls.tolist().count(obj_id)
57
  # count_result = results.pandas().xyxy[0].value_counts('name')
 
51
  names = model.names
52
  # get the 'car' class id
53
  # obj_id = list(names)[list(names.values()).index('hop_dln','hop_jn','hop_vtg','hop_ytv','lo_kids', 'lo_ytv','loc_dln','loc_jn','loc_kids','loc_ytv')]
54
+ obj_id = list(names)[list(names.values()).index([0])]
55
  # count 'car' objects in the results
56
  count_result = results[0].boxes.cls.tolist().count(obj_id)
57
  # count_result = results.pandas().xyxy[0].value_counts('name')