(self, image, masks, boxes, labels)
| 453 | |
| 454 | class RandomFlip(object): |
| 455 | def __call__(self, image, masks, boxes, labels): |
| 456 | height , _ , _ = image.shape |
| 457 | if random.randint(2): |
| 458 | image = image[::-1, :] |
| 459 | masks = masks[:, ::-1, :] |
| 460 | boxes = boxes.copy() |
| 461 | boxes[:, 1::2] = height - boxes[:, 3::-2] |
| 462 | return image, masks, boxes, labels |
| 463 | |
| 464 | |
| 465 | class RandomRot90(object): |