Args: index (int): Index Returns: tuple: (image, target) where target is class_index of the target class.
(self, index)
| 236 | self.transform = [self.transform] |
| 237 | |
| 238 | def __getitem__(self, index): |
| 239 | """ |
| 240 | Args: |
| 241 | index (int): Index |
| 242 | Returns: |
| 243 | tuple: (image, target) where target is class_index of the target class. |
| 244 | """ |
| 245 | path, target = self.samples[index] |
| 246 | image = self.loader(path) |
| 247 | |
| 248 | ret = [] |
| 249 | if self.transform is not None: |
| 250 | for t in self.transform: |
| 251 | ret.append(t(image)) |
| 252 | else: |
| 253 | ret.append(image) |
| 254 | if self.target_transform is not None: |
| 255 | target = self.target_transform(target) |
| 256 | ret.append(target) |
| 257 | |
| 258 | return ret |
nothing calls this directly
no outgoing calls
no test coverage detected