(self, properties)
| 184 | return imgbuf, label |
| 185 | |
| 186 | def __getitem__(self, properties): |
| 187 | img_width = properties[0] |
| 188 | img_height = properties[1] |
| 189 | idx = properties[2] |
| 190 | ratio = properties[3] |
| 191 | lmdb_idx, file_idx = self.data_idx_order_list[idx] |
| 192 | lmdb_idx = int(lmdb_idx) |
| 193 | file_idx = int(file_idx) |
| 194 | sample_info = self.get_lmdb_sample_info( |
| 195 | self.lmdb_sets[lmdb_idx]['txn'], file_idx) |
| 196 | if sample_info is None: |
| 197 | ratio_ids = np.where(self.wh_ratio == ratio)[0].tolist() |
| 198 | ids = random.sample(ratio_ids, 1) |
| 199 | return self.__getitem__([img_width, img_height, ids[0], ratio]) |
| 200 | img, label = sample_info |
| 201 | data = {'image': img, 'label': label} |
| 202 | outs = transform(data, self.ops[:-1]) |
| 203 | if outs is not None: |
| 204 | outs = self.resize_norm_img(outs, ratio, padding=self.padding) |
| 205 | if outs is None: |
| 206 | ratio_ids = np.where(self.wh_ratio == ratio)[0].tolist() |
| 207 | ids = random.sample(ratio_ids, 1) |
| 208 | return self.__getitem__([img_width, img_height, ids[0], ratio]) |
| 209 | outs = transform(outs, self.ops[-1:]) |
| 210 | if outs is None: |
| 211 | ratio_ids = np.where(self.wh_ratio == ratio)[0].tolist() |
| 212 | ids = random.sample(ratio_ids, 1) |
| 213 | return self.__getitem__([img_width, img_height, ids[0], ratio]) |
| 214 | return outs |
| 215 | |
| 216 | def __len__(self): |
| 217 | return self.data_idx_order_list.shape[0] |
nothing calls this directly
no test coverage detected