小脚本
目录
1.图片旋转
from PIL import Image
import os
root_dir = "/data_1/Yang/project_new/2020/tf_study/tf-resnet/data/0/"
save_dir = "/data_1/Yang/project_new/2020/tf_study/tf-resnet/data/1/1_"
list_dir = os.listdir(root_dir)
for file_name in list_dir:
path = root_dir + file_name
save_path = save_dir + file_name
im = Image.open(path)
#im.show()
im_rot = im.rotate(180)
#im_rot.show()
im_rot.save(save_path,"png")
好记性不如烂键盘---点滴、积累、进步!