(self, idx)
| 189 | # tensor image and corresponding label in a tuple. |
| 190 | |
| 191 | def __getitem__(self, idx): |
| 192 | img_path = os.path.join(self.img_dir, self.img_labels.iloc[idx, 0]) |
| 193 | image = decode_image(img_path) |
| 194 | label = self.img_labels.iloc[idx, 1] |
| 195 | if self.transform: |
| 196 | image = self.transform(image) |
| 197 | if self.target_transform: |
| 198 | label = self.target_transform(label) |
| 199 | return image, label |
| 200 | |
| 201 | |
| 202 | ###################################################################### |
nothing calls this directly
no outgoing calls
no test coverage detected