Spaces:
Running
Running
Update pages/Entorno de Ejecución.py
Browse files
pages/Entorno de Ejecución.py
CHANGED
@@ -134,11 +134,11 @@ with vit:
|
|
134 |
with col_a:
|
135 |
st.title('Visual Transformer')
|
136 |
st.caption('One class is all you need!')
|
137 |
-
|
138 |
if st.button('¿Hay un patacón en la imagen?'):
|
139 |
-
if
|
140 |
classifier = pipeline("image-classification", model="frncscp/patacoptimus-prime")
|
141 |
-
img = preprocess(
|
142 |
raw_img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
143 |
img = cv2.resize(img, (IMAGE_WIDTH, IMAGE_HEIGHT))
|
144 |
classifier(img)
|
|
|
134 |
with col_a:
|
135 |
st.title('Visual Transformer')
|
136 |
st.caption('One class is all you need!')
|
137 |
+
uploaded_file_t = st.file_uploader(label = 'Sube la imagen a clasificar',type= ['jpg','png', 'jpeg', 'jfif', 'webp', 'heic'])
|
138 |
if st.button('¿Hay un patacón en la imagen?'):
|
139 |
+
if uploaded_file_t is not None:
|
140 |
classifier = pipeline("image-classification", model="frncscp/patacoptimus-prime")
|
141 |
+
img = preprocess(uploaded_file_t)
|
142 |
raw_img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
143 |
img = cv2.resize(img, (IMAGE_WIDTH, IMAGE_HEIGHT))
|
144 |
classifier(img)
|