import os import cv2 # obtain the filename path_ori = 'F:/BaiduNetdiskDownload/TransUnet/dataset/rode/train/images/' filename = os.listdir(path_ori) # resize the image for fn in filename: img = cv2.imread(path_ori + fn) dim = (256, 256) img_res = cv2.resize(img, dim, interpolation=cv2.INTER_AREA) cv2.imwrite(path_ori + fn, img_res)
批量修改图像尺寸
最新推荐文章于 2022-12-27 13:26:54 发布