This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def aug_test(self, | |
| imgs: List[Tensor], | |
| img_metas: List[dict], | |
| rescale: bool = False) -> Tensor: | |
| acc_boxes = np.zeros((0, 5)) | |
| acc_score = np.zeros((0, self.roi_head.bbox_head.num_classes)) | |
| for img, img_meta in zip(imgs, img_metas): | |
| for label, dets in enumerate(self.simple_test(img, img_meta, None, rescale)[0]): | |
| boxes, scores = dets[:, :-1], dets[:, -1] | |
| acc_boxes = np.vstack((acc_boxes, boxes)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch | |
| from torch import nn | |
| from torch.nn import functional as F | |
| from torchvision.transforms.v2 import functional as F | |
| import matplotlib.pyplot as plt | |
| INPUT_SIZE = (3, 41, 70) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from typing import Tuple | |
| import torch | |
| from torch import Tensor | |
| from torchvision.transforms.v2 import functional as F | |
| def reference_resize(image: Tensor, new_size: Tuple[int, int]) -> Tensor: | |
| image = F.resize(image, new_size, interpolation=F.InterpolationMode.BICUBIC, antialias=True) | |
| return image |
OlderNewer