nehulagrawal commited on
Commit
e56e1a2
β€’
1 Parent(s): f6f3560

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -14
app.py CHANGED
@@ -5,11 +5,11 @@ from sahi.utils.cv import visualize_object_predictions, read_image
5
  from ultralyticsplus import YOLO, render_result
6
 
7
  def yolov8_inference(
8
- image: gr.inputs.Image = None,
9
- model_path: gr.inputs.Dropdown = None,
10
- image_size: gr.inputs.Slider = 640,
11
- conf_threshold: gr.inputs.Slider = 0.25,
12
- iou_threshold: gr.inputs.Slider = 0.45,
13
  ):
14
  """
15
  YOLOv8 inference function
@@ -35,20 +35,19 @@ def yolov8_inference(
35
 
36
 
37
  inputs = [
38
- gr.inputs.Image(type="filepath", label="Input Image"),
39
- gr.inputs.Dropdown(["foduucom/thermal-image-object-detection"],
40
- default="foduucom/thermal-image-object-detection", label="Model"),
41
- gr.inputs.Slider(minimum=320, maximum=1280, default=640, step=32, label="Image Size"),
42
- gr.inputs.Slider(minimum=0.0, maximum=1.0, default=0.25, step=0.05, label="Confidence Threshold"),
43
- gr.inputs.Slider(minimum=0.0, maximum=1.0, default=0.45, step=0.05, label="IOU Threshold"),
44
  ]
45
 
46
- outputs = gr.outputs.Image(type="filepath", label="Output Image")
47
  title = "ThermalSense: Object Detection in Thermal Images"
48
 
49
  description ="""
50
  πŸ”₯ Unveiling ThermalFoduu: Spot Objects with Thermal Vision! πŸ”πŸ“Έ Lost your keys in the dark? πŸ—οΈπŸŒ‘ ThermalFoduu's got you covered! Powered by Foduu AI, our app effortlessly detects objects in thermal images. No more blurry blobs – just pinpoint accuracy! πŸ¦…πŸŽ―
51
-
52
  Love the thermal world? Give us a thumbs up! πŸ‘ Questions or suggestions? Contact us at info@foduu. Let's decode the thermal universe together! πŸ“§πŸŒ‘οΈ
53
  """
54
  examples = [['samples/1.jpeg', 'foduucom/thermal-image-object-detection', 640, 0.25, 0.45], ['samples/2.jpg', 'foduucom/thermal-image-object-detection', 640, 0.25, 0.45]]
@@ -62,4 +61,4 @@ demo_app = gr.Interface(
62
  cache_examples=True,
63
  theme='huggingface',
64
  )
65
- demo_app.launch(debug=True, enable_queue=True)
 
5
  from ultralyticsplus import YOLO, render_result
6
 
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
 
35
 
36
 
37
  inputs = [
38
+ gr.Image(type="filepath", label="Input Image"),
39
+ gr.Dropdown(["foduucom/thermal-image-object-detection"],
40
+ default="foduucom/thermal-image-object-detection", label="Model"),
41
+ gr.Slider(minimum=320, maximum=1280, default=640, step=32, label="Image Size"),
42
+ gr.Slider(minimum=0.0, maximum=1.0, default=0.25, step=0.05, label="Confidence Threshold"),
43
+ gr.Slider(minimum=0.0, maximum=1.0, default=0.45, step=0.05, label="IOU Threshold"),
44
  ]
45
 
46
+ outputs = gr.Image(type="filepath", label="Output Image")
47
  title = "ThermalSense: Object Detection in Thermal Images"
48
 
49
  description ="""
50
  πŸ”₯ Unveiling ThermalFoduu: Spot Objects with Thermal Vision! πŸ”πŸ“Έ Lost your keys in the dark? πŸ—οΈπŸŒ‘ ThermalFoduu's got you covered! Powered by Foduu AI, our app effortlessly detects objects in thermal images. No more blurry blobs – just pinpoint accuracy! πŸ¦…πŸŽ―
 
51
  Love the thermal world? Give us a thumbs up! πŸ‘ Questions or suggestions? Contact us at info@foduu. Let's decode the thermal universe together! πŸ“§πŸŒ‘οΈ
52
  """
53
  examples = [['samples/1.jpeg', 'foduucom/thermal-image-object-detection', 640, 0.25, 0.45], ['samples/2.jpg', 'foduucom/thermal-image-object-detection', 640, 0.25, 0.45]]
 
61
  cache_examples=True,
62
  theme='huggingface',
63
  )
64
+ demo_app.queue().launch(debug=True)