hungdang1610 commited on
Commit
bacdd82
1 Parent(s): e2a06e6

add upload image

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -70,7 +70,11 @@ with open("models/model.p", "rb") as f:
70
  st.markdown("<center><h1>Know Your BMI</h1></center>", unsafe_allow_html=True)
71
  st.caption("<center>Click a photo and the underlying Machine Learning model will predict your BMI</center>", unsafe_allow_html=True)
72
 
73
- img_file_buffer = st.camera_input("Click a photo and the underlying Machine Learning model will predict your BMI", label_visibility="hidden")
 
 
 
 
74
 
75
  if img_file_buffer is not None:
76
  # To read image file buffer as a PIL Image:
 
70
  st.markdown("<center><h1>Know Your BMI</h1></center>", unsafe_allow_html=True)
71
  st.caption("<center>Click a photo and the underlying Machine Learning model will predict your BMI</center>", unsafe_allow_html=True)
72
 
73
+ # img_file_buffer = st.camera_input("Click a photo and the underlying Machine Learning model will predict your BMI", label_visibility="hidden")
74
+
75
+ img_file_buffer = st.file_uploader("Upload an image", type=["jpg", "jpeg", "png"])
76
+ if img_file_buffer is None:
77
+ img_file_buffer = st.camera_input("Or click a photo", label_visibility="hidden")
78
 
79
  if img_file_buffer is not None:
80
  # To read image file buffer as a PIL Image: