Fix ar10 — 2026-03-31 21:41:08
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
# SONAR-AI v18.2
|
| 2 |
import sys
|
| 3 |
import types
|
| 4 |
|
|
@@ -2870,11 +2870,11 @@ def analyze_full(img, declared_text):
|
|
| 2870 |
}
|
| 2871 |
_thr10 = _ALERT_THR.get(lbl10, 0.75)
|
| 2872 |
is_danger10 = lbl10 in _DANGER10 and conf10 > _thr10
|
| 2873 |
-
is_danger10 = lbl10 in _DANGER10 and conf10 > _thr10
|
| 2874 |
# إذا لم يكن خطراً وثقة top-1 منخفضة → نعرض آمن
|
| 2875 |
if not is_danger10 and conf10 < 0.60 and lbl10 in _DANGER10:
|
| 2876 |
lbl10 = 'safe_normal'
|
| 2877 |
bg10 = '#FFEBEE' if is_danger10 else ('#FFF8E1' if 'suspicious' in lbl10 else '#E8F5E9')
|
|
|
|
| 2878 |
clr10 = '#B71C1C' if is_danger10 else ('#F57F17' if 'suspicious' in lbl10 else '#1B5E20')
|
| 2879 |
icon10= '🚨' if is_danger10 else ('⚠️' if 'suspicious' in lbl10 else '✅')
|
| 2880 |
alert10 = f"<div style='background:#B71C1C;color:white;padding:6px 10px;border-radius:6px;font-size:13px;margin-top:6px;'>🚨 تحذير: {ar10} — يحتاج فحص فوري!</div>" if is_danger10 else ""
|
|
|
|
| 1 |
+
# SONAR-AI v18.2 fix ar10 — 2026-03-31 21:41:08
|
| 2 |
import sys
|
| 3 |
import types
|
| 4 |
|
|
|
|
| 2870 |
}
|
| 2871 |
_thr10 = _ALERT_THR.get(lbl10, 0.75)
|
| 2872 |
is_danger10 = lbl10 in _DANGER10 and conf10 > _thr10
|
|
|
|
| 2873 |
# إذا لم يكن خطراً وثقة top-1 منخفضة → نعرض آمن
|
| 2874 |
if not is_danger10 and conf10 < 0.60 and lbl10 in _DANGER10:
|
| 2875 |
lbl10 = 'safe_normal'
|
| 2876 |
bg10 = '#FFEBEE' if is_danger10 else ('#FFF8E1' if 'suspicious' in lbl10 else '#E8F5E9')
|
| 2877 |
+
ar10 = V10_AR.get(lbl10, lbl10)
|
| 2878 |
clr10 = '#B71C1C' if is_danger10 else ('#F57F17' if 'suspicious' in lbl10 else '#1B5E20')
|
| 2879 |
icon10= '🚨' if is_danger10 else ('⚠️' if 'suspicious' in lbl10 else '✅')
|
| 2880 |
alert10 = f"<div style='background:#B71C1C;color:white;padding:6px 10px;border-radius:6px;font-size:13px;margin-top:6px;'>🚨 تحذير: {ar10} — يحتاج فحص فوري!</div>" if is_danger10 else ""
|