MCPcopy Create free account
hub / github.com/DPS2022/diffusion-posterior-sampling / pil_loader

Function pil_loader

util/tools.py:27–31  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

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

Callers 1

default_loaderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected