data
InstanceSegmentationOutput
extends
ModelOutputInstanceSegmentationOutput(logits: Tensor, pred_boxes: Tensor, pred_masks: Tensor, loss: Tensor | None = None, hidden_states: tuple[Tensor, ...] | None = None)Output of any instance-segmentation model.
Attributes
logitsTensorPer-proposal class logits.
pred_boxesTensorPredicted bounding boxes.
pred_masksTensorPer-instance binary mask logits, typically shape
(N, num_classes, mh, mw) for R-CNN-style or
(B, num_queries, H, W) for transformer-based instance heads.loss(Tensor or None, optional)Total loss (cls + box + mask) when targets were supplied.
hidden_states(tuple[Tensor, ...] or None, optional)Optional intermediate feature maps.
Notes
Returned today by Mask R-CNN; Mask2Former when configured for instance segmentation will also produce this shape.
Examples
>>> model = create_model("mask_rcnn")
>>> out = model(lucid.randn(1, 3, 800, 800))
>>> out.pred_masks.shape[-2:]
(28, 28)