OmarEllethy commited on
Commit
9d55adb
1 Parent(s): 92883dd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -43,20 +43,20 @@ def predict_teeth_health(image):
43
  # Get the probability of being 'Good'
44
  probability_good = prediction[0][0] # Assuming it's a binary classification
45
 
46
- # Return the predicted class name
47
- if probability_good > 0.5:
48
- return "Predicted: Your Teeth are Good & You Don't Need To Visit Doctor"
49
- else:
50
- return "Predicted: Your Teeth are Bad & You Need To Visit Doctor"
 
51
 
52
  # Define the Gradio interface
53
  iface = gr.Interface(
54
  fn=predict_teeth_health,
55
  inputs=gr.Image(type="pil"),
56
- outputs="text",
57
- title="<h1 style='color: lightgreen; text-align: center;'>Dentella</h1><p style='text-align: center; color: skyblue; font-size: 25px;'>Please Enter Your Teeth Here...</p>",
58
  )
59
 
60
-
61
  # Deploy the Gradio interface using Gradio's hosting service
62
  iface.launch(share=True)
 
43
  # Get the probability of being 'Good'
44
  probability_good = prediction[0][0] # Assuming it's a binary classification
45
 
46
+ # Define the prediction result
47
+ result = {
48
+ "prediction": "Your Teeth are Good & You Don't Need To Visit Doctor" if probability_good > 0.5 else "Your Teeth are Bad & You Need To Visit Doctor"
49
+ }
50
+
51
+ return result
52
 
53
  # Define the Gradio interface
54
  iface = gr.Interface(
55
  fn=predict_teeth_health,
56
  inputs=gr.Image(type="pil"),
57
+ outputs="json",
58
+ title="<h1 style='color: lightgreen; text-align: center;'>Dentella</h1><p style='text-align: center; color: skyblue; font-size: 30px;'>Please Enter Your Teeth Here...</p>",
59
  )
60
 
 
61
  # Deploy the Gradio interface using Gradio's hosting service
62
  iface.launch(share=True)