linhcuem commited on
Commit
eca09e4
1 Parent(s): 349c44c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -43,8 +43,9 @@ def yolov8_img_inference(
43
  # image = read_image
44
  results = model.predict(image)
45
  render = render_result(model=model, image=image, result=results[0])
46
- count_result = results.pandas().xyxy[0].value_counts('name')
47
- return render
 
48
 
49
  # results = model.predict(image, imgsz=image_size, return_outputs=True)
50
  # results = model.predict(image)
 
43
  # image = read_image
44
  results = model.predict(image)
45
  render = render_result(model=model, image=image, result=results[0])
46
+ count_result = results[0].boxes.cls.tolist().count('name')
47
+ # count_result = results.pandas().xyxy[0].value_counts('name')
48
+ return render, count_result
49
 
50
  # results = model.predict(image, imgsz=image_size, return_outputs=True)
51
  # results = model.predict(image)