Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -21,6 +21,24 @@ def predict_image(img, conf_threshold, iou_threshold, model_name):
|
|
21 |
im = Image.fromarray(im_array[..., ::-1])
|
22 |
return im
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
iface = gr.Interface(
|
25 |
fn=predict_image,
|
26 |
inputs=[
|
@@ -30,7 +48,7 @@ iface = gr.Interface(
|
|
30 |
gr.Radio(choices=["yolov8m_defence.pt"], label="Model Name", value="yolov8m_defence.pt"),
|
31 |
],
|
32 |
outputs=gr.Image(type="pil", label="Detection Results"),
|
33 |
-
title="
|
34 |
description="""
|
35 |
Upload images to detect military and civilian vehicles, aircraft, and ships using our fine-tuned YOLOv8m model.
|
36 |
|
@@ -38,7 +56,7 @@ iface = gr.Interface(
|
|
38 |
Vehicles (car, truck, tank, bus, van), Ships (cargo, yacht, cruise, warship, sailboat),
|
39 |
and specialized items (drone, missile).
|
40 |
|
41 |
-
*Developed for DSTA Brainhack 2025 - TIL-AI Category
|
42 |
""",
|
43 |
examples=[
|
44 |
["examples/test1.jpg", 0.25, 0.45, "yolov8m_defence.pt"],
|
@@ -52,6 +70,7 @@ iface = gr.Interface(
|
|
52 |
["examples/test9.jpg", 0.25, 0.45, "yolov8m_defence.pt"],
|
53 |
["examples/test10.jpg", 0.25, 0.45, "yolov8m_defence.pt"],
|
54 |
],
|
|
|
55 |
)
|
56 |
|
57 |
iface.launch(share=True)
|
|
|
21 |
im = Image.fromarray(im_array[..., ::-1])
|
22 |
return im
|
23 |
|
24 |
+
# Custom CSS for font styling
|
25 |
+
css = """
|
26 |
+
body, .gradio-container {
|
27 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
|
28 |
+
}
|
29 |
+
.gr-button {
|
30 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
|
31 |
+
font-weight: 500 !important;
|
32 |
+
}
|
33 |
+
.gr-box h1 {
|
34 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
|
35 |
+
font-weight: 600 !important;
|
36 |
+
}
|
37 |
+
.gr-box p {
|
38 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
|
39 |
+
}
|
40 |
+
"""
|
41 |
+
|
42 |
iface = gr.Interface(
|
43 |
fn=predict_image,
|
44 |
inputs=[
|
|
|
48 |
gr.Radio(choices=["yolov8m_defence.pt"], label="Model Name", value="yolov8m_defence.pt"),
|
49 |
],
|
50 |
outputs=gr.Image(type="pil", label="Detection Results"),
|
51 |
+
title="YOLOv8m Defence Object Detection",
|
52 |
description="""
|
53 |
Upload images to detect military and civilian vehicles, aircraft, and ships using our fine-tuned YOLOv8m model.
|
54 |
|
|
|
56 |
Vehicles (car, truck, tank, bus, van), Ships (cargo, yacht, cruise, warship, sailboat),
|
57 |
and specialized items (drone, missile).
|
58 |
|
59 |
+
*Developed for DSTA Brainhack 2025 - TIL-AI Category (Semi-Finalist)
|
60 |
""",
|
61 |
examples=[
|
62 |
["examples/test1.jpg", 0.25, 0.45, "yolov8m_defence.pt"],
|
|
|
70 |
["examples/test9.jpg", 0.25, 0.45, "yolov8m_defence.pt"],
|
71 |
["examples/test10.jpg", 0.25, 0.45, "yolov8m_defence.pt"],
|
72 |
],
|
73 |
+
css=css
|
74 |
)
|
75 |
|
76 |
iface.launch(share=True)
|