11
11
12
12
13
13
class RegionDetectorOutput (NamedTuple ):
14
+ """
15
+ The output type from the forward pass of a `RegionDetector`.
16
+ """
17
+
14
18
features : List [Tensor ]
19
+ """
20
+ A list of tensors, each with shape `(num_boxes, feature_dim)`.
21
+ """
22
+
15
23
boxes : List [Tensor ]
24
+ """
25
+ A list of tensors containing the coordinates for each box. Each has shape `(num_boxes, 4)`.
26
+ """
27
+
16
28
class_probs : Optional [List [Tensor ]] = None
29
+ """
30
+ An optional list of tensors. These tensors can have shape `(num_boxes,)` or
31
+ `(num_boxes, *)` if probabilities for multiple classes are given.
32
+ """
33
+
17
34
class_labels : Optional [List [Tensor ]] = None
35
+ """
36
+ An optional list of tensors that give the labels corresponding to the `class_probs`
37
+ tensors. This should be non-`None` whenever `class_probs` is, and each tensor
38
+ should have the same shape as the corresponding tensor from `class_probs`.
39
+ """
18
40
19
41
20
42
class RegionDetector (nn .Module , Registrable ):
@@ -29,7 +51,8 @@ class RegionDetector(nn.Module, Registrable):
29
51
- `boxes` (`List[Tensor]`): The coordinates of each region within the original image, with shape
30
52
`(num_boxes, 4)`.
31
53
- `class_probs` (`Optional[List[Tensor]]`): Class probabilities from some object
32
- detector that was used to find the regions of interest, with shape `(num_predicted_classes,)`.
54
+ detector that was used to find the regions of interest, with shape `(num_boxes,)`
55
+ or `(num_boxes, *)` if probabilities for more than one class are given.
33
56
- `class_labels` (`Optional[List[Tensor]]`): The labels corresponding to `class_probs`.
34
57
Each tensor in this list has the same shape as the corresponding tensor in `class_probs`.
35
58
0 commit comments