spencercdz commited on
Commit
a566b11
·
verified ·
1 Parent(s): 21b9f3a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -15,6 +15,7 @@ if torch.cuda.is_available():
15
  else:
16
  device = 'cpu'
17
  print("Using CPU inference")
 
18
 
19
  model.to(device)
20
 
@@ -65,11 +66,11 @@ iface = gr.Interface(
65
  fn=predict_image,
66
  inputs=[
67
  gr.Image(type="pil", label="Upload Image"),
68
- gr.Slider(minimum=0, maximum=1, value=0.25, label="Confidence threshold"),
69
- gr.Slider(minimum=0, maximum=1, value=0.45, label="IoU threshold"),
70
  ],
71
  outputs=gr.Image(type="pil", label="Detection Results"),
72
- title="YOLOv8m Defence Object Detection",
73
  description="""
74
  Upload images to detect military and civilian vehicles, aircraft, and ships using our fine-tuned YOLOv8m model.
75
  Developed for DSTA Brainhack 2025 - TIL-AI Category (Semi-Finalist).
@@ -80,7 +81,7 @@ iface = gr.Interface(
80
  Vehicles (car, truck, tank, bus, van), Ships (cargo, yacht, cruise, warship, sailboat),
81
  and specialized items (drone, missile).
82
 
83
- **Note:** Running on Free Tier - inference may take up to 40 seconds per image.
84
  """,
85
  examples=[
86
  ["examples/test1.jpg", 0.25, 0.45],
@@ -95,7 +96,8 @@ iface = gr.Interface(
95
  ["examples/test10.jpg", 0.25, 0.45],
96
  ],
97
  css=css,
98
- cache_examples=True
 
99
  )
100
 
101
  if __name__ == "__main__":
 
15
  else:
16
  device = 'cpu'
17
  print("Using CPU inference")
18
+ torch.set_num_threads(2)
19
 
20
  model.to(device)
21
 
 
66
  fn=predict_image,
67
  inputs=[
68
  gr.Image(type="pil", label="Upload Image"),
69
+ gr.Slider(minimum=0, maximum=1, value=0.25, step=0.05, label="Confidence threshold"),
70
+ gr.Slider(minimum=0, maximum=1, value=0.45, step=0.05, label="IoU threshold"),
71
  ],
72
  outputs=gr.Image(type="pil", label="Detection Results"),
73
+ title="🛡️ YOLOv8m Defence Object Detection",
74
  description="""
75
  Upload images to detect military and civilian vehicles, aircraft, and ships using our fine-tuned YOLOv8m model.
76
  Developed for DSTA Brainhack 2025 - TIL-AI Category (Semi-Finalist).
 
81
  Vehicles (car, truck, tank, bus, van), Ships (cargo, yacht, cruise, warship, sailboat),
82
  and specialized items (drone, missile).
83
 
84
+ **Performance:** Running on Free Tier - inference may take up to 40 seconds per image.
85
  """,
86
  examples=[
87
  ["examples/test1.jpg", 0.25, 0.45],
 
96
  ["examples/test10.jpg", 0.25, 0.45],
97
  ],
98
  css=css,
99
+ cache_examples=True,
100
+ allow_flagging="never"
101
  )
102
 
103
  if __name__ == "__main__":