(cfg, is_train)
| 132 | |
| 133 | |
| 134 | def build_transforms(cfg, is_train): |
| 135 | transforms = [] |
| 136 | transforms.append(ToTensor()) |
| 137 | if is_train: |
| 138 | transforms.append(RandomHorizontalFlip()) |
| 139 | if cfg.INPUT.IMAGE_CUTOUT: |
| 140 | transforms.append(Cutout()) |
| 141 | if cfg.INPUT.IMAGE_ERASE: |
| 142 | transforms.append(RandomErasing()) |
| 143 | |
| 144 | return Compose(transforms) |
no test coverage detected