Detect Anything in Real Time: From Single-Prompt Segmentation to Multi-Class Detection
Organizations: Columbia University
Abstract
Recent advances in vision-language modeling have produced promptable detection and segmentation systems that accept arbitrary natural language queries at inference time. Among these, SAM3 achieves state-of-the-art accuracy by combining a ViT-H/14 backbone with cross-modal transformer decoding and learned object queries. However, SAM3 processes a single text prompt per forward pass. Detecting N categories requires N independent executions, each dominated by the 439M-parameter backbone. We present Detect Anything in Real Time (DART), a training-free framework that converts SAM3 into a real-time multi-class detector by exploiting a structural invariant: the visual backbone is class-agnostic, producing image features independent of the text prompt. This allows the backbone computation to be shared between all classes, reducing its cost from O(N) to O(1). Combined with batched multi-class decoding, detection-only inference, and TensorRT FP16 deployment, these optimizations yield 5.6x cumulative speedup at 3 classes, scaling to 25x at 80 classes, without modifying any model weight. On COCO val2017 (5,000 images, 80 classes), DART achieves 55.8 AP at 15.8 FPS (4 classes, 1008x1008) on a single RTX 4080, surpassing purpose-built open-vocabulary detectors trained on millions of box annotations. For extreme latency targets, adapter distillation with a frozen encoder-decoder achieves 38.7 AP with a 13.9 ms backbone. Code and models are available at https://github.com/mkturkcan/DART.
Figures & tables
| Level | Optimization | BB | E-D | ms | Speedup |
|---|---|---|---|---|---|
| 0 | Naive ( full passes) | 336 | 1 | ||
| 1 | Shared backbone | 1 | 162 | 2.1 | |
| 2 | + Batched + det-only | 1 | 1 | 112 | 3.0 |
| 3 | + Graph restructure + TRT BB | TRT | 1 | 78 | 4.3 |
| 4 | + TRT enc-dec + pipeline | TRT | TRT | 60 | 5.6 |
| BB (ms) | E-D (ms) | Sum | Seq. FPS | Pipe. FPS | Gain | |
|---|---|---|---|---|---|---|
| 1 | 53.2 | 7.9 | 61.1 | 16.3 | 18.7 | +15% |
| 2 | 53.2 | 11.4 | 64.6 | 15.5 | 17.6 | +14% |
| 4 | 53.2 | 19.2 | 72.4 | 13.8 | 15.8 | +14% |
| 8 | 53.2 | 34.7 | 87.9 | 11.5 | 12.5 | +9% |
| Configuration | Res. | Removed | AP | AP 50 | AP 75 | AP S | AP M | AP L |
|---|---|---|---|---|---|---|---|---|
| Full TRT FP16 | 1008 | 0 | 55.8 | 73.4 | 61.5 | 40.3 | 59.8 | 70.7 |
| SBP-16 TRT FP16 | 1008 | 16 | 47.6 | 63.5 | 52.7 | 32.5 | 51.8 | 62.0 |
| Full TRT FP16 | 644 | 0 | 39.1 | 63.9 | 39.9 | 12.4 | 44.4 | 65.4 |
| SBP-16 TRT FP16 | 644 | 16 | 32.8 | 54.5 | 33.4 | 9.9 | 37.9 | 56.7 |
| Method | Latency | Cosine | Status |
|---|---|---|---|
| Explicit-attn TRT FP16 | 53 ms | 0.999 | ✓ |
| Fused-SDPA TRT FP16 | 26 ms | 0.058 | × |
| Fused-SDPA mixed (attn FP32) | 128 ms | 0.999 | ✓ |
| torch.compile FP16 | 75 ms | 1.000 | ✓ |
| PyTorch eager FP16 | 87 ms | 1.000 | ✓ |
| Method | Backbone | Params | AP | AP 50 | AP 75 | AP S | AP L | BB (ms) |
|---|---|---|---|---|---|---|---|---|
| Teacher (training-free, this work) | ||||||||
| DART (ViT-H) | ViT-H/14 | 439M | 55.8 | 73.4 | 61.5 | 40.3 | 70.7 | 53 |
| Adapter distillation (this work): frozen SAM3 encoder-decoder | ||||||||
| DART (student) ‡ | RepViT-M2.3 | 8.2M | 38.7 | 53.1 | 42.3 | 22.6 | 49.9 | 13.9 |
| DART (student) ‡ | TinyViT-21M | 21M | 30.1 | 42.4 | 32.6 | 17.4 | 37.8 | 12.2 |
| DART (student) ‡ | EfficientViT-L2 | 9.2M | 21.7 | 31.5 | 23.5 | 13.7 | 24.2 | 10.7 |
| Method | Backbone | Det. Data | AP |
|---|---|---|---|
| Trained on detection data (zero-shot on COCO) † | |||
| GLIP-L [ 6 ] | Swin-L | O365+GoldG | 49.8 |
| Grounding DINO-T [ 7 ] | Swin-T | O365+GoldG | 48.1 |
| Grounding DINO-L [ 7 ] | Swin-L | O365+GoldG+Cap4M | 52.5 |
| YOLO-World-L [ 4 ] | YOLOv8-L | O365+GoldG | 44.9 |
| YOLO-World-X [ 4 ] | YOLOv8-X | O365+GoldG | 46.7 |
Object Detection
Object detection locates and classifies objects in images or video, balancing localization accuracy, robustness, and inference speed.
See all 605 papers