eeshawn commited on
Commit
578200d
·
1 Parent(s): 8d66a77

switch to use ultralyticsplus

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -1,5 +1,5 @@
1
  import gradio as gr
2
- from ultralytics import YOLO
3
 
4
  def yolov8_inference(
5
  image: gr.inputs.Image = None,
@@ -51,18 +51,19 @@ def yolov8_inference(
51
 
52
  inputs = [
53
  # gr.inputs.Image(type="filepath", label="Input Image"),
54
- gr.image(source="upload", type="pil", label="Image Upload", interactive=True),
55
- gr.inputs.Slider(minimum=0.0, maximum=1.0, default=0.25, step=0.05, label="Confidence Threshold"),
56
  gr.inputs.Slider(minimum=0.0, maximum=1.0, default=0.45, step=0.05, label="IOU Threshold"),
57
  ]
58
 
59
  outputs = gr.outputs.Image(type="filepath", label="Output Image")
60
  title = "Naruto Hand Seal Detection with YOLOv8"
61
 
62
- gr.Interface(
63
  fn=yolov8_inference,
64
  inputs=inputs,
65
  outputs=outputs,
66
  title=title,
67
- theme='huggingface',
68
- ).launch(debug=True).queue()
 
 
1
  import gradio as gr
2
+ from ultralyticsplus import YOLO
3
 
4
  def yolov8_inference(
5
  image: gr.inputs.Image = None,
 
51
 
52
  inputs = [
53
  # gr.inputs.Image(type="filepath", label="Input Image"),
54
+ gr.Image(source="upload", type="pil", label="Image Upload", interactive=True),
55
+ gr.inputs.Slider(minimum=0.0, maximum=1.0, default=0.5, step=0.05, label="Confidence Threshold"),
56
  gr.inputs.Slider(minimum=0.0, maximum=1.0, default=0.45, step=0.05, label="IOU Threshold"),
57
  ]
58
 
59
  outputs = gr.outputs.Image(type="filepath", label="Output Image")
60
  title = "Naruto Hand Seal Detection with YOLOv8"
61
 
62
+ myapp = gr.Interface(
63
  fn=yolov8_inference,
64
  inputs=inputs,
65
  outputs=outputs,
66
  title=title,
67
+ )
68
+ myapp.queue()
69
+ myapp.launch()