Ethium commited on
Commit
8248a35
1 Parent(s): 4eefd61

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
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
- # Final decision logic here, if applicable
 
 
 
 
 
 
 
46
 
47
  return "\n".join(detailed_predictions)
48
 
49
- # Define the Gradio interface inputs without using 'optional=True'
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