usage 썸네일형 리스트형 Pathlib 사용 예제 from PIL import Image import matplotlib.pyplot as plt from pathlib import Path def resize_and_crop_image(img, resize_dims, crop): img = img.resize(resize_dims, resample=Image.BILINEAR) img = img.crop(crop) return img # current working directory cwd = Path.cwd() # add path cfg_path = cwd.parent / 'config/CVTpro/data.json' cfg = read_json(path=str(cfg_path)) # Image resize and crop ori_dims = (cfg.. 더보기 이전 1 다음