Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -42,11 +42,18 @@ def classify_images(img_ultrasound, img_oct, img_fundus, img_fluorescence):
|
|
42 |
else:
|
43 |
detailed_predictions.append(f"{key}: No image provided")
|
44 |
|
45 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
return "\n".join(detailed_predictions)
|
48 |
|
49 |
-
# Define the Gradio interface inputs
|
50 |
inputs = [gr.Image(label=f"{modality} Image") for modality in modality_keys]
|
51 |
output = gr.Text(label="Predictions")
|
52 |
|
|
|
42 |
else:
|
43 |
detailed_predictions.append(f"{key}: No image provided")
|
44 |
|
45 |
+
# Calculate the final decision based on provided predictions
|
46 |
+
if predictions:
|
47 |
+
final_decision_count = max(set(predictions), key=predictions.count)
|
48 |
+
final_decision = f"Final Decision: {final_decision_count} based on {len(predictions)} inputs."
|
49 |
+
else:
|
50 |
+
final_decision = "No final decision (Insufficient data)"
|
51 |
+
|
52 |
+
detailed_predictions.append(final_decision)
|
53 |
|
54 |
return "\n".join(detailed_predictions)
|
55 |
|
56 |
+
# Define the Gradio interface inputs
|
57 |
inputs = [gr.Image(label=f"{modality} Image") for modality in modality_keys]
|
58 |
output = gr.Text(label="Predictions")
|
59 |
|