목록이미지회전 (1)
IT_World

1. glob로 이미지를 불러오고 rotate로 이미지를 회전해보자. import os from PIL import Image import glob #이미지 폴더 불러오기 a= 1 path = f"/home//data/img/{a}" files = glob.glob(path + '/*') #없는 폴더 만들어주는 코드 make_path = f"/home/rotate/{a}" if not os.path.isdir(make_path): os.mkdir(make_path) # 저장 root 만들어주자 save_path = f"/home/rotate/{a}/" #폴더에 저장된 이미지 순차적으로 불러온다. for f in files: for idx, file in enumerate(files): fname, ext..
Artificial intelligence, AI/TensorFlow
2021. 4. 8. 17:55