MCPcopy Create free account
hub / github.com/OUCMachineLearning/OUCML / pil_loader

Function pil_loader

GAN/ACGAN-PyTorch-master/folder.py:54–58  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

52
53
54def pil_loader(path):
55 # open path as file to avoid ResourceWarning (https://github.com/python-pillow/Pillow/issues/835)
56 with open(path, 'rb') as f:
57 with Image.open(f) as img:
58 return img.convert('RGB')
59
60
61def accimage_loader(path):

Callers 2

accimage_loaderFunction · 0.85
default_loaderFunction · 0.85

Calls 1

openMethod · 0.80

Tested by

no test coverage detected