Models · Promptable segmentation
INSID3
INSID3 (2026): finds the object shown in one or more example images with masks in a new image, without training, from Meta's DINOv3 features. Apache-2.0 code; the DINOv3 weights are under the gated DINOv3 licence.
experimental Fork of visinf/INSID3@0c165a1 · backends: portable, kernels
- Paper INSID3: Training-Free In-Context Segmentation with DINOv3 CVPR 2026 · first released 30 Mar 2026
Checkpoint insid3-vitl16
Paper 2026 Added in 0.2.0 Evaluated with 0.2.0
Use it
pip install fastforks Lean install with only what this model needs: pip install fastforks-core
from fastforks import promptable_segmentation
model = promptable_segmentation.load("insid3-vitl16") # kernels on a supported GPU, else portable PyTorch
result = model(image, input_points=...)
result.similarity # also: masks
result.backend # what ran: mode, device, dtype, kernels fastforks bench insid3-vitl16 Times the model on this machine. load(…, mode="portable") or mode="kernels" picks a backend; usage guide.
Speed and memory
Every backend on one GPU (RTX 5060 Ti 16 GB) and the same input, the authors’ code included. Kernels runs fp16. Portable runs fp16 on CUDA.
Input: synthetic, 1024x1024 (the task’s standard size)
| Backend | dtype | Time per call (ms) | vs original fp16 | Peak memory allocated / reserved | Load (s) | First call (s) |
|---|---|---|---|---|---|---|
| Original fp32visinf/INSID3@0c165a10cf52 set_reference + set_target + segment, its encoder autocast off | fp32 | 1649 | 0.43× | 1,665 MiB/1,746 MiB | 7.2 | 2.86 |
| Original (own default)the authors' mixed-precision option (bfloat16); visinf/INSID3@0c165a10cf52 set_reference + set_target + segment, bf16 autocast (as shipped) | bf16 | 713 | – | 2,148 MiB/2,226 MiB | 1.1 | 1.11 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 255 | 2.8× | 986 MiB/1,228 MiB | 2.7 | 0.44 |
| Kernels | fp16 | 157 | 4.5× | 987 MiB/1,228 MiB | 1.4 | 0.46 |
| Portable + torch.compile | 235 | 3.0× | 985 MiB/1,206 MiB | 17 (build) | – | |
| TensorRT fp16image encoder only | fp16 | 64.1 | 11× | 684 MiBenginenot comparable | 42 (build) | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-13. First call, 3 warm-up, peak reset, median of 3 rounds x median of 5. Ratios divide two
times of this table (same GPU, same input). Original fp16 is the authors’ own precision option, else torch.autocast. torch.compile and TensorRT: build time instead of load time. TensorRT memory (engine, not comparable) is the GPU memory the engine took, read from the driver because TensorRT allocates outside PyTorch, so it can't be compared with the PyTorch peaks of the other rows.
Other devices
| Device | Backend | dtype | ms / call | Peak memory | Output vs reference | Input |
|---|---|---|---|---|---|---|
| Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-14 | Original | fp32 | 3121 | 3,003 MiB process | – | 1024x1024 |
| Portable | fp16 | 2510 | 3,414 MiB process | matches | 1024x1024 | |
| Portable | fp32 | 2953 | 2,963 MiB process | matches | 1024x1024 | |
| Kernels | fp16 | not implemented | – | 1024x1024 | ||
CUDA memory is torch’s peak allocated / reserved; Apple has no such counter, so the Mac rows show the process footprint (weights, Python and torch included). “Output vs reference” compares the device’s output with the stored golden output under the card’s tolerance; – = not checked on that device. Kernels “not implemented” = no kernels for this model on that backend yet: it runs portable there.
Licence and weights
Commercial use allowed
- Code
- Apache-2.0 LICENSE
- Weights
- LicenseRef-DINOv3-License source
- Training data
- training-free; the DINOv3 backbone: LVD-1689M (1.689B curated Instagram images, self-supervised), not released
- The INSID3 code is Apache-2.0; it ships no weights of its own and runs the DINOv3 ViT-L/16 checkpoint, which is under the DINOv3 License (Meta: attribution and conditions apply; gated on Hugging Face); read it before commercial use.
Our reading of the licences, not legal advice.
Weights
dinov3-vitl16-pretrain-lvd1689m/model.safetensors 1.2 GB· hosted on Hugging Facefastforks downloads and checks these files on first use (fastforks download insid3-vitl16).
Accuracy
The test set through the authors’ code and through ours: same checkpoint, same protocol. The distance between the original’s fp32 and fp16 runs is what half precision alone costs; our runs should stay within it.
COCO val2017
one-shot episodes (3 per class), class mIoU %
| Run | dtype | mIoU % ↑ | Δ mIoU % vs fp32 original | episodes | ms / episode |
|---|---|---|---|---|---|
| Original fp32 | fp32 | 57.61 | reference | 240 | 1434 |
| Original fp16 | bf16 | 57.56 | −0.05 | 240 | 570 |
| Portable fp32 | fp32 | 57.61 | ±0.00 | 240 | 1002 |
| Portable | fp16 | 57.28 | −0.33 | 240 | 252 |
| Kernels | fp16 | 57.21 | −0.40 | 240 | 153 |
In-context: per COCO class 3 (reference, target) pairs drawn with seed 0 from the images whose class covers >= 2 %, the class's non-crowd instances as one mask; foreground IoU summed per class, mean over the 80 classes. Original = the authors’ code, same checkpoint and protocol. Measured on original fp32, original fp16: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-13; portable fp32, portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 7f5b4581+ins, 2026-11-13.
Closeness to the original
Beyond the test-set scores: the raw output of ours against the original’s fp32 output on the same input, pixel by pixel. CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.002 and p99 <= 0.005 (absolute error of the output similarity).
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.002 | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.002 | 0.00038 |
| GPU default dtypes, p99 |diff| | ≤ 0.005 | 0.00117 |
Recorded for insid3-vitl16 on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-13, with these kernels: dpt_fusedfastbb
Details
INSID3 (2026): training-free in-context segmentation. Reference images with masks -> the same concept in a target image, from frozen DINOv3 ViT-L patch features (positional debiasing, forward / backward matching, average-linkage clustering of the target patches). The backbone is fastforks' DINOv3 (`features`), the clustering runs on the GPU. The portable `module()` is the backbone only.
- Input / output
- Input: one image plus a point, box or text prompt. Output: masks with quality scores.
- Input size
- any H x W >= 1, resized inside to the fixed encoder input 1024x1024 (the default export size); tested up to 1080x1920 (1,002 MiB allocated)
- Outputs
similarity,masks- Checkpoint
encoder="dinov3-vitl16"- CUDA kernels
fastbbfast backbone kernels: flash attention, window attention, instance norm and rotary embeddings for ViT and similar backbonesdpt_fusedfused fp16 matrix multiplies and convolutions for DINOv2 backbones and DPT depth heads
- Apple (MPS)
- fp32, fp16
Full reference, generated from the repository
INSID3 (2026): finds the object shown in one or more example images with masks in a new image, without training, from Meta's DINOv3 features. Apache-2.0 code; the DINOv3 weights are under the gated DINOv3 licence.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
insid3-vitl16 | synthetic (1024x1024) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 1649 713 255 157 235 64.1 (image encoder only) | 1665 / 1746 2148 / 2226 986 / 1228 987 / 1228 985 / 1206 1339 / 1508 |
Details
- Original code: https://github.com/visinf/INSID3 at
0c165a10cf52 - Code licence: Apache-2.0 (permissive); files:
LICENSE - Weights licence: LicenseRef-DINOv3-License
- Licence evidence: https://github.com/visinf/INSID3/blob/0c165a10cf52ab91f335883d06260de86854adbe/LICENSE (Apache-2.0); backbone weights: https://huggingface.co/facebook/dinov3-vitl16-pretrain-lvd1689m (DINOv3 License, gated)
- Training data: training-free; the DINOv3 backbone: LVD-1689M (1.689B curated Instagram images, self-supervised), not released
- Licence note: The INSID3 code is Apache-2.0; it ships no weights of its own and runs the DINOv3 ViT-L/16 checkpoint, which is under the DINOv3 License (Meta: attribution and conditions apply; gated on Hugging Face); read it before commercial use.
- Kernel libraries:
fastbb,dpt_fused - Variants:
insid3-vitl16 - Outputs: similarity, masks
- Input size: any H x W >= 1, resized inside to the fixed encoder input 1024x1024 (the default export size)
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
insid3-vitl161080x1920 (1.0 GiB peak allocated, 1.3 reserved) insid3-vitl161024x1024, first call: portable + torch.compile 17 s (cold Inductor cache), TensorRT fp16 42 s (ONNX + engine).insid3-vitl16original (fp32) 1024x1024: visinf/INSID3@0c165a10cf52 set_reference + set_target + segment, its encoder autocast offinsid3-vitl16original 1024x1024: the authors' mixed-precision option (bfloat16); visinf/INSID3@0c165a10cf52 set_reference + set_target + segment, bf16 autocast (as shipped)insid3-vitl16load / first call: original 1.06 s / 1.114 s, portable 2.69 s / 0.441 s, kernels 1.39 s / 0.464 s- Protocol, first call, 3 warm-up, peak reset, median of 3 rounds x median of 5
Measured
In-context: per COCO class 3 (reference, target) pairs drawn with seed 0 from the images whose class covers >= 2 %, the class's non-crowd instances as one mask; foreground IoU summed per class, mean over the 80 classes. Original = the original code named under Details, same checkpoint and protocol.
| variant | dataset | original fp32 | original fp16 | portable | portable fp32 | kernels | note |
|---|---|---|---|---|---|---|---|
insid3-vitl16 | COCO val2017, one-shot episodes (3 per class), class mIoU % | 57.61 | 57.56 | 57.28 | 57.61 | 57.21 |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 7f5b4581+insid3, 2026-11-13.
Parity
CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.002 and p99 <= 0.005 (absolute error of the output similarity).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
insid3-vitl16 | 0.00038 / 0.00117 | RTX 5060 Ti, torch 2.14.1+cu130 | dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120 |
Example output
No example rendered for this checkpoint yet.