Villa2110
commited on
Commit
·
6a1b300
1
Parent(s):
d6179c3
resized images to 960x1280
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- redimensionar.py +31 -0
- telmex-donut/train/000.jpg +2 -2
- telmex-donut/train/001.jpg +2 -2
- telmex-donut/train/002.jpg +2 -2
- telmex-donut/train/003.jpg +2 -2
- telmex-donut/train/004.jpg +2 -2
- telmex-donut/train/005.jpg +2 -2
- telmex-donut/train/006.jpg +2 -2
- telmex-donut/train/007.jpg +2 -2
- telmex-donut/train/008.jpg +2 -2
- telmex-donut/train/009.jpg +2 -2
- telmex-donut/train/010.jpg +2 -2
- telmex-donut/train/011.jpg +2 -2
- telmex-donut/train/012.jpg +2 -2
- telmex-donut/train/013.jpg +2 -2
- telmex-donut/train/014.jpg +2 -2
- telmex-donut/train/015.jpg +2 -2
- telmex-donut/train/016.jpg +2 -2
- telmex-donut/train/017.jpg +2 -2
- telmex-donut/train/018.jpg +2 -2
- telmex-donut/train/019.jpg +2 -2
- telmex-donut/train/020.jpg +2 -2
- telmex-donut/train/021.jpg +2 -2
- telmex-donut/train/022.jpg +2 -2
- telmex-donut/train/023.jpg +2 -2
- telmex-donut/train/024.jpg +2 -2
- telmex-donut/train/025.jpg +2 -2
- telmex-donut/train/026.jpg +2 -2
- telmex-donut/train/027.jpg +2 -2
- telmex-donut/train/028.jpg +2 -2
- telmex-donut/train/029.jpg +2 -2
- telmex-donut/train/030.jpg +2 -2
- telmex-donut/train/031.jpg +2 -2
- telmex-donut/train/032.jpg +2 -2
- telmex-donut/train/033.jpg +2 -2
- telmex-donut/train/034.jpg +2 -2
- telmex-donut/train/035.jpg +2 -2
- telmex-donut/train/036.jpg +2 -2
- telmex-donut/train/037.jpg +2 -2
- telmex-donut/train/038.jpg +2 -2
- telmex-donut/train/039.jpg +2 -2
- telmex-donut/train/040.jpg +2 -2
- telmex-donut/train/041.jpg +2 -2
- telmex-donut/train/042.jpg +2 -2
- telmex-donut/train/043.jpg +2 -2
- telmex-donut/train/044.jpg +2 -2
- telmex-donut/train/045.jpg +2 -2
- telmex-donut/train/046.jpg +2 -2
- telmex-donut/train/047.jpg +2 -2
- telmex-donut/train/048.jpg +2 -2
redimensionar.py
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from PIL import Image
|
2 |
+
import os
|
3 |
+
|
4 |
+
def redimensionar_imagenes(carpeta, nuevo_tamano):
|
5 |
+
# Obtener la lista de archivos en la carpeta
|
6 |
+
archivos = os.listdir(carpeta)
|
7 |
+
|
8 |
+
for archivo in archivos:
|
9 |
+
# Comprobar si el archivo es una imagen
|
10 |
+
if archivo.endswith(('.jpg', '.jpeg', '.png', '.gif')):
|
11 |
+
ruta = os.path.join(carpeta, archivo)
|
12 |
+
|
13 |
+
# Abrir la imagen utilizando PIL
|
14 |
+
imagen = Image.open(ruta)
|
15 |
+
|
16 |
+
# Redimensionar la imagen
|
17 |
+
imagen_redimensionada = imagen.resize(nuevo_tamano)
|
18 |
+
|
19 |
+
# Guardar la imagen redimensionada (sobreescribe la original)
|
20 |
+
imagen_redimensionada.save(ruta)
|
21 |
+
|
22 |
+
print(f"La imagen {archivo} ha sido redimensionada.")
|
23 |
+
|
24 |
+
# Ruta de la carpeta de imágenes
|
25 |
+
ruta_carpeta = "./telmex-donut/validation"
|
26 |
+
|
27 |
+
# Nuevo tamaño deseado para las imágenes (ancho, alto)
|
28 |
+
nuevo_tamano = (960, 1280)
|
29 |
+
|
30 |
+
# Llamar a la función para redimensionar las imágenes
|
31 |
+
redimensionar_imagenes(ruta_carpeta, nuevo_tamano)
|
telmex-donut/train/000.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/001.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/002.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/003.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/004.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/005.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/006.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/007.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/008.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/009.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/010.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/011.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/012.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/013.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/014.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/015.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/016.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/017.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/018.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/019.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/020.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/021.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/022.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/023.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/024.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/025.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/026.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/027.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/028.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/029.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/030.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/031.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/032.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/033.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/034.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/035.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/036.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/037.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/038.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/039.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/040.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/041.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/042.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/043.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/044.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/045.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/046.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/047.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|
telmex-donut/train/048.jpg
CHANGED
Git LFS Details
|
Git LFS Details
|