Spaces:
Sleeping
Sleeping
Update pages/Entorno de Ejecución.py
Browse files
pages/Entorno de Ejecución.py
CHANGED
|
@@ -141,8 +141,14 @@ with vit:
|
|
| 141 |
with st.spinner('Cargando predicción...'):
|
| 142 |
classifier = pipeline("image-classification", model="frncscp/patacoptimus-prime")
|
| 143 |
img = preprocess(uploaded_file, module = 'pil')
|
| 144 |
-
|
| 145 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 146 |
if round(float(y_gorrito*100)) >= threshold:
|
| 147 |
st.success("¡Patacón Detectado!")
|
| 148 |
else:
|
|
@@ -188,7 +194,7 @@ with zero_shot:
|
|
| 188 |
|
| 189 |
for clase in zs_classifier:
|
| 190 |
if clase['label'] == 'A yellow deep fried smashed plantain':
|
| 191 |
-
y_gorrito =
|
| 192 |
|
| 193 |
if round(float(y_gorrito*100)) >= threshold:
|
| 194 |
st.success("¡Patacón Detectado!")
|
|
|
|
| 141 |
with st.spinner('Cargando predicción...'):
|
| 142 |
classifier = pipeline("image-classification", model="frncscp/patacoptimus-prime")
|
| 143 |
img = preprocess(uploaded_file, module = 'pil')
|
| 144 |
+
|
| 145 |
+
classifier = classifier(img)
|
| 146 |
+
|
| 147 |
+
for clase in classifier:
|
| 148 |
+
if clase['label'] == 'Patacón-True':
|
| 149 |
+
y_gorrito = clase["score"]
|
| 150 |
+
|
| 151 |
+
#y_gorrito = classifier[0]["score"]
|
| 152 |
if round(float(y_gorrito*100)) >= threshold:
|
| 153 |
st.success("¡Patacón Detectado!")
|
| 154 |
else:
|
|
|
|
| 194 |
|
| 195 |
for clase in zs_classifier:
|
| 196 |
if clase['label'] == 'A yellow deep fried smashed plantain':
|
| 197 |
+
y_gorrito = clase["score"]
|
| 198 |
|
| 199 |
if round(float(y_gorrito*100)) >= threshold:
|
| 200 |
st.success("¡Patacón Detectado!")
|