Spaces:
Sleeping
Sleeping
Update app.py
Browse fileschanges in the image size
app.py
CHANGED
|
@@ -8,7 +8,7 @@ from PIL import Image
|
|
| 8 |
|
| 9 |
# --- 1. CONFIGURACIÓN ---
|
| 10 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 11 |
-
imsize =
|
| 12 |
|
| 13 |
# Transformación de entrada (Ahora redimensiona todo a imsize x imsize)
|
| 14 |
loader = transforms.Compose([
|
|
@@ -138,7 +138,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 138 |
c_weight = gr.Slider(minimum=0.1, maximum=10.0, value=1.0, step=0.1, label="Peso del Contenido (Estructura)")
|
| 139 |
s_weight = gr.Slider(minimum=1000, maximum=1000000, value=100000, step=1000, label="Peso del Estilo (Arte)")
|
| 140 |
tv_weight = gr.Slider(minimum=0, maximum=0.001, value=0.000001, step=0.000001, label="Suavizado (Variación Total)")
|
| 141 |
-
iters = gr.Slider(minimum=
|
| 142 |
|
| 143 |
run_btn = gr.Button("¡Mezclar Imágenes!", variant="primary")
|
| 144 |
|
|
|
|
| 8 |
|
| 9 |
# --- 1. CONFIGURACIÓN ---
|
| 10 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 11 |
+
imsize = 192 # Balance perfecto entre velocidad (CPU) y calidad
|
| 12 |
|
| 13 |
# Transformación de entrada (Ahora redimensiona todo a imsize x imsize)
|
| 14 |
loader = transforms.Compose([
|
|
|
|
| 138 |
c_weight = gr.Slider(minimum=0.1, maximum=10.0, value=1.0, step=0.1, label="Peso del Contenido (Estructura)")
|
| 139 |
s_weight = gr.Slider(minimum=1000, maximum=1000000, value=100000, step=1000, label="Peso del Estilo (Arte)")
|
| 140 |
tv_weight = gr.Slider(minimum=0, maximum=0.001, value=0.000001, step=0.000001, label="Suavizado (Variación Total)")
|
| 141 |
+
iters = gr.Slider(minimum=2, maximum=20, value=5, step=1, label="Iteraciones")
|
| 142 |
|
| 143 |
run_btn = gr.Button("¡Mezclar Imágenes!", variant="primary")
|
| 144 |
|