VinayakMane47 commited on
Commit
f1e3cf2
1 Parent(s): 67d3aa0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -31,7 +31,7 @@ def predict_breed(image_file):
31
  # Create the Streamlit app
32
  def main():
33
  st.title('Dog Breed Classification')
34
- uploaded_file = st.file_uploader('Choose an image of a dog', type=['jpg', 'jpeg', 'png'])
35
  if uploaded_file is not None:
36
  image_file = uploaded_file.name
37
  with open(image_file, 'wb') as f:
@@ -40,8 +40,8 @@ def main():
40
  st.image(uploaded_file, caption=f'Predicted class: {predicted_class}', use_column_width=True)
41
 
42
  # Add a button to trigger image upload
43
- if st.button('Upload Image'):
44
- uploaded_file = st.file_uploader('Choose an image of a dog', type=['jpg', 'jpeg', 'png'])
45
  if uploaded_file is not None:
46
  image_file = uploaded_file.name
47
  with open(image_file, 'wb') as f:
 
31
  # Create the Streamlit app
32
  def main():
33
  st.title('Dog Breed Classification')
34
+ uploaded_file = st.file_uploader('Choose an image of a dog', key='file_uploader', type=['jpg', 'jpeg', 'png'])
35
  if uploaded_file is not None:
36
  image_file = uploaded_file.name
37
  with open(image_file, 'wb') as f:
 
40
  st.image(uploaded_file, caption=f'Predicted class: {predicted_class}', use_column_width=True)
41
 
42
  # Add a button to trigger image upload
43
+ if st.button('Upload and Predict'):
44
+ uploaded_file = st.file_uploader('Choose an image of a dog', key='file_uploader_2', type=['jpg', 'jpeg', 'png'])
45
  if uploaded_file is not None:
46
  image_file = uploaded_file.name
47
  with open(image_file, 'wb') as f: