nehulagrawal commited on
Commit
114c1f1
Β·
1 Parent(s): 75a38a1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -9
app.py CHANGED
@@ -7,9 +7,9 @@ from ultralyticsplus import YOLO
7
  def yolov8_inference(
8
  image: gr.Image = None,
9
  model_path: gr.Dropdown = None,
10
- image_size: gr.Slider = 640,
11
- conf_threshold: gr.Slider = 0.25,
12
- iou_threshold: gr.Slider = 0.45,
13
  ):
14
  """
15
  YOLOv8 inference function
@@ -23,7 +23,7 @@ def yolov8_inference(
23
  """
24
  model = YOLO(model_path)
25
  model.overrides['conf'] = conf_threshold
26
- model.overrides['iou']= iou_threshold
27
  model.overrides['agnostic_nms'] = False # NMS class-agnostic
28
  model.overrides['max_det'] = 1000
29
 
@@ -47,10 +47,7 @@ inputs = [
47
  outputs = gr.Text(Class1)
48
  title = "AI-Powered Tire Quality Inspection: YOLOv8s Enhanced Classification"
49
 
50
-
51
-
52
-
53
- description="""
54
  Welcome to our πŸ€– AI-Powered Tire Quality Inspection Space – a cutting-edge solution harnessing the capabilities of YOLOv8s to revolutionize πŸš— tire quality control processes.
55
  """
56
 
@@ -65,4 +62,4 @@ demo_app = gr.Interface(
65
  cache_examples=True,
66
  theme='huggingface',
67
  )
68
- demo_app.queue().launch(debug=True)
 
7
  def yolov8_inference(
8
  image: gr.Image = None,
9
  model_path: gr.Dropdown = None,
10
+ image_size: gr.Slider = gr.Slider(minimum=320, maximum=1280, default=640, step=32, label="Image Size"),
11
+ conf_threshold: gr.Slider = gr.Slider(minimum=0.0, maximum=1.0, default=0.25, step=0.05, label="Confidence Threshold"),
12
+ iou_threshold: gr.Slider = gr.Slider(minimum=0.0, maximum=1.0, default=0.45, step=0.05, label="IOU Threshold"),
13
  ):
14
  """
15
  YOLOv8 inference function
 
23
  """
24
  model = YOLO(model_path)
25
  model.overrides['conf'] = conf_threshold
26
+ model.overrides['iou'] = iou_threshold
27
  model.overrides['agnostic_nms'] = False # NMS class-agnostic
28
  model.overrides['max_det'] = 1000
29
 
 
47
  outputs = gr.Text(Class1)
48
  title = "AI-Powered Tire Quality Inspection: YOLOv8s Enhanced Classification"
49
 
50
+ description = """
 
 
 
51
  Welcome to our πŸ€– AI-Powered Tire Quality Inspection Space – a cutting-edge solution harnessing the capabilities of YOLOv8s to revolutionize πŸš— tire quality control processes.
52
  """
53
 
 
62
  cache_examples=True,
63
  theme='huggingface',
64
  )
65
+ demo_app.queue().launch(debug=True)