Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -397,6 +397,8 @@ with gr.Blocks(css=custom_css) as demo:
|
|
| 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")
|
|
@@ -405,36 +407,32 @@ with gr.Blocks(css=custom_css) as demo:
|
|
| 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;
|
| 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.
|
| 430 |
"""
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
|
|
|
|
|
|
| 438 |
"""
|
| 439 |
)
|
| 440 |
|
|
|
|
| 397 |
value="<i>No analysis yet. Upload a document and click Analyze.</i>"
|
| 398 |
)
|
| 399 |
|
| 400 |
+
gr.Markdown("---")
|
| 401 |
+
|
| 402 |
with gr.Row():
|
| 403 |
with gr.Column(scale=1):
|
| 404 |
gr.Markdown("### Model Performance")
|
|
|
|
| 407 |
<div style='padding:12px; border:1px solid #444; border-radius:10px; background:var(--background-fill-primary);'>
|
| 408 |
<p style='margin-top:0; margin-bottom:12px;'><b>Trained Model Performance:</b></p>
|
| 409 |
|
| 410 |
+
<b>Segmentation Dice: {MODEL_METRICS['segmentation']['dice']*100:.2f}%</b>
|
| 411 |
<div style='width:100%; background:#333; height:12px; border-radius:6px; margin-bottom:12px;'>
|
| 412 |
<div style='width:{MODEL_METRICS['segmentation']['dice']*100:.1f}%; background:#4169E1; height:12px; border-radius:6px;'></div>
|
| 413 |
</div>
|
| 414 |
|
| 415 |
+
<b>Classification Accuracy: {MODEL_METRICS['classification']['overall_accuracy']*100:.2f}%</b>
|
| 416 |
+
<div style='width:100%; background:#333; height:12px; border-radius:6px;'>
|
| 417 |
<div style='width:{MODEL_METRICS['classification']['overall_accuracy']*100:.1f}%; background:#5cb85c; height:12px; border-radius:6px;'></div>
|
| 418 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 419 |
</div>
|
| 420 |
"""
|
| 421 |
)
|
| 422 |
|
| 423 |
with gr.Column(scale=1):
|
| 424 |
gr.Markdown("### Model Architecture")
|
| 425 |
+
gr.HTML(
|
| 426 |
"""
|
| 427 |
+
<div style='padding:12px; border:1px solid #444; border-radius:10px; background:var(--background-fill-primary);'>
|
| 428 |
+
<p style='margin-top:0; margin-bottom:8px;'><b>Localization:</b> MobileNetV3-Small + UNet</p>
|
| 429 |
+
<p style='margin:4px 0; font-size:0.9em;'>Dice: 62.12% | IoU: 45.06% | Precision: 70.77% | Recall: 55.36%</p>
|
| 430 |
+
|
| 431 |
+
<p style='margin-top:12px; margin-bottom:8px;'><b>Classification:</b> LightGBM with 526 features</p>
|
| 432 |
+
<p style='margin:4px 0; font-size:0.9em;'>Train Accuracy: 90.53% | Val Accuracy: 88.97%</p>
|
| 433 |
+
|
| 434 |
+
<p style='margin-top:12px; margin-bottom:0;'><b>Training:</b> 140K samples from DocTamper dataset</p>
|
| 435 |
+
</div>
|
| 436 |
"""
|
| 437 |
)
|
| 438 |
|