Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -47,8 +47,8 @@ def yolov8_img_inference(
|
|
47 |
# image = read_image
|
48 |
results = model.predict(image)
|
49 |
render = render_result(model=model, image=image, result=results[0])
|
50 |
-
|
51 |
-
count_result = results.pandas().xyxy[0].value_counts('name')
|
52 |
return render, count_result
|
53 |
|
54 |
# results = model.predict(image, imgsz=image_size, return_outputs=True)
|
|
|
47 |
# image = read_image
|
48 |
results = model.predict(image)
|
49 |
render = render_result(model=model, image=image, result=results[0])
|
50 |
+
count_result = results[0].boxes.cls.tolist().count('name')
|
51 |
+
# count_result = results.pandas().xyxy[0].value_counts('name')
|
52 |
return render, count_result
|
53 |
|
54 |
# results = model.predict(image, imgsz=image_size, return_outputs=True)
|