Spaces:
Running
on
Zero
Running
on
Zero
File size: 575 Bytes
59b2a81 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import os, sys, shutil
import cv2
if __name__ == "__main__":
input_path = "/nfs/turbo/jjparkcv-turbo-large/boyangwa/resize"
output_path = "/nfs/turbo/jjparkcv-turbo-large/boyangwa/resize_resized"
if os.path.exists(output_path):
shutil.rmtree(output_path)
os.makedirs(output_path)
for img_name in os.listdir(input_path):
img_path = os.path.join(input_path, img_name)
img = cv2.imread(img_path)
img = cv2.resize(img, (384, 256))
store_path = os.path.join(output_path, img_name)
cv2.imwrite(store_path, img) |