Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
17 |
-
|
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 |
|