frncscp commited on
Commit
4293bc4
·
1 Parent(s): 8839c56

Update pages/Entorno de Ejecución.py

Browse files
Files changed (1) hide show
  1. pages/Entorno de Ejecución.py +5 -2
pages/Entorno de Ejecución.py CHANGED
@@ -138,6 +138,7 @@ with vit:
138
  st.title('Visual Transformers')
139
  st.caption('One class is all you need!')
140
  uploaded_file = st.file_uploader(key = 'ViT_upload', label = 'Sube la imagen a clasificar',type= ['jpg','png', 'jpeg', 'jfif', 'webp', 'heic'])
 
141
  if st.button(key = 'ViT_button', label ='¿Hay un patacón en la imagen?'):
142
  if uploaded_file is not None:
143
  with st.spinner('Cargando predicción...'):
@@ -145,11 +146,13 @@ with vit:
145
  img = preprocess(uploaded_file, module = 'pil')
146
  raw_img = img
147
  img = cv2.resize(img, (IMAGE_WIDTH, IMAGE_HEIGHT))
 
148
  else:
149
  st.write("Asegúrate de haber subido correctamente la imagen.")
150
  with col_b:
151
- st.write(classifier(img))
152
- st.image(raw_img)
 
153
 
154
  with zero_shot:
155
  st.write('Próximamente')
 
138
  st.title('Visual Transformers')
139
  st.caption('One class is all you need!')
140
  uploaded_file = st.file_uploader(key = 'ViT_upload', label = 'Sube la imagen a clasificar',type= ['jpg','png', 'jpeg', 'jfif', 'webp', 'heic'])
141
+ flag = False
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...'):
 
146
  img = preprocess(uploaded_file, module = 'pil')
147
  raw_img = img
148
  img = cv2.resize(img, (IMAGE_WIDTH, IMAGE_HEIGHT))
149
+ flag = True
150
  else:
151
  st.write("Asegúrate de haber subido correctamente la imagen.")
152
  with col_b:
153
+ if flag:
154
+ st.write(classifier(img))
155
+ st.image(raw_img)
156
 
157
  with zero_shot:
158
  st.write('Próximamente')