IADNet / data /util.py
S-t-a-m-i's picture
Upload 48 files
badd373 verified
Raw
History Blame Contribute Delete
243 Bytes
from PIL import Image
def is_image_file(filename):
return any(filename.endswith(extension) for extension in [".png", ".jpg", ".bmp", ".JPG", ".jpeg"])
def load_img(filepath):
img = Image.open(filepath).convert('RGB')
return img