Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1695,39 +1695,20 @@ if col_speed and col_speed in df.columns:
|
|
| 1695 |
# --- Persentase ---
|
| 1696 |
high_speed_pct = (len(high_speed_fatigue) / len(df) * 100) if len(df) > 0 else 0
|
| 1697 |
|
| 1698 |
-
# ---
|
| 1699 |
-
st.markdown(
|
| 1700 |
-
|
| 1701 |
-
|
| 1702 |
-
|
| 1703 |
-
|
| 1704 |
-
|
| 1705 |
-
|
| 1706 |
-
|
| 1707 |
-
|
| 1708 |
-
|
| 1709 |
-
|
| 1710 |
-
border-radius:10px;
|
| 1711 |
-
background:#d32f2f;
|
| 1712 |
-
color:#ffffff;
|
| 1713 |
-
text-align:center;
|
| 1714 |
-
box-shadow:0 6px 14px rgba(0,0,0,0.12);
|
| 1715 |
-
">
|
| 1716 |
-
<div style="font-size:26px; font-weight:700; line-height:1;">
|
| 1717 |
-
{len(high_speed_fatigue)}
|
| 1718 |
-
</div>
|
| 1719 |
-
<div style="font-size:14px; margin-top:4px; opacity:0.95;">
|
| 1720 |
-
{high_speed_pct:.1f}% of total alerts
|
| 1721 |
-
</div>
|
| 1722 |
-
<div style="font-size:12px; margin-top:6px; opacity:0.85;">
|
| 1723 |
-
Speed > {high_speed_threshold} km/h
|
| 1724 |
-
</div>
|
| 1725 |
-
</div>
|
| 1726 |
-
""",
|
| 1727 |
-
unsafe_allow_html=True
|
| 1728 |
-
)
|
| 1729 |
|
| 1730 |
-
# ---
|
| 1731 |
if high_speed_pct > 20:
|
| 1732 |
st.warning(
|
| 1733 |
f"High risk: {high_speed_pct:.1f}% of fatigue alerts occur at high speeds. "
|
|
|
|
| 1695 |
# --- Persentase ---
|
| 1696 |
high_speed_pct = (len(high_speed_fatigue) / len(df) * 100) if len(df) > 0 else 0
|
| 1697 |
|
| 1698 |
+
# --- Teks judul + hasil warna merah ---
|
| 1699 |
+
st.markdown(
|
| 1700 |
+
f"""
|
| 1701 |
+
<p style="color:#d32f2f; font-size:20px; font-weight:700; margin-bottom:4px;">
|
| 1702 |
+
High-Speed Fatigue Events: {len(high_speed_fatigue)}
|
| 1703 |
+
</p>
|
| 1704 |
+
<p style="color:#d32f2f; font-size:15px; font-weight:500; margin-top:-6px;">
|
| 1705 |
+
{high_speed_pct:.1f}% of total alerts (Speed > {high_speed_threshold} km/h)
|
| 1706 |
+
</p>
|
| 1707 |
+
""",
|
| 1708 |
+
unsafe_allow_html=True
|
| 1709 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1710 |
|
| 1711 |
+
# --- pesan risiko ---
|
| 1712 |
if high_speed_pct > 20:
|
| 1713 |
st.warning(
|
| 1714 |
f"High risk: {high_speed_pct:.1f}% of fatigue alerts occur at high speeds. "
|