(self, img)
| 582 | std=[0.229, 0.224, 0.225]) |
| 583 | |
| 584 | def __call__(self, img): |
| 585 | ## transform |
| 586 | img = img[:,:,::-1] |
| 587 | img = cv2.resize(img, (self.width, self.height)) |
| 588 | img = img.transpose((2,0,1)) |
| 589 | if self.vit: |
| 590 | img = torch.Tensor(img/255.) |
| 591 | img = self.normalizer(img) |
| 592 | else: |
| 593 | img = torch.Tensor(img) |
| 594 | return img |
| 595 | |
| 596 | |
| 597 | ## Author: liuyakun1 |