Spaces:
Runtime error
Runtime error
Commit
•
cd78198
1
Parent(s):
f1e3cf2
Update app.py
Browse files
app.py
CHANGED
@@ -37,18 +37,20 @@ def main():
|
|
37 |
with open(image_file, 'wb') as f:
|
38 |
f.write(uploaded_file.getbuffer())
|
39 |
predicted_class = predict_breed(image_file)
|
40 |
-
st.image(uploaded_file, caption=
|
|
|
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:
|
48 |
f.write(uploaded_file.getbuffer())
|
49 |
predicted_class = predict_breed(image_file)
|
50 |
-
st.image(uploaded_file, caption=
|
51 |
-
|
|
|
52 |
|
53 |
if __name__ == '__main__':
|
54 |
main()
|
|
|
37 |
with open(image_file, 'wb') as f:
|
38 |
f.write(uploaded_file.getbuffer())
|
39 |
predicted_class = predict_breed(image_file)
|
40 |
+
st.image(uploaded_file, caption='', use_column_width=True)
|
41 |
+
st.write(f'Predicted class: **{predicted_class}**', unsafe_allow_html=True)
|
42 |
|
43 |
# Add a button to trigger image upload
|
44 |
+
if st.button('Upload and Predict '):
|
45 |
uploaded_file = st.file_uploader('Choose an image of a dog', key='file_uploader_2', type=['jpg', 'jpeg', 'png'])
|
46 |
if uploaded_file is not None:
|
47 |
image_file = uploaded_file.name
|
48 |
with open(image_file, 'wb') as f:
|
49 |
f.write(uploaded_file.getbuffer())
|
50 |
predicted_class = predict_breed(image_file)
|
51 |
+
st.image(uploaded_file, caption='', use_column_width=True)
|
52 |
+
st.write(f'Predicted class: **{predicted_class}**', unsafe_allow_html=True)
|
53 |
+
|
54 |
|
55 |
if __name__ == '__main__':
|
56 |
main()
|