JKrishnanandhaa commited on
Commit
79c5cdc
·
verified ·
1 Parent(s): c7fb6fa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +40 -34
app.py CHANGED
@@ -397,40 +397,46 @@ with gr.Blocks(css=custom_css) as demo:
397
  value="<i>No analysis yet. Upload a document and click Analyze.</i>"
398
  )
399
 
400
- gr.Markdown("### Model Performance")
401
- gr.HTML(
402
- f"""
403
- <div style='padding:12px; border:1px solid #444; border-radius:10px; background:var(--background-fill-primary);'>
404
- <p style='margin-top:0; margin-bottom:12px;'><b>Trained Model Performance:</b></p>
405
-
406
- <b>Segmentation Dice:</b>
407
- <div style='width:100%; background:#333; height:12px; border-radius:6px; margin-bottom:12px;'>
408
- <div style='width:{MODEL_METRICS['segmentation']['dice']*100:.1f}%; background:#4169E1; height:12px; border-radius:6px;'></div>
409
- </div>
410
-
411
- <b>Classification Accuracy:</b>
412
- <div style='width:100%; background:#333; height:12px; border-radius:6px; margin-bottom:6px;'>
413
- <div style='width:{MODEL_METRICS['classification']['overall_accuracy']*100:.1f}%; background:#5cb85c; height:12px; border-radius:6px;'></div>
414
- </div>
415
-
416
- <small style='opacity:0.8;'>
417
- Dice: {MODEL_METRICS['segmentation']['dice']*100:.1f}% |
418
- IoU: {MODEL_METRICS['segmentation']['iou']*100:.1f}% |
419
- Accuracy: {MODEL_METRICS['classification']['overall_accuracy']*100:.1f}%
420
- </small>
421
- </div>
422
- """
423
- )
424
-
425
- gr.Markdown(
426
- """
427
- ---
428
- **Model Architecture:**
429
- - **Localization:** MobileNetV3-Small + UNet (Dice: 62.1%, IoU: 45.1%)
430
- - **Classification:** LightGBM with 526 features (Accuracy: 88.97%)
431
- - **Training:** 140K samples (DocTamper + SCD + FCD datasets)
432
- """
433
- )
 
 
 
 
 
 
434
 
435
  # Event handlers
436
  analyze_btn.click(
 
397
  value="<i>No analysis yet. Upload a document and click Analyze.</i>"
398
  )
399
 
400
+ with gr.Row():
401
+ with gr.Column(scale=1):
402
+ gr.Markdown("### Model Performance")
403
+ gr.HTML(
404
+ f"""
405
+ <div style='padding:12px; border:1px solid #444; border-radius:10px; background:var(--background-fill-primary);'>
406
+ <p style='margin-top:0; margin-bottom:12px;'><b>Trained Model Performance:</b></p>
407
+
408
+ <b>Segmentation Dice:</b>
409
+ <div style='width:100%; background:#333; height:12px; border-radius:6px; margin-bottom:12px;'>
410
+ <div style='width:{MODEL_METRICS['segmentation']['dice']*100:.1f}%; background:#4169E1; height:12px; border-radius:6px;'></div>
411
+ </div>
412
+
413
+ <b>Classification Accuracy:</b>
414
+ <div style='width:100%; background:#333; height:12px; border-radius:6px; margin-bottom:6px;'>
415
+ <div style='width:{MODEL_METRICS['classification']['overall_accuracy']*100:.1f}%; background:#5cb85c; height:12px; border-radius:6px;'></div>
416
+ </div>
417
+
418
+ <small style='opacity:0.8;'>
419
+ Dice: {MODEL_METRICS['segmentation']['dice']*100:.1f}% |
420
+ IoU: {MODEL_METRICS['segmentation']['iou']*100:.1f}% |
421
+ Accuracy: {MODEL_METRICS['classification']['overall_accuracy']*100:.1f}%
422
+ </small>
423
+ </div>
424
+ """
425
+ )
426
+
427
+ with gr.Column(scale=1):
428
+ gr.Markdown("### Model Architecture")
429
+ gr.Markdown(
430
+ """
431
+ **Localization:** MobileNetV3-Small + UNet
432
+ - Dice: 62.1% | IoU: 45.1%
433
+
434
+ **Classification:** LightGBM with 526 features
435
+ - Accuracy: 88.97%
436
+
437
+ **Training:** 140K samples from DocTamper dataset
438
+ """
439
+ )
440
 
441
  # Event handlers
442
  analyze_btn.click(