Spaces:
Running
Running
Update app.py
Browse files
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
|
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,8 +161,8 @@ css = """
|
|
161 |
}
|
162 |
"""
|
163 |
|
164 |
-
with gr.Blocks(css=css, title="
|
165 |
-
gr.Markdown("""#
|
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
|
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()
|