Spaces:
Sleeping
Sleeping
Kesheratmex
commited on
Commit
·
d476b0e
1
Parent(s):
8481363
**Simplify usage instructions UI and remove decorative styling**
Browse filesUpdated the instructions section to a cleaner, more concise layout and removed the elaborate gradient and icon styling. The tab label was also simplified from “🎥 Análisis de Vídeo” to “Análisis de Vídeo”.
app.py
CHANGED
|
@@ -1365,105 +1365,52 @@ with gr.Blocks(
|
|
| 1365 |
""")
|
| 1366 |
|
| 1367 |
with gr.Group(visible=False) as app_group:
|
| 1368 |
-
#
|
| 1369 |
gr.HTML("""
|
| 1370 |
-
<div style="background:
|
| 1371 |
-
<h3 style="margin-top: 0; color: #
|
| 1372 |
-
|
| 1373 |
-
|
| 1374 |
-
|
| 1375 |
-
|
| 1376 |
-
<
|
| 1377 |
-
|
| 1378 |
-
<span style="font-size: 18px;">1️⃣</span> Selecciona Tipo
|
| 1379 |
-
</h4>
|
| 1380 |
-
<p style="color: #1976d2; margin: 0; font-size: 14px; line-height: 1.4;">
|
| 1381 |
-
Elige entre las pestañas "Vídeo" o "Imagen" según tu archivo de inspección
|
| 1382 |
-
</p>
|
| 1383 |
-
</div>
|
| 1384 |
-
<div style="background: #e8f5e8; border-radius: 12px; padding: 20px; border-left: 4px solid #4caf50;">
|
| 1385 |
-
<h4 style="color: #2e7d32; margin: 0 0 10px 0; font-weight: 600; display: flex; align-items: center; gap: 8px;">
|
| 1386 |
-
<span style="font-size: 18px;">2️⃣</span> Sube Archivo
|
| 1387 |
-
</h4>
|
| 1388 |
-
<p style="color: #388e3c; margin: 0; font-size: 14px; line-height: 1.4;">
|
| 1389 |
-
Arrastra y suelta o haz clic para seleccionar tu archivo de turbina eólica
|
| 1390 |
-
</p>
|
| 1391 |
-
</div>
|
| 1392 |
-
<div style="background: #fff3e0; border-radius: 12px; padding: 20px; border-left: 4px solid #ff9800;">
|
| 1393 |
-
<h4 style="color: #ef6c00; margin: 0 0 10px 0; font-weight: 600; display: flex; align-items: center; gap: 8px;">
|
| 1394 |
-
<span style="font-size: 18px;">3️⃣</span> Analizar
|
| 1395 |
-
</h4>
|
| 1396 |
-
<p style="color: #f57c00; margin: 0; font-size: 14px; line-height: 1.4;">
|
| 1397 |
-
Haz clic en "Analizar" para iniciar la detección automática con IA
|
| 1398 |
-
</p>
|
| 1399 |
-
</div>
|
| 1400 |
-
<div style="background: #f3e5f5; border-radius: 12px; padding: 20px; border-left: 4px solid #9c27b0;">
|
| 1401 |
-
<h4 style="color: #7b1fa2; margin: 0 0 10px 0; font-weight: 600; display: flex; align-items: center; gap: 8px;">
|
| 1402 |
-
<span style="font-size: 18px;">4️⃣</span> Revisar
|
| 1403 |
-
</h4>
|
| 1404 |
-
<p style="color: #8e24aa; margin: 0; font-size: 14px; line-height: 1.4;">
|
| 1405 |
-
Examina las detecciones y el análisis profesional generado
|
| 1406 |
-
</p>
|
| 1407 |
-
</div>
|
| 1408 |
-
</div>
|
| 1409 |
</div>
|
| 1410 |
""")
|
| 1411 |
|
| 1412 |
# Input section: tabs for different media types
|
| 1413 |
with gr.Tabs() as media_tabs:
|
| 1414 |
# Video tab: only video input
|
| 1415 |
-
with gr.TabItem("
|
| 1416 |
gr.HTML("""
|
| 1417 |
-
<div style="background: linear-gradient(135deg, #
|
| 1418 |
-
<
|
| 1419 |
-
|
| 1420 |
-
|
| 1421 |
-
|
| 1422 |
-
|
| 1423 |
-
|
| 1424 |
-
<p style="color: rgba(255,255,255,0.9) !important; margin: 5px 0 0 0; font-weight: 500 !important; text-shadow: 1px 1px 2px rgba(0,0,0,0.2) !important;">
|
| 1425 |
-
Detección automática frame por frame con IA avanzada
|
| 1426 |
-
</p>
|
| 1427 |
-
</div>
|
| 1428 |
-
</div>
|
| 1429 |
-
<div style="background: rgba(255,255,255,0.1); border-radius: 10px; padding: 15px; backdrop-filter: blur(5px);">
|
| 1430 |
-
<p style="color: #ffffff !important; margin: 0; font-weight: 600 !important; text-shadow: 1px 1px 2px rgba(0,0,0,0.2) !important; font-size: 14px;">
|
| 1431 |
-
📁 <strong>Formatos:</strong> MP4, MOV, AVI, MKV | 📏 <strong>Tamaño máximo:</strong> 500MB | ⏱️ <strong>Duración:</strong> hasta 10 minutos
|
| 1432 |
-
</p>
|
| 1433 |
-
</div>
|
| 1434 |
</div>
|
| 1435 |
""")
|
| 1436 |
video_input = gr.Video(
|
| 1437 |
-
label="
|
| 1438 |
-
height=300
|
| 1439 |
)
|
| 1440 |
|
| 1441 |
# Imagen tab: only image input
|
| 1442 |
-
with gr.TabItem("
|
| 1443 |
gr.HTML("""
|
| 1444 |
-
<div style="background: linear-gradient(135deg, #
|
| 1445 |
-
<
|
| 1446 |
-
|
| 1447 |
-
|
| 1448 |
-
|
| 1449 |
-
|
| 1450 |
-
|
| 1451 |
-
<p style="color: rgba(255,255,255,0.9) !important; margin: 5px 0 0 0; font-weight: 500 !important; text-shadow: 1px 1px 2px rgba(0,0,0,0.2) !important;">
|
| 1452 |
-
Detección precisa de defectos en alta resolución
|
| 1453 |
-
</p>
|
| 1454 |
-
</div>
|
| 1455 |
-
</div>
|
| 1456 |
-
<div style="background: rgba(255,255,255,0.1); border-radius: 10px; padding: 15px; backdrop-filter: blur(5px);">
|
| 1457 |
-
<p style="color: #ffffff !important; margin: 0; font-weight: 600 !important; text-shadow: 1px 1px 2px rgba(0,0,0,0.2) !important; font-size: 14px;">
|
| 1458 |
-
📁 <strong>Formatos:</strong> JPG, PNG, BMP, WEBP | 📏 <strong>Resolución:</strong> mínimo 1024x768px | 💾 <strong>Tamaño:</strong> hasta 50MB
|
| 1459 |
-
</p>
|
| 1460 |
-
</div>
|
| 1461 |
</div>
|
| 1462 |
""")
|
| 1463 |
image_input = gr.Image(
|
| 1464 |
type="filepath",
|
| 1465 |
-
label="
|
| 1466 |
-
height=300
|
| 1467 |
)
|
| 1468 |
# Configuración tab: classes and sensitivity controls
|
| 1469 |
with gr.TabItem("Configuración Avanzada"):
|
|
@@ -1650,37 +1597,12 @@ with gr.Blocks(
|
|
| 1650 |
)
|
| 1651 |
btn_metrics.click(fn=get_metrics, outputs=out_metrics, api_name="metrics")
|
| 1652 |
|
| 1653 |
-
# Sección principal de análisis
|
| 1654 |
-
gr.HTML("""
|
| 1655 |
-
<div style="background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%); padding: 30px; border-radius: 15px; margin: 30px 0; text-align: center; box-shadow: 0 6px 25px rgba(13, 110, 253, 0.2); border-top: 4px solid #495057;">
|
| 1656 |
-
<h2 style="color: #ffffff !important; margin: 0 0 12px 0; font-size: 1.8rem; font-weight: 700 !important; text-shadow: 1px 1px 3px rgba(0,0,0,0.3) !important;">
|
| 1657 |
-
[LISTO] ¿Listo para Analizar?
|
| 1658 |
-
</h2>
|
| 1659 |
-
<p style="color: #ffffff !important; margin: 0 0 20px 0; font-size: 16px; text-shadow: 1px 1px 2px rgba(0,0,0,0.2) !important; font-weight: 600 !important;">
|
| 1660 |
-
Haz clic en el botón de abajo para iniciar el análisis inteligente de tu archivo
|
| 1661 |
-
</p>
|
| 1662 |
-
</div>
|
| 1663 |
-
""")
|
| 1664 |
|
| 1665 |
-
# Botón de análisis mejorado y más prominente
|
| 1666 |
-
gr.HTML("""
|
| 1667 |
-
<div style="text-align: center; margin: 30px 0 20px 0;">
|
| 1668 |
-
<div style="background: linear-gradient(135deg, #28a745 0%, #20c997 100%); border-radius: 16px; padding: 20px; box-shadow: 0 8px 32px rgba(40, 167, 69, 0.3); border: 2px solid rgba(255,255,255,0.2);">
|
| 1669 |
-
<h3 style="color: white; margin: 0 0 10px 0; font-weight: 700; text-shadow: 2px 2px 4px rgba(0,0,0,0.3);">
|
| 1670 |
-
🚀 ¿Listo para el Análisis?
|
| 1671 |
-
</h3>
|
| 1672 |
-
<p style="color: rgba(255,255,255,0.9); margin: 0; font-weight: 500; text-shadow: 1px 1px 2px rgba(0,0,0,0.2);">
|
| 1673 |
-
Haz clic en el botón para iniciar la detección automática con IA
|
| 1674 |
-
</p>
|
| 1675 |
-
</div>
|
| 1676 |
-
</div>
|
| 1677 |
-
""")
|
| 1678 |
|
|
|
|
| 1679 |
btn_detect = gr.Button(
|
| 1680 |
-
"
|
| 1681 |
-
variant="primary"
|
| 1682 |
-
size="lg",
|
| 1683 |
-
scale=1
|
| 1684 |
)
|
| 1685 |
|
| 1686 |
# Animación de carga mejorada y más amigable
|
|
|
|
| 1365 |
""")
|
| 1366 |
|
| 1367 |
with gr.Group(visible=False) as app_group:
|
| 1368 |
+
# Instrucciones simples
|
| 1369 |
gr.HTML("""
|
| 1370 |
+
<div style="background: #ffffff; border: 1px solid #dee2e6; border-radius: 8px; padding: 20px; margin: 15px 0; box-shadow: 0 2px 8px rgba(0,0,0,0.05);">
|
| 1371 |
+
<h3 style="margin-top: 0; color: #212529; font-weight: 600; font-size: 18px;">Instrucciones de Uso</h3>
|
| 1372 |
+
<ol style="margin-bottom: 0; padding-left: 20px; color: #495057; font-weight: 400; line-height: 1.6;">
|
| 1373 |
+
<li style="margin-bottom: 8px; color: #495057;"><strong style="color: #212529;">Selecciona el tipo de archivo:</strong> Elige entre las pestañas "Vídeo" o "Imagen" según tu contenido</li>
|
| 1374 |
+
<li style="margin-bottom: 8px; color: #495057;"><strong style="color: #212529;">Sube tu archivo:</strong> Arrastra y suelta o haz clic para seleccionar tu archivo de inspección</li>
|
| 1375 |
+
<li style="margin-bottom: 8px; color: #495057;"><strong style="color: #212529;">Analiza:</strong> Haz clic en "Analizar" para comenzar la detección automática</li>
|
| 1376 |
+
<li style="margin-bottom: 0; color: #495057;"><strong style="color: #212529;">Revisa resultados:</strong> Examina las detecciones y el análisis generado por KESHERAT AI</li>
|
| 1377 |
+
</ol>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1378 |
</div>
|
| 1379 |
""")
|
| 1380 |
|
| 1381 |
# Input section: tabs for different media types
|
| 1382 |
with gr.Tabs() as media_tabs:
|
| 1383 |
# Video tab: only video input
|
| 1384 |
+
with gr.TabItem("Análisis de Vídeo"):
|
| 1385 |
gr.HTML("""
|
| 1386 |
+
<div style="background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%); padding: 25px; border-radius: 12px; margin-bottom: 20px; box-shadow: 0 4px 15px rgba(13, 110, 253, 0.2); border-left: 4px solid #ffffff;">
|
| 1387 |
+
<h4 style="margin-top: 0; color: #ffffff !important; font-weight: 700 !important; font-size: 18px; text-shadow: 1px 1px 3px rgba(0,0,0,0.3) !important;">
|
| 1388 |
+
[VIDEO] Análisis de Vídeo de Inspección
|
| 1389 |
+
</h4>
|
| 1390 |
+
<p style="color: #ffffff !important; margin-bottom: 0; font-weight: 600 !important; text-shadow: 1px 1px 2px rgba(0,0,0,0.2) !important;">
|
| 1391 |
+
Formatos soportados: MP4, MOV, AVI, MKV | Tamaño máximo recomendado: 500MB
|
| 1392 |
+
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1393 |
</div>
|
| 1394 |
""")
|
| 1395 |
video_input = gr.Video(
|
| 1396 |
+
label="Arrastra tu vídeo aquí o haz clic para seleccionar"
|
|
|
|
| 1397 |
)
|
| 1398 |
|
| 1399 |
# Imagen tab: only image input
|
| 1400 |
+
with gr.TabItem("Análisis de Imagen"):
|
| 1401 |
gr.HTML("""
|
| 1402 |
+
<div style="background: linear-gradient(135deg, #3da5ff 0%, #1c7ed6 100%); padding: 25px; border-radius: 12px; margin-bottom: 20px; box-shadow: 0 4px 15px rgba(61, 165, 255, 0.25); border-left: 4px solid #ffffff;">
|
| 1403 |
+
<h4 style="margin-top: 0; color: #ffffff !important; font-weight: 700 !important; font-size: 18px; text-shadow: 1px 1px 3px rgba(0,0,0,0.3) !important;">
|
| 1404 |
+
[IMAGEN] Análisis de Imagen de Inspección
|
| 1405 |
+
</h4>
|
| 1406 |
+
<p style="color: #ffffff !important; margin-bottom: 0; font-weight: 600 !important; text-shadow: 1px 1px 2px rgba(0,0,0,0.2) !important;">
|
| 1407 |
+
Formatos soportados: JPG, PNG, BMP | Resolución recomendada: mínimo 1024x768px
|
| 1408 |
+
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1409 |
</div>
|
| 1410 |
""")
|
| 1411 |
image_input = gr.Image(
|
| 1412 |
type="filepath",
|
| 1413 |
+
label="Arrastra tu imagen aquí o haz clic para seleccionar"
|
|
|
|
| 1414 |
)
|
| 1415 |
# Configuración tab: classes and sensitivity controls
|
| 1416 |
with gr.TabItem("Configuración Avanzada"):
|
|
|
|
| 1597 |
)
|
| 1598 |
btn_metrics.click(fn=get_metrics, outputs=out_metrics, api_name="metrics")
|
| 1599 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1600 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1601 |
|
| 1602 |
+
# Botón de análisis simple
|
| 1603 |
btn_detect = gr.Button(
|
| 1604 |
+
"Iniciar Análisis con KESHERAT AI",
|
| 1605 |
+
variant="primary"
|
|
|
|
|
|
|
| 1606 |
)
|
| 1607 |
|
| 1608 |
# Animación de carga mejorada y más amigable
|