anky2002 commited on
Commit
ae25c7c
Β·
verified Β·
1 Parent(s): 6845e7a

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -423,6 +423,15 @@ def analyze_image(img):
423
  bg = "linear-gradient(135deg, #28a745, #218838)"
424
  icon = "βœ…"
425
 
 
 
 
 
 
 
 
 
 
426
  verdict_html = f"""
427
  <div style="background:{bg}; color:white; padding:24px; border-radius:16px;
428
  text-align:center; font-family:Inter,sans-serif; box-shadow: 0 4px 15px rgba(0,0,0,0.2);">
@@ -432,6 +441,9 @@ def analyze_image(img):
432
  <div style="font-size:14px; opacity:0.9; margin-top:4px;">
433
  Confidence: {verdict.confidence} | Agents: {len([a for a in agent_results if a.failure_prob < 0.8])}/7 active
434
  </div>
 
 
 
435
  </div>
436
  """
437
 
 
423
  bg = "linear-gradient(135deg, #28a745, #218838)"
424
  icon = "βœ…"
425
 
426
+ # Get modality info for display
427
+ mod_info = verdict.reasoning_tree.get("modality", {})
428
+ mod_name = mod_info.get("detected", "UNKNOWN")
429
+ mod_conf = mod_info.get("confidence", 0)
430
+ mod_adj = mod_info.get("adjustments_applied", 0)
431
+ mod_label = {"PORTRAIT_MODE": "πŸ“± Portrait Mode", "MESSAGING": "πŸ’¬ Messaging App",
432
+ "SMARTPHONE": "πŸ“± Smartphone", "SCREENSHOT": "πŸ–₯️ Screenshot",
433
+ "DSLR": "πŸ“· DSLR", "UNKNOWN": "❓ Unknown"}.get(mod_name, mod_name)
434
+
435
  verdict_html = f"""
436
  <div style="background:{bg}; color:white; padding:24px; border-radius:16px;
437
  text-align:center; font-family:Inter,sans-serif; box-shadow: 0 4px 15px rgba(0,0,0,0.2);">
 
441
  <div style="font-size:14px; opacity:0.9; margin-top:4px;">
442
  Confidence: {verdict.confidence} | Agents: {len([a for a in agent_results if a.failure_prob < 0.8])}/7 active
443
  </div>
444
+ <div style="font-size:12px; opacity:0.7; margin-top:6px; border-top:1px solid rgba(255,255,255,0.2); padding-top:6px;">
445
+ Modality: {mod_label} ({mod_conf:.0%}) | {mod_adj} test(s) recalibrated
446
+ </div>
447
  </div>
448
  """
449