Ercik commited on
Commit
dd82563
verified
1 Parent(s): e73892d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
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
- # Convert the PIL Image object to a NumPy array
24
- image = np.array(image)/255.0
25
 
26
- image = np.expand_dims(image,axis=0)
 
 
27
 
28
  # Make a prediction
29
- prediction = model.predict(image)
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)