Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ from tensorflow.keras.layers import GlobalAveragePooling2D
|
|
9 |
import numpy as np
|
10 |
import pickle
|
11 |
|
12 |
-
pickle_file_path = '
|
13 |
|
14 |
with open(pickle_file_path, 'rb') as file:
|
15 |
svm_model = pickle.load(file)
|
@@ -43,11 +43,11 @@ def predict_bmi(img):
|
|
43 |
return pred
|
44 |
|
45 |
def main():
|
46 |
-
st.title("
|
47 |
-
st.write("
|
48 |
|
49 |
# Capture an image from the camera using streamlit-media's camera_input function
|
50 |
-
img_file_buffer = st.camera_input("
|
51 |
|
52 |
if img_file_buffer is not None:
|
53 |
# Load the image data from the file buffer
|
@@ -58,7 +58,7 @@ def main():
|
|
58 |
bmi_label = predict_bmi(img)
|
59 |
|
60 |
# Display the predicted BMI
|
61 |
-
st.write("
|
62 |
|
63 |
if __name__ == '__main__':
|
64 |
main()
|
|
|
9 |
import numpy as np
|
10 |
import pickle
|
11 |
|
12 |
+
pickle_file_path = 'svm_model.pkl'
|
13 |
|
14 |
with open(pickle_file_path, 'rb') as file:
|
15 |
svm_model = pickle.load(file)
|
|
|
43 |
return pred
|
44 |
|
45 |
def main():
|
46 |
+
st.title("Prédiction de l'IMC à partir de l'image de la caméra")
|
47 |
+
st.write("Cette application prédit l'IMC d'une personne à partir d'une image capturée à l'aide de l'appareil photo.")
|
48 |
|
49 |
# Capture an image from the camera using streamlit-media's camera_input function
|
50 |
+
img_file_buffer = st.camera_input("Prendre une photo")
|
51 |
|
52 |
if img_file_buffer is not None:
|
53 |
# Load the image data from the file buffer
|
|
|
58 |
bmi_label = predict_bmi(img)
|
59 |
|
60 |
# Display the predicted BMI
|
61 |
+
st.write("IMC prédit ::", str(bmi_label[0] - 5))
|
62 |
|
63 |
if __name__ == '__main__':
|
64 |
main()
|