(self, image_bin)
| 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] |