Update src/streamlit_app.py
Browse files- src/streamlit_app.py +3 -7
src/streamlit_app.py
CHANGED
|
@@ -4,18 +4,14 @@ import tensorflow as tf
|
|
| 4 |
from PIL import Image
|
| 5 |
import os
|
| 6 |
|
| 7 |
-
|
| 8 |
-
MODEL_PATH =
|
| 9 |
|
| 10 |
st.set_page_config(
|
| 11 |
page_title="Facial Keypoints Detection",
|
| 12 |
layout="centered"
|
| 13 |
)
|
| 14 |
|
| 15 |
-
st.write("Files in current directory:")
|
| 16 |
-
st.write(os.listdir(BASE_DIR))
|
| 17 |
-
|
| 18 |
-
|
| 19 |
@st.cache_resource
|
| 20 |
def load_model():
|
| 21 |
return tf.keras.models.load_model(
|
|
@@ -26,9 +22,9 @@ def load_model():
|
|
| 26 |
st.title("Facial Keypoints Detection")
|
| 27 |
st.write("Upload a face image and the model will predict facial keypoints.")
|
| 28 |
|
| 29 |
-
|
| 30 |
model = load_model()
|
| 31 |
|
|
|
|
| 32 |
uploaded_file = st.file_uploader(
|
| 33 |
"Upload an image",
|
| 34 |
type=["jpg", "png", "jpeg"]
|
|
|
|
| 4 |
from PIL import Image
|
| 5 |
import os
|
| 6 |
|
| 7 |
+
# 👇 HIER PLAATSEN (boven load_model)
|
| 8 |
+
MODEL_PATH = "/app/src/facial_keypoints_resnet.h5"
|
| 9 |
|
| 10 |
st.set_page_config(
|
| 11 |
page_title="Facial Keypoints Detection",
|
| 12 |
layout="centered"
|
| 13 |
)
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
@st.cache_resource
|
| 16 |
def load_model():
|
| 17 |
return tf.keras.models.load_model(
|
|
|
|
| 22 |
st.title("Facial Keypoints Detection")
|
| 23 |
st.write("Upload a face image and the model will predict facial keypoints.")
|
| 24 |
|
|
|
|
| 25 |
model = load_model()
|
| 26 |
|
| 27 |
+
|
| 28 |
uploaded_file = st.file_uploader(
|
| 29 |
"Upload an image",
|
| 30 |
type=["jpg", "png", "jpeg"]
|