Skip to content

Instantly share code, notes, and snippets.

@nihadguluzade
nihadguluzade / Image processing.py
Created March 30, 2020 12:09
Resize the images in data set and write their names to the text file.
# Creates txt file containing file names from the data set located in DATASET_DIR and
# crops the images according to IMAGE_WIDTH and IMAGE_HEIGHT
import os
import numpy
import shutil
from PIL import Image
# Resize images to 128x128, channel 3 because colored
IMAGE_WIDTH, IMAGE_HEIGHT = 128, 128