MCPcopy
hub / github.com/DingXiaoH/RepVGG / imread

Method imread

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

Source from the content-addressed store, hash-verified

84
85 @staticmethod
86 def imread(path):
87 zip_path, path_img = ZipReader.split_zip_style_path(path)
88 zfile = ZipReader.get_zipfile(zip_path)
89 data = zfile.read(path_img)
90 try:
91 im = Image.open(io.BytesIO(data))
92 except:
93 print("ERROR IMG LOADED: ", path_img)
94 random_img = np.random.rand(224, 224, 3) * 255
95 im = Image.fromarray(np.uint8(random_img))
96 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