freunsev commited on
Commit
54d7424
·
verified ·
1 Parent(s): 1f818b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -12,7 +12,7 @@ model = tf.keras.models.load_model(model_path)
12
  # Define the core prediction function
13
  def predict_skin(image):
14
  # Preprocess image
15
- image = image.resize((450, 450)) # Resize the image to 150x150
16
  image = image.convert('RGB') # Ensure image has 3 channels
17
  image = np.array(image)
18
  image = np.expand_dims(image, axis=0) # Add batch dimension
@@ -30,8 +30,11 @@ def predict_skin(image):
30
  return probabilities_dict
31
 
32
  # Streamlit interface
33
- st.title("Skin disease classifier")
34
- st.write("Choose a picture:")
 
 
 
35
 
36
  # Upload image
37
  uploaded_image = st.file_uploader("Choose an image...", type=["jpg", "png"])
@@ -45,7 +48,7 @@ if uploaded_image is not None:
45
  predictions = predict_skin(image)
46
 
47
  # Display predictions as a DataFrame
48
- st.write("### Prediction Probabilities")
49
  df = pd.DataFrame(predictions.items(), columns=["Condition", "Probability"])
50
  st.dataframe(df)
51
 
 
12
  # Define the core prediction function
13
  def predict_skin(image):
14
  # Preprocess image
15
+ image = image.resize((450, 450)) # Resize the image to 450x450
16
  image = image.convert('RGB') # Ensure image has 3 channels
17
  image = np.array(image)
18
  image = np.expand_dims(image, axis=0) # Add batch dimension
 
30
  return probabilities_dict
31
 
32
  # Streamlit interface
33
+ st.title("Skin disease detection")
34
+ st.write(" The Skin Disease Detector is a prototype and should not be used as the sole method for diagnosing skin diseases. For accurate diagnosis and treatment, please consult a trained medical professional. This tool is intended for preliminary screening purposes only and should not replace professional medical advice.")
35
+ st.write("")
36
+ st.write("Accurate classification works best if you provide a clear and close-up image with natural lighting.")
37
+ st.write("")
38
 
39
  # Upload image
40
  uploaded_image = st.file_uploader("Choose an image...", type=["jpg", "png"])
 
48
  predictions = predict_skin(image)
49
 
50
  # Display predictions as a DataFrame
51
+ st.write("### Probabilities")
52
  df = pd.DataFrame(predictions.items(), columns=["Condition", "Probability"])
53
  st.dataframe(df)
54