Spaces:
Runtime error
Runtime error
oomarsaldivar
commited on
Commit
·
d0204a6
1
Parent(s):
60ee93c
Update app.py
Browse files
app.py
CHANGED
@@ -124,20 +124,56 @@ def ejecutar_modelo(imagen_app):
|
|
124 |
if clase4[resultado4] != 'ausencia' and clase4[resultado4] != 'ninguno':
|
125 |
valor4 = ': ' + str(int(np.clip(np.round(modelo4v.predict(imagen_temporal) + 1)[0][0],1,5)))
|
126 |
|
127 |
-
return clase1[resultado1] + valor1,
|
128 |
-
|
129 |
|
|
|
130 |
# In[132]:
|
131 |
|
132 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
gui = gr.Interface (
|
|
|
134 |
fn = ejecutar_modelo,
|
135 |
-
inputs = gr.Image (),
|
136 |
-
outputs = [gr.Label(label='Contraste o armonía:'),
|
137 |
-
gr.Label(label='Fragmentación o unidad:'),
|
138 |
gr.Label(label='Inestabilidad o equilibrio:'),
|
|
|
139 |
gr.Label(label='Difusividad o agudeza:')],
|
140 |
-
title ='Evaluador de imágenes usando IA',
|
141 |
)
|
142 |
|
143 |
gui.launch(inbrowser = True)
|
|
|
124 |
if clase4[resultado4] != 'ausencia' and clase4[resultado4] != 'ninguno':
|
125 |
valor4 = ': ' + str(int(np.clip(np.round(modelo4v.predict(imagen_temporal) + 1)[0][0],1,5)))
|
126 |
|
127 |
+
return clase1[resultado1] + valor1, clase3[resultado3] + valor3, clase2[resultado2] + valor2, clase4[resultado4] + valor4
|
|
|
128 |
|
129 |
+
|
130 |
# In[132]:
|
131 |
|
132 |
|
133 |
+
theme1 = gr.themes.Base(
|
134 |
+
primary_hue = "emerald",
|
135 |
+
secondary_hue = "blue",
|
136 |
+
neutral_hue = "blue",
|
137 |
+
text_size = gr.themes.Size(xs='10px', sm='12px', md='14px', lg='16px', xl='22px', xxl='16px',xxs='9px'),
|
138 |
+
font = [gr.themes.GoogleFont('Supreme'), 'ui-sans-serif', 'system-ui', 'sans-serif'],
|
139 |
+
)
|
140 |
+
|
141 |
+
theme1.set(
|
142 |
+
body_background_fill = "#EDEFF0",
|
143 |
+
background_fill_primary = "#FFFFFF50",
|
144 |
+
background_fill_secondary = "#EDEFF000",
|
145 |
+
#background_fill_secondary = "#EDEFF0",
|
146 |
+
#azul omar #415DA1
|
147 |
+
|
148 |
+
body_text_size='12px',
|
149 |
+
button_primary_background_fill = "#3E67B7",
|
150 |
+
button_border_width = '*block_label_border_width',
|
151 |
+
button_primary_border_color = "#52A6AA",
|
152 |
+
button_primary_text_color = "#FFFFFF",
|
153 |
+
button_primary_background_fill_hover = "linear-gradient(90deg,#52A6AA,#3E67B7)",
|
154 |
+
button_primary_text_color_hover = "#FFFFFF",
|
155 |
+
|
156 |
+
button_secondary_background_fill = "#BDE0F9",
|
157 |
+
button_secondary_background_fill_hover = "#EDEFF0",
|
158 |
+
button_secondary_text_color_hover = "#4888D8",
|
159 |
+
|
160 |
+
block_border_width = "1.5px",
|
161 |
+
block_border_color = "#3E67B7",
|
162 |
+
|
163 |
+
block_radius = "0",
|
164 |
+
block_label_text_size = '12px',
|
165 |
+
input_text_size = '5px'
|
166 |
+
)
|
167 |
+
|
168 |
gui = gr.Interface (
|
169 |
+
theme = theme1,
|
170 |
fn = ejecutar_modelo,
|
171 |
+
inputs = gr.Image (label='Imagen'),
|
172 |
+
outputs = [gr.Label(label='Contraste o armonía:',elem_id = 'labelitem'),
|
|
|
173 |
gr.Label(label='Inestabilidad o equilibrio:'),
|
174 |
+
gr.Label(label='Fragmentación o unidad:'),
|
175 |
gr.Label(label='Difusividad o agudeza:')],
|
176 |
+
#title ='Evaluador de imágenes usando IA',
|
177 |
)
|
178 |
|
179 |
gui.launch(inbrowser = True)
|