MCPcopy Create free account
hub / github.com/ChenWu98/cycle-diffusion / pil_loader

Function pil_loader

utils/file_utils.py:29–34  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

27
28
29def pil_loader(path):
30 # open path as file to avoid ResourceWarning
31 # (https://github.com/python-pillow/Pillow/issues/835)
32 with open(path, 'rb') as f:
33 img = Image.open(f)
34 return img.convert('RGB')

Callers 2

__getitem__Method · 0.90
__getitem__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected