jableable commited on
Commit
2fcfc85
·
verified ·
1 Parent(s): 66f8933

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -9
app.py CHANGED
@@ -12,15 +12,9 @@ uploaded_img = st.file_uploader("Upload your file here...",type=['png', 'jpeg',
12
 
13
  if uploaded_img is not None:
14
  st.image(uploaded_img)
15
- img = Image.open(uploaded_img)
16
- print(img.mode)
17
- resized_img = img.resize((160,160))
18
- print(resized_img.mode)
19
- input_arr = keras.preprocessing.image.img_to_array(resized_img)
20
- print(input_arr.shape)
21
- input_arr = input_arr.astype('float32') / 255.
22
- print(input_arr.shape)
23
- result = loaded_model.predict(input_arr)
24
  st.write(f"Your prediction is: {result}")
25
 
26
 
 
12
 
13
  if uploaded_img is not None:
14
  st.image(uploaded_img)
15
+ img = Image.open(uploaded_img).resize((160, 160), Image.ANTIALIAS)
16
+ img = np.array(img)
17
+ result = model.predict(img[None,:,:])
 
 
 
 
 
 
18
  st.write(f"Your prediction is: {result}")
19
 
20