Files
MPKFNet/img_resize.py
T
2021-09-15 11:33:58 +08:00

22 lines
602 B
Python
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
'''
author : Hatcher W
Email: hcwang@semi.ac.cn
use: resize图像
input:需要resize的文件夹路径
output:结果路径
'''
import os
import cv2
def density_resize(input,output):
filelist = os.listdir(input)
for image in filelist:
img = cv2.imread(os.path.join(input,image))
img = cv2.resize(img,(1024,768))
cv2.imwrite(os.path.join(input,image),img)
if __name__ == '__main__':
in_path = "/data1/Hatcher/model/1/WVGA__20210608_055359_100_0323/"
out_path = "/data1/Hatcher/model/1/WVGA__20210608_055359_100_0323/"
density_resize(in_path,out_path)