MCPcopy Create free account
hub / github.com/TorchSSL/TorchSSL / pil_loader

Function pil_loader

datasets/ssl_dataset.py:48–52  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

46
47
48def pil_loader(path):
49 # open path as file to avoid ResourceWarning (https://github.com/python-pillow/Pillow/issues/835)
50 with open(path, 'rb') as f:
51 img = Image.open(f)
52 return img.convert('RGB')
53
54
55def default_loader(path):

Callers 2

accimage_loaderFunction · 0.85
default_loaderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected