Inference for Detections#

Object detection models label each sample with a Detections field, which you generate by passing a model to apply_model(). The same field type also covers polygon and instance segmentation output, since Detection instances can optionally carry a mask.

The Model Zoo includes detectors like Faster R-CNN and the YOLO family, and the Object Detection Guide walks through applying both a zoo detector and a custom one to the same dataset.

For a custom model, you can either construct Detection instances yourself in a loop, or configure a TorchImageModel with a DetectorOutputProcessor so it works with apply_model() directly, as described in Inference with custom models.