data
ObjectDetectionOutput
extends
ModelOutputObjectDetectionOutput(logits: Tensor, pred_boxes: Tensor, loss: Tensor | None = None, hidden_states: tuple[Tensor, ...] | None = None, proposals: tuple[Tensor, ...] | None = None)Output of any {Family}ForObjectDetection model.
Attributes
logitsTensorPer-proposal / per-query class logits. Shape depends on family:
(B, num_queries, num_classes) for DETR, (N, num_classes)
for R-CNN-family per-RoI scoring.pred_boxesTensorPredicted bounding box coordinates. Box format is family-specific
(cxcywh-normalised for DETR, xyxy-pixel for R-CNN).
loss(Tensor or None, optional)Total detection loss (classification + box regression + matching
cost where applicable) when targets were supplied.
hidden_states(tuple[Tensor, ...] or None, optional)Optional intermediate feature maps.
proposals(tuple[Tensor, ...] or None, optional)Per-image RoI proposals for two-stage detectors (R-CNN / Fast
R-CNN / Faster R-CNN). Lets downstream
postprocess() run
from the output alone, without re-running the proposal stage.Notes
Returned by AutoModelForObjectDetection registrations —
R-CNN family, DETR, EfficientDet, YOLO v1–v4. Anchor-based and
set-prediction families share this contract.
Examples
>>> model = AutoModelForObjectDetection.from_pretrained("detr_resnet50")
>>> out = model(lucid.randn(1, 3, 800, 800))
>>> out.logits.shape, out.pred_boxes.shape
((1, 100, 91), (1, 100, 4))