linhcuem commited on
Commit
1206f49
1 Parent(s): 4321e84

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -43,7 +43,7 @@ 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
-
47
  return render
48
 
49
  # results = model.predict(image, imgsz=image_size, return_outputs=True)
@@ -89,12 +89,14 @@ inputs_image = [
89
  ]
90
 
91
  outputs_image =gr.outputs.Image(type="filepath", label="Output Image")
 
 
92
  title = "Tất cả do anh Đạt"
93
 
94
  interface_image = gr.Interface(
95
  fn=yolov8_img_inference,
96
  inputs=inputs_image,
97
- outputs=outputs_image,
98
  title=title,
99
  examples=image_path,
100
  cache_examples=True,
 
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)
 
89
  ]
90
 
91
  outputs_image =gr.outputs.Image(type="filepath", label="Output Image")
92
+ count_obj = gr.Textbox(show_label=False)
93
+
94
  title = "Tất cả do anh Đạt"
95
 
96
  interface_image = gr.Interface(
97
  fn=yolov8_img_inference,
98
  inputs=inputs_image,
99
+ outputs=outputs_image,count_obj,
100
  title=title,
101
  examples=image_path,
102
  cache_examples=True,