Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import tensorflow as tf
|
3 |
+
|
4 |
+
st.title("Skin Disease Classification App")
|
5 |
+
|
6 |
+
# Load model
|
7 |
+
model = tf.keras.models.load_model('TvachaAI.h5')
|
8 |
+
|
9 |
+
# Create sidebar for uploading images
|
10 |
+
st.sidebar.title("Upload Image")
|
11 |
+
image = st.sidebar.file_uploader("Upload an image", type=['png', 'jpg'])
|
12 |
+
|
13 |
+
if image is not None:
|
14 |
+
|
15 |
+
# Process & predict
|
16 |
+
img = process_image(image)
|
17 |
+
preds = model.predict(img)
|
18 |
+
|
19 |
+
# Display image & predictions
|
20 |
+
st.image(img, use_column_width=True)
|
21 |
+
st.write(f"Prediction: {decode_predictions(preds)}")
|