Spaces:
Running
Running
Commit
·
c384497
1
Parent(s):
6cfb8a9
Update app.py
Browse files
app.py
CHANGED
@@ -28,12 +28,12 @@ opt = st.selectbox("How do you want to upload the image for classification?", ('
|
|
28 |
if opt == 'Upload image from device':
|
29 |
file = st.file_uploader('Select', type=['jpg', 'png', 'jpeg'])
|
30 |
if file is not None:
|
31 |
-
image =
|
32 |
|
33 |
elif opt == 'Upload image via link':
|
34 |
img_url = st.text_input('Enter the Image Address')
|
35 |
try:
|
36 |
-
image =
|
37 |
except ValueError:
|
38 |
st.error("Please Enter a valid Image Address!")
|
39 |
|
|
|
28 |
if opt == 'Upload image from device':
|
29 |
file = st.file_uploader('Select', type=['jpg', 'png', 'jpeg'])
|
30 |
if file is not None:
|
31 |
+
image = (file).resize((256, 256), Image.LANCZOS)
|
32 |
|
33 |
elif opt == 'Upload image via link':
|
34 |
img_url = st.text_input('Enter the Image Address')
|
35 |
try:
|
36 |
+
image = (urllib.request.urlopen(img_url)).resize((256, 256), Image.LANCZOS)
|
37 |
except ValueError:
|
38 |
st.error("Please Enter a valid Image Address!")
|
39 |
|