Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
|
|
|
| 51 |
|
| 52 |
# Define the Gradio interface
|
| 53 |
iface = gr.Interface(
|
| 54 |
fn=predict_teeth_health,
|
| 55 |
inputs=gr.Image(type="pil"),
|
| 56 |
-
outputs="
|
| 57 |
-
title="<h1 style='color: lightgreen; text-align: center;'>Dentella</h1><p style='text-align: center; color: skyblue; font-size:
|
| 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)
|