(self)
| 427 | return len(self.data) * self.samples_per_image # type: ignore |
| 428 | |
| 429 | def __iter__(self): |
| 430 | for image in super().__iter__(): |
| 431 | patches = self.patch_func(image) |
| 432 | if len(patches) != self.samples_per_image: |
| 433 | raise RuntimeWarning( |
| 434 | f"`patch_func` must return a sequence of length: samples_per_image={self.samples_per_image}." |
| 435 | ) |
| 436 | for patch in patches: |
| 437 | out_patch = patch |
| 438 | if self.patch_transform is not None: |
| 439 | out_patch = apply_transform(self.patch_transform, patch, map_items=False) |
| 440 | yield out_patch |
no test coverage detected