Spaces:
Sleeping
Sleeping
devjas1
commited on
Commit
·
6926d1c
1
Parent(s):
2132d97
(FEAT): Enhance display of batch results with improved layout and expanded sections for successful results
Browse files- .gitignore +2 -0
- utils/multifile.py +23 -21
.gitignore
CHANGED
@@ -10,6 +10,7 @@ __pycache__/
|
|
10 |
*.env
|
11 |
*.yml
|
12 |
*.json
|
|
|
13 |
.streamlit
|
14 |
outputs/logs/
|
15 |
docs/PROJECT_REPORT.md
|
@@ -17,6 +18,7 @@ wea-*.txt
|
|
17 |
sta-*.txt
|
18 |
S3PR.md
|
19 |
|
|
|
20 |
# --- Data (keep folder, ignore files) ---
|
21 |
datasets/**
|
22 |
!datasets/.gitkeep
|
|
|
10 |
*.env
|
11 |
*.yml
|
12 |
*.json
|
13 |
+
*.sh
|
14 |
.streamlit
|
15 |
outputs/logs/
|
16 |
docs/PROJECT_REPORT.md
|
|
|
18 |
sta-*.txt
|
19 |
S3PR.md
|
20 |
|
21 |
+
|
22 |
# --- Data (keep folder, ignore files) ---
|
23 |
datasets/**
|
24 |
!datasets/.gitkeep
|
utils/multifile.py
CHANGED
@@ -305,7 +305,7 @@ def display_batch_results(results: List[Dict[str, Any]]) -> None:
|
|
305 |
failed = [r for r in results if not r.get("success", False)]
|
306 |
|
307 |
# ==Summary==
|
308 |
-
col1, col2, col3 = st.columns(3)
|
309 |
with col1:
|
310 |
st.metric("Total Files", len(results))
|
311 |
with col2:
|
@@ -316,28 +316,30 @@ def display_batch_results(results: List[Dict[str, Any]]) -> None:
|
|
316 |
failed), delta=f"-{len(failed)/len(results)*100:.1f}%" if failed else "0%")
|
317 |
|
318 |
# ==Results tabs==
|
319 |
-
tab1, tab2 = st.tabs(["✅Successful", "❌ Failed"])
|
320 |
|
321 |
with tab1:
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
|
|
|
|
341 |
|
342 |
with tab2:
|
343 |
if failed:
|
|
|
305 |
failed = [r for r in results if not r.get("success", False)]
|
306 |
|
307 |
# ==Summary==
|
308 |
+
col1, col2, col3 = st.columns(3, border=True)
|
309 |
with col1:
|
310 |
st.metric("Total Files", len(results))
|
311 |
with col2:
|
|
|
316 |
failed), delta=f"-{len(failed)/len(results)*100:.1f}%" if failed else "0%")
|
317 |
|
318 |
# ==Results tabs==
|
319 |
+
tab1, tab2 = st.tabs(["✅Successful", "❌ Failed"], width="stretch")
|
320 |
|
321 |
with tab1:
|
322 |
+
with st.expander("Successful"):
|
323 |
+
if successful:
|
324 |
+
for result in successful:
|
325 |
+
with st.expander(f"{result['filename']}", expanded=False):
|
326 |
+
col1, col2 = st.columns(2)
|
327 |
+
with col1:
|
328 |
+
st.write(
|
329 |
+
f"**Prediction:** {result['predicted_class']}")
|
330 |
+
st.write(
|
331 |
+
f"**Confidence:** {result['confidence_emoji']} {result['confidence_level']} ({result['confidence']:.3f})")
|
332 |
+
with col2:
|
333 |
+
st.write(
|
334 |
+
f"**Processing Time:** {result['processing_time']:.3f}s")
|
335 |
+
if result['ground_truth'] is not None:
|
336 |
+
gt_label = {0: "Stable", 1: "Weathered"}.get(
|
337 |
+
result['ground_truth'], "Unknown")
|
338 |
+
correct = "✅" if result['prediction'] == result['ground_truth'] else "❌"
|
339 |
+
st.write(
|
340 |
+
f"**Ground Truth:** {gt_label} {correct}")
|
341 |
+
else:
|
342 |
+
st.info("No successful results")
|
343 |
|
344 |
with tab2:
|
345 |
if failed:
|