Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -18,17 +18,18 @@ if uploaded_image is not None:
|
|
18 |
|
19 |
# Convert the uploaded file to a PIL Image object
|
20 |
image = Image.open(uploaded_image).convert('RGB')
|
21 |
-
image = image.resize((178,218))
|
22 |
|
23 |
-
#
|
24 |
-
image =
|
25 |
|
26 |
-
|
|
|
|
|
27 |
|
28 |
# Make a prediction
|
29 |
-
prediction = model.predict(
|
30 |
|
31 |
# Display the prediction
|
32 |
st.write("La predicci贸n es:")
|
33 |
-
st.write(prediction)
|
34 |
-
|
|
|
18 |
|
19 |
# Convert the uploaded file to a PIL Image object
|
20 |
image = Image.open(uploaded_image).convert('RGB')
|
21 |
+
image = image.resize((178, 218))
|
22 |
|
23 |
+
# Display the uploaded image
|
24 |
+
st.image(image, caption="Imagen cargada", use_column_width=True)
|
25 |
|
26 |
+
# Convert the PIL Image object to a NumPy array
|
27 |
+
image_array = np.array(image) / 255.0
|
28 |
+
image_array = np.expand_dims(image_array, axis=0)
|
29 |
|
30 |
# Make a prediction
|
31 |
+
prediction = model.predict(image_array)
|
32 |
|
33 |
# Display the prediction
|
34 |
st.write("La predicci贸n es:")
|
35 |
+
st.write(prediction)
|
|