MCPcopy Create free account
hub / github.com/SwinTransformer/Transformer-SSL / imread

Method imread

data/zipreader.py:93–103  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

91
92 @staticmethod
93 def imread(path):
94 zip_path, path_img = ZipReader.split_zip_style_path(path)
95 zfile = ZipReader.get_zipfile(zip_path)
96 data = zfile.read(path_img)
97 try:
98 im = Image.open(io.BytesIO(data))
99 except:
100 print("ERROR IMG LOADED: ", path_img)
101 random_img = np.random.rand(224, 224, 3) * 255
102 im = Image.fromarray(np.uint8(random_img))
103 return im

Callers

nothing calls this directly

Calls 3

split_zip_style_pathMethod · 0.80
get_zipfileMethod · 0.80
readMethod · 0.80

Tested by

no test coverage detected