(self, height, width, re)
| 412 | |
| 413 | class ReidAugmentation(object): |
| 414 | def __init__(self, height, width, re): |
| 415 | normalizer = T.Normalize(mean=[0.485, 0.456, 0.406], |
| 416 | std=[0.229, 0.224, 0.225]) |
| 417 | |
| 418 | self.train_transformer = T.Compose([ |
| 419 | T.Resize((height, width)), |
| 420 | T.RandomHorizontalFlip(), |
| 421 | T.Pad(10), |
| 422 | T.RandomCrop((height, width)), |
| 423 | T.ToTensor(), |
| 424 | normalizer, |
| 425 | ]) |
| 426 | |
| 427 | if re: |
| 428 | self.train_transformer = T.Compose([ |
| 429 | T.Resize((height, width)), |
| 430 | T.RandomHorizontalFlip(), |
| 431 | T.Pad(10), |
| 432 | T.RandomCrop((height, width)), |
| 433 | RandomSizedEarser(), |
| 434 | T.ToTensor(), |
| 435 | normalizer, |
| 436 | ]) |
| 437 | |
| 438 | def __call__(self, img): |
| 439 | ## transform |
nothing calls this directly
no test coverage detected