Skip to content

Instantly share code, notes, and snippets.

@Mynuddin-dev
Created July 13, 2022 06:57
Show Gist options
  • Save Mynuddin-dev/062378b07586b7e1c350a0b449826519 to your computer and use it in GitHub Desktop.
Save Mynuddin-dev/062378b07586b7e1c350a0b449826519 to your computer and use it in GitHub Desktop.
Multiple Image Resize
import cv2
import os
import numpy as np
path = "/home/myn/Downloads/all_images/"
destination = "/home/myn/Downloads/resized_all_images"
for img_name in os.listdir(path):
# print(img_path)
img = cv2.imread(str(path)+"/"+str(img_name))
# print(img.shape)
img = cv2.resize(img, (200,200), interpolation = cv2.INTER_AREA)
cv2.imwrite(str(destination)+"/"+img_name , img )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment