MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / _decode_image

Method _decode_image

anyword_data_lmdb.py:154–159  ·  view source on GitHub ↗
(self, image_bin)

Source from the content-addressed store, hash-verified

152 return self._length
153
154 def _decode_image(self, image_bin):
155 image_buf = np.frombuffer(image_bin, dtype=np.uint8)
156 img = cv2.imdecode(image_buf, cv2.IMREAD_COLOR)
157 img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
158 img_pil = Image.fromarray(img)
159 return img_pil
160
161 def __getitem__(self, idx):
162 dataset_idx, id, sub_id = self.index_list[idx]

Callers 1

__getitem__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected