Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -259,20 +259,94 @@ def drone_detection_pipeline(input_image):
|
|
| 259 |
return blank, blank, error_msg
|
| 260 |
|
| 261 |
# ============================================
|
| 262 |
-
# 6. PROFESSIONAL INTERFACE
|
|
|
|
| 263 |
# ============================================
|
| 264 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 265 |
gr.Markdown(
|
| 266 |
"""
|
| 267 |
<div style="text-align: center; padding: 1rem 0 0.5rem 0;">
|
| 268 |
-
<h1 style="font-weight:
|
| 269 |
-
<p style="font-size: 1rem;
|
|
|
|
| 270 |
</div>
|
| 271 |
"""
|
| 272 |
)
|
| 273 |
|
| 274 |
-
with gr.Row():
|
| 275 |
-
with gr.Column(scale=1):
|
| 276 |
input_image = gr.Image(label="Upload Image", type="pil")
|
| 277 |
analyze_btn = gr.Button("Analyze", variant="primary")
|
| 278 |
with gr.Column(scale=2):
|
|
@@ -292,9 +366,8 @@ with gr.Blocks(title="Drone Detection System", theme=gr.themes.Soft()) as demo:
|
|
| 292 |
|
| 293 |
gr.Markdown(
|
| 294 |
"""
|
| 295 |
-
<div
|
| 296 |
-
|
| 297 |
-
<p>Powered by YOLOv11, Gradio, Hugging Face Spaces</p>
|
| 298 |
</div>
|
| 299 |
"""
|
| 300 |
)
|
|
|
|
| 259 |
return blank, blank, error_msg
|
| 260 |
|
| 261 |
# ============================================
|
| 262 |
+
# 6. SKYGUARD PROFESSIONAL INTERFACE
|
| 263 |
+
# Dark blue theme | White & Yellow text | No emojis
|
| 264 |
# ============================================
|
| 265 |
+
|
| 266 |
+
custom_css = """
|
| 267 |
+
/* Main background - dark blue gradient */
|
| 268 |
+
.gradio-container {
|
| 269 |
+
background: linear-gradient(135deg, #0a1928 0%, #0d2a3e 100%) !important;
|
| 270 |
+
font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
|
| 271 |
+
}
|
| 272 |
+
/* Headings and text */
|
| 273 |
+
h1, h2, h3, .gr-markdown h1, .gr-markdown h2, .gr-markdown h3 {
|
| 274 |
+
color: #ffffff !important;
|
| 275 |
+
font-weight: 500 !important;
|
| 276 |
+
}
|
| 277 |
+
p, label, .gr-form, .gr-box, .gr-markdown p {
|
| 278 |
+
color: #f0f0f0 !important;
|
| 279 |
+
}
|
| 280 |
+
/* Accent text (yellow) */
|
| 281 |
+
.accent-text, .gr-markdown strong {
|
| 282 |
+
color: #ffd966 !important;
|
| 283 |
+
}
|
| 284 |
+
/* Buttons - primary */
|
| 285 |
+
.gr-button-primary {
|
| 286 |
+
background: linear-gradient(90deg, #1e5a8a, #2c7ab1) !important;
|
| 287 |
+
border: none !important;
|
| 288 |
+
color: white !important;
|
| 289 |
+
font-weight: 600 !important;
|
| 290 |
+
border-radius: 8px !important;
|
| 291 |
+
padding: 12px 28px !important;
|
| 292 |
+
font-size: 1rem !important;
|
| 293 |
+
transition: all 0.2s ease !important;
|
| 294 |
+
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
|
| 295 |
+
}
|
| 296 |
+
.gr-button-primary:hover {
|
| 297 |
+
transform: translateY(-2px);
|
| 298 |
+
background: linear-gradient(90deg, #2c7ab1, #3a8fc5) !important;
|
| 299 |
+
box-shadow: 0 5px 15px rgba(0, 120, 200, 0.3);
|
| 300 |
+
}
|
| 301 |
+
/* Tabs styling */
|
| 302 |
+
.gr-tabs .tab-nav button {
|
| 303 |
+
background-color: #0f2b3a !important;
|
| 304 |
+
color: #c0d0e0 !important;
|
| 305 |
+
border-radius: 8px 8px 0 0 !important;
|
| 306 |
+
font-weight: 500 !important;
|
| 307 |
+
padding: 10px 20px !important;
|
| 308 |
+
margin-right: 4px !important;
|
| 309 |
+
}
|
| 310 |
+
.gr-tabs .tab-nav button.selected {
|
| 311 |
+
background-color: #1e5a8a !important;
|
| 312 |
+
color: #ffd966 !important;
|
| 313 |
+
border-bottom: 2px solid #ffd966 !important;
|
| 314 |
+
}
|
| 315 |
+
/* Input and output areas */
|
| 316 |
+
.gr-box, .gr-form, .gr-input, .gr-panel {
|
| 317 |
+
background-color: #0f2b3a !important;
|
| 318 |
+
border: 1px solid #2c7ab1 !important;
|
| 319 |
+
border-radius: 12px !important;
|
| 320 |
+
}
|
| 321 |
+
/* Image containers */
|
| 322 |
+
.gr-image {
|
| 323 |
+
background-color: #0a1928 !important;
|
| 324 |
+
border-radius: 8px;
|
| 325 |
+
}
|
| 326 |
+
/* Footer */
|
| 327 |
+
.footer {
|
| 328 |
+
text-align: center;
|
| 329 |
+
margin-top: 25px;
|
| 330 |
+
font-size: 12px;
|
| 331 |
+
color: #8aaec0 !important;
|
| 332 |
+
border-top: 1px solid #2c7ab1;
|
| 333 |
+
padding-top: 15px;
|
| 334 |
+
}
|
| 335 |
+
"""
|
| 336 |
+
|
| 337 |
+
with gr.Blocks(title="SkyGuard - Drone Detection System", theme=gr.themes.Soft(), css=custom_css) as demo:
|
| 338 |
gr.Markdown(
|
| 339 |
"""
|
| 340 |
<div style="text-align: center; padding: 1rem 0 0.5rem 0;">
|
| 341 |
+
<h1 style="font-weight: 700; letter-spacing: -0.5px; margin-bottom: 0.2rem; color: #ffffff;">SKYGUARD</h1>
|
| 342 |
+
<p style="font-size: 1.1rem; color: #ffd966;">Advanced Drone Detection with Explainable AI</p>
|
| 343 |
+
<p style="font-size: 0.9rem; color: #c0d0e0;">YOLOv11 | XAI Heatmap | BLIP Captioning</p>
|
| 344 |
</div>
|
| 345 |
"""
|
| 346 |
)
|
| 347 |
|
| 348 |
+
with gr.Row(equal_height=False):
|
| 349 |
+
with gr.Column(scale=1, min_width=320):
|
| 350 |
input_image = gr.Image(label="Upload Image", type="pil")
|
| 351 |
analyze_btn = gr.Button("Analyze", variant="primary")
|
| 352 |
with gr.Column(scale=2):
|
|
|
|
| 366 |
|
| 367 |
gr.Markdown(
|
| 368 |
"""
|
| 369 |
+
<div class="footer">
|
| 370 |
+
SkyGuard System | Powered by YOLOv11, Gradio, Hugging Face Spaces
|
|
|
|
| 371 |
</div>
|
| 372 |
"""
|
| 373 |
)
|