Aumkeshchy2003 commited on
Commit
a549deb
·
verified ·
1 Parent(s): 1052f15

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -24,12 +24,12 @@ else:
24
  torch.save(model.state_dict(), model_path)
25
 
26
  # Optimize model for speed
27
- model.conf = 0.3 # Lower confidence threshold
28
- model.iou = 0.3 # Non-Maximum Suppression IoU threshold
29
- model.classes = None # Detect all 80+ COCO classes
30
 
31
  if device.type == "cuda":
32
- model.half() # Use FP16 for faster inference
33
  else:
34
  torch.set_num_threads(os.cpu_count())
35
 
@@ -161,8 +161,8 @@ css = """
161
  }
162
  """
163
 
164
- with gr.Blocks(css=css, title="Real-Time YOLOv5 Video & Image Object Detection") as demo:
165
- gr.Markdown("""# Real-Time YOLOv5 Object Detection""", elem_id="title")
166
 
167
  with gr.Tabs():
168
  with gr.TabItem("Video Detection", elem_classes="tab-item"):
@@ -232,7 +232,7 @@ with gr.Blocks(css=css, title="Real-Time YOLOv5 Video & Image Object Detection")
232
 
233
  gr.Markdown("""
234
  ### Powered by YOLOv5.
235
- This application allows real-time object detection using the YOLOv5 model.
236
  """, elem_classes="footer")
237
 
238
  demo.launch()
 
24
  torch.save(model.state_dict(), model_path)
25
 
26
  # Optimize model for speed
27
+ model.conf = 0.3
28
+ model.iou = 0.3
29
+ model.classes = None
30
 
31
  if device.type == "cuda":
32
+ model.half()
33
  else:
34
  torch.set_num_threads(os.cpu_count())
35
 
 
161
  }
162
  """
163
 
164
+ with gr.Blocks(css=css, title="Video & Image Object Detection by YOLOv5") as demo:
165
+ gr.Markdown("""# YOLOv5 Object Detection""", elem_id="title")
166
 
167
  with gr.Tabs():
168
  with gr.TabItem("Video Detection", elem_classes="tab-item"):
 
232
 
233
  gr.Markdown("""
234
  ### Powered by YOLOv5.
235
+ This application enables seamless object detection using the YOLOv5 model, allowing users to analyze images and videos with high accuracy and efficiency.
236
  """, elem_classes="footer")
237
 
238
  demo.launch()