@@ -25,7 +25,7 @@ class GeneralizedRCNN(nn.Module):
25
25
the model
26
26
"""
27
27
28
- def __init__ (self , backbone , rpn , roi_heads , transform ) :
28
+ def __init__ (self , backbone : nn . Module , rpn : nn . Module , roi_heads : nn . Module , transform : nn . Module ) -> None :
29
29
super ().__init__ ()
30
30
_log_api_usage_once (self )
31
31
self .transform = transform
@@ -48,7 +48,7 @@ def forward(self, images, targets=None):
48
48
"""
49
49
Args:
50
50
images (list[Tensor]): images to be processed
51
- targets (list[Dict[Tensor]]): ground-truth boxes present in the image (optional)
51
+ targets (list[Dict[str, Tensor]]): ground-truth boxes present in the image (optional)
52
52
53
53
Returns:
54
54
result (list[BoxList] or dict[Tensor]): the output from the model.
@@ -97,7 +97,7 @@ def forward(self, images, targets=None):
97
97
features = OrderedDict ([("0" , features )])
98
98
proposals , proposal_losses = self .rpn (images , features , targets )
99
99
detections , detector_losses = self .roi_heads (features , proposals , images .image_sizes , targets )
100
- detections = self .transform .postprocess (detections , images .image_sizes , original_image_sizes )
100
+ detections = self .transform .postprocess (detections , images .image_sizes , original_image_sizes ) # type: ignore[operator]
101
101
102
102
losses = {}
103
103
losses .update (detector_losses )
0 commit comments