22 lines
602 B
Python
Executable File
22 lines
602 B
Python
Executable File
'''
|
||
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)
|
||
|