Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -74,7 +74,16 @@ if uploaded_file is not None:
|
|
74 |
# Preprocess the image and perform inference
|
75 |
image_tensor, final_image = preprocess_image(image, device)
|
76 |
predicted_class, probabilities = predict(image_tensor, model, device)
|
77 |
-
|
78 |
st.write(f"Predicted class: {predicted_class.item()}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
# Display the final processed image
|
80 |
st.image(final_image, caption='Processed Image', use_column_width=True)
|
|
|
74 |
# Preprocess the image and perform inference
|
75 |
image_tensor, final_image = preprocess_image(image, device)
|
76 |
predicted_class, probabilities = predict(image_tensor, model, device)
|
77 |
+
# {'Dry': 0, 'Normal': 1, 'Oily': 2}
|
78 |
st.write(f"Predicted class: {predicted_class.item()}")
|
79 |
+
|
80 |
+
if predicted_class.item()==2:
|
81 |
+
st.write(f"Oily Skin : {probabilities[2]}")
|
82 |
+
elif predicted_class.item()==1:
|
83 |
+
st.write("Normal Skin : {probabilities[1]}")
|
84 |
+
elif predicted_class.item()==0:
|
85 |
+
st.write("Dry Skin : {probabilities[0]}")
|
86 |
+
st.write(f"probabilities: {probabilities}")
|
87 |
+
|
88 |
# Display the final processed image
|
89 |
st.image(final_image, caption='Processed Image', use_column_width=True)
|