LEWOPO commited on
Commit
426784f
·
verified ·
1 Parent(s): 52a7c8b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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 = 'models/svm_model.pkl'
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("BMI Prediction from Camera Image")
47
- st.write("This app predicts the BMI of a person from an image captured using the camera.")
48
 
49
  # Capture an image from the camera using streamlit-media's camera_input function
50
- img_file_buffer = st.camera_input("Take a picture")
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("Predicted BMI:", str(bmi_label[0] - 5))
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()