From 34e24bfe78ad44e968add444bf75d1a350f53465 Mon Sep 17 00:00:00 2001 From: Prabhat Roy Date: Mon, 8 Nov 2021 16:34:15 +0000 Subject: [PATCH] Removed type annotations from rcnn --- torchvision/models/detection/generalized_rcnn.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/torchvision/models/detection/generalized_rcnn.py b/torchvision/models/detection/generalized_rcnn.py index f02f2b33928..37ef1820d71 100644 --- a/torchvision/models/detection/generalized_rcnn.py +++ b/torchvision/models/detection/generalized_rcnn.py @@ -36,22 +36,15 @@ def __init__(self, backbone: nn.Module, rpn: nn.Module, roi_heads: nn.Module, tr self._has_warned = False @torch.jit.unused - def eager_outputs( - self, - losses: Dict[str, Tensor], - detections: List[Dict[str, Tensor]], - ) -> Union[Dict[str, Tensor], List[Dict[str, Tensor]]]: - + def eager_outputs(self, losses, detections): + # type: (Dict[str, Tensor], List[Dict[str, Tensor]]) -> Union[Dict[str, Tensor], List[Dict[str, Tensor]]] if self.training: return losses return detections - def forward( - self, - images: List[Tensor], - targets: Optional[List[Dict[str, Tensor]]] = None, - ) -> Union[Tuple[Dict[str, Tensor], List[Dict[str, Tensor]]], Dict[str, Tensor], List[Dict[str, Tensor]]]: + def forward(self, images, targets=None): + # type: (List[Tensor], Optional[List[Dict[str, Tensor]]]) -> Tuple[Dict[str, Tensor], List[Dict[str, Tensor]]] """ Args: images (list[Tensor]): images to be processed