alanchen1115 commited on
Commit
cbde59c
·
verified ·
1 Parent(s): 561a20e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -9
app.py CHANGED
@@ -43,21 +43,16 @@ def detect_objects_on_image(image_path, conf_threshold, iou_threshold):
43
  cv2.putText(image,result.names[class_id], (x1, y1), cv2.FONT_HERSHEY_SIMPLEX, 0.9, (36,255,12), 2)
44
  return cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
45
 
46
-
47
- inputs_image = [
48
- gr.components.Image(type="filepath", label="Input Image"),
49
- ]
50
- outputs_image = [
51
- gr.components.Image(type="numpy", label="Output Image"),
52
- ]
53
  demo = gr.Interface(
54
  fn=detect_objects_on_image,
55
  inputs=[
56
- gr.Image(type="pil", label="Upload Image"),
57
  gr.Slider(minimum=0, maximum=1, value=0.25, label="Confidence threshold"),
58
  gr.Slider(minimum=0, maximum=1, value=0.45, label="IoU threshold"),
59
  ],
60
- outputs=outputs_image,
 
 
61
  title="Yolov8 Custom Object Detection",
62
  examples=examples,
63
  cache_examples=False,
 
43
  cv2.putText(image,result.names[class_id], (x1, y1), cv2.FONT_HERSHEY_SIMPLEX, 0.9, (36,255,12), 2)
44
  return cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
45
 
 
 
 
 
 
 
 
46
  demo = gr.Interface(
47
  fn=detect_objects_on_image,
48
  inputs=[
49
+ gr.components.Image(type="filepath", label="Input Image"),
50
  gr.Slider(minimum=0, maximum=1, value=0.25, label="Confidence threshold"),
51
  gr.Slider(minimum=0, maximum=1, value=0.45, label="IoU threshold"),
52
  ],
53
+ outputs=[
54
+ gr.components.Image(type="numpy", label="Output Image"),
55
+ ],
56
  title="Yolov8 Custom Object Detection",
57
  examples=examples,
58
  cache_examples=False,