MCPcopy Create free account
hub / github.com/thygate/stable-diffusion-webui-depthmap-script / CachedReader

Class CachedReader

dzoedepth/data/data_mono.py:247–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245
246
247class CachedReader:
248 def __init__(self, shared_dict=None):
249 if shared_dict:
250 self._cache = shared_dict
251 else:
252 self._cache = {}
253
254 def open(self, fpath):
255 im = self._cache.get(fpath, None)
256 if im is None:
257 im = self._cache[fpath] = Image.open(fpath)
258 return im
259
260
261class ImReader:

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected