Update app.py
Browse files
app.py
CHANGED
|
@@ -2,6 +2,11 @@ import gradio as gr
|
|
| 2 |
from PIL import Image
|
| 3 |
import numpy as np
|
| 4 |
import tensorflow as tf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
# Configuraci贸n inicial
|
| 7 |
cifar10_labels = [
|
|
@@ -62,7 +67,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=".example-image {margin: auto; displa
|
|
| 62 |
show_label=True
|
| 63 |
)
|
| 64 |
|
| 65 |
-
#
|
| 66 |
gr.Markdown("## Ejemplos de categor铆as")
|
| 67 |
with gr.Column():
|
| 68 |
# Primera fila
|
|
@@ -71,7 +76,6 @@ with gr.Blocks(theme=gr.themes.Soft(), css=".example-image {margin: auto; displa
|
|
| 71 |
with gr.Column(min_width=150):
|
| 72 |
gr.Image(
|
| 73 |
examples[i][0],
|
| 74 |
-
tool="select",
|
| 75 |
label=cifar10_labels[i].capitalize(),
|
| 76 |
height=120,
|
| 77 |
width=120,
|
|
@@ -83,7 +87,6 @@ with gr.Blocks(theme=gr.themes.Soft(), css=".example-image {margin: auto; displa
|
|
| 83 |
with gr.Column(min_width=150):
|
| 84 |
gr.Image(
|
| 85 |
examples[i][0],
|
| 86 |
-
tool="select",
|
| 87 |
label=cifar10_labels[i].capitalize(),
|
| 88 |
height=120,
|
| 89 |
width=120,
|
|
|
|
| 2 |
from PIL import Image
|
| 3 |
import numpy as np
|
| 4 |
import tensorflow as tf
|
| 5 |
+
import os
|
| 6 |
+
|
| 7 |
+
# Configurar variables de entorno para reducir advertencias
|
| 8 |
+
os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0'
|
| 9 |
+
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
|
| 10 |
|
| 11 |
# Configuraci贸n inicial
|
| 12 |
cifar10_labels = [
|
|
|
|
| 67 |
show_label=True
|
| 68 |
)
|
| 69 |
|
| 70 |
+
# Secci贸n de ejemplos en 2 filas de 5 columnas
|
| 71 |
gr.Markdown("## Ejemplos de categor铆as")
|
| 72 |
with gr.Column():
|
| 73 |
# Primera fila
|
|
|
|
| 76 |
with gr.Column(min_width=150):
|
| 77 |
gr.Image(
|
| 78 |
examples[i][0],
|
|
|
|
| 79 |
label=cifar10_labels[i].capitalize(),
|
| 80 |
height=120,
|
| 81 |
width=120,
|
|
|
|
| 87 |
with gr.Column(min_width=150):
|
| 88 |
gr.Image(
|
| 89 |
examples[i][0],
|
|
|
|
| 90 |
label=cifar10_labels[i].capitalize(),
|
| 91 |
height=120,
|
| 92 |
width=120,
|