Spaces:
Paused
Paused
correction global incertaainty en mode single
Browse files- app/__pycache__/voting.cpython-312.pyc +0 -0
- app/voting.py +5 -1
app/__pycache__/voting.cpython-312.pyc
CHANGED
|
Binary files a/app/__pycache__/voting.cpython-312.pyc and b/app/__pycache__/voting.cpython-312.pyc differ
|
|
|
app/voting.py
CHANGED
|
@@ -98,7 +98,11 @@ async def soft_voting(model_configs,image_bytes: bytes,mode,show_heatmap):
|
|
| 98 |
final_confidence = float(mean_probs[final_class])
|
| 99 |
entropy=float(compute_entropy_safe(mean_probs))
|
| 100 |
jsd_score = float(compute_js_divergence(all_probs))
|
| 101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
logger.info(f"✅ Vote terminé : classe={final_class}"
|
| 103 |
f"confiance={final_confidence:.4f}\n"
|
| 104 |
f"entropy={entropy:.4f}\n"
|
|
|
|
| 98 |
final_confidence = float(mean_probs[final_class])
|
| 99 |
entropy=float(compute_entropy_safe(mean_probs))
|
| 100 |
jsd_score = float(compute_js_divergence(all_probs))
|
| 101 |
+
if mode=='single':
|
| 102 |
+
is_global_uncertain=models_uncertainties[0]
|
| 103 |
+
else:
|
| 104 |
+
is_global_uncertain = any(models_uncertainties) and jsd_score > shannon_threashold
|
| 105 |
+
|
| 106 |
logger.info(f"✅ Vote terminé : classe={final_class}"
|
| 107 |
f"confiance={final_confidence:.4f}\n"
|
| 108 |
f"entropy={entropy:.4f}\n"
|