Spaces:
Restarting
Restarting
Update pages/Entorno de Ejecución.py
Browse files
pages/Entorno de Ejecución.py
CHANGED
@@ -141,12 +141,12 @@ with vit:
|
|
141 |
uploaded_file = st.file_uploader(key = 'ViT_upload', label = 'Sube la imagen a clasificar',type= ['jpg','png', 'jpeg', 'jfif', 'webp', 'heic'])
|
142 |
if st.button(key = 'ViT_button', label ='¿Hay un patacón en la imagen?'):
|
143 |
if uploaded_file is not None:
|
144 |
-
with st.spinner('Cargando predicción...', key = 'vitspinner')
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
else:
|
151 |
st.write("Asegúrate de haber subido correctamente la imagen.")
|
152 |
|
|
|
141 |
uploaded_file = st.file_uploader(key = 'ViT_upload', label = 'Sube la imagen a clasificar',type= ['jpg','png', 'jpeg', 'jfif', 'webp', 'heic'])
|
142 |
if st.button(key = 'ViT_button', label ='¿Hay un patacón en la imagen?'):
|
143 |
if uploaded_file is not None:
|
144 |
+
with st.spinner('Cargando predicción...', key = 'vitspinner'):
|
145 |
+
classifier = pipeline("image-classification", model="frncscp/patacoptimus-prime")
|
146 |
+
img = preprocess(uploaded_file, module = 'pil')
|
147 |
+
raw_img = img
|
148 |
+
img = cv2.resize(img, (IMAGE_WIDTH, IMAGE_HEIGHT))
|
149 |
+
classifier(img)
|
150 |
else:
|
151 |
st.write("Asegúrate de haber subido correctamente la imagen.")
|
152 |
|