Created
July 13, 2022 06:57
-
-
Save Mynuddin-dev/062378b07586b7e1c350a0b449826519 to your computer and use it in GitHub Desktop.
Multiple Image Resize
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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