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

Checkpoint insid3-vitl16

Paper 2026 Added in 0.2.0 Evaluated with 0.2.0

Kernels, RTX 5060 Ti 16 GB 157 ms 1024x1024, fp16
vs the faster original 4.5× original bf16: 713 ms
Peak memory 987 MiB original: 2,148 MiB
Accuracy vs original fp32 −0.40 kernels mIoU %, COCO val2017 (57.61 original)

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)

BackenddtypeTime per call (ms)vs original fp16Peak memory
allocated / reserved
Load (s)First call (s)
Original fp32visinf/INSID3@0c165a10cf52 set_reference + set_target + segment, its encoder autocast offfp32 16490.43×1,665 MiB/1,746 MiB7.22.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 MiB1.11.11
Portable fp32fp32not measured ––––
Portablefp16 2552.8×986 MiB/1,228 MiB2.70.44
Kernelsfp16 1574.5×987 MiB/1,228 MiB1.40.46
Portable + torch.compile 2353.0×985 MiB/1,206 MiB17 (build)–
TensorRT fp16image encoder onlyfp16 64.111×684 MiBenginenot comparable42 (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

DeviceBackenddtypems / callPeak memoryOutput vs referenceInput
Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-14Originalfp323121 3,003 MiB process–1024x1024
Portablefp162510 3,414 MiB processmatches1024x1024
Portablefp322953 2,963 MiB processmatches1024x1024
Kernelsfp16not 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 Face

fastforks 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 %

RundtypemIoU % ↑Δ mIoU % vs fp32 originalepisodesms / episode
Original fp32fp3257.61 reference 240 1434
Original fp16bf1657.56 −0.05 240 570
Portable fp32fp3257.61 ±0.00 240 1002
Portablefp1657.28 −0.33 240 252
Kernelsfp1657.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).

CheckToleranceMeasured
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 backbones
  • dpt_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.

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
insid3-vitl16synthetic (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-vitl16 1080x1920 (1.0 GiB peak allocated, 1.3 reserved)
  • insid3-vitl16 1024x1024, first call: portable + torch.compile 17 s (cold Inductor cache), TensorRT fp16 42 s (ONNX + engine).
  • insid3-vitl16 original (fp32) 1024x1024: visinf/INSID3@0c165a10cf52 set_reference + set_target + segment, its encoder autocast off
  • insid3-vitl16 original 1024x1024: the authors' mixed-precision option (bfloat16); visinf/INSID3@0c165a10cf52 set_reference + set_target + segment, bf16 autocast (as shipped)
  • insid3-vitl16 load / 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.

variantdatasetoriginal fp32original fp16portableportable fp32kernelsnote
insid3-vitl16COCO val2017, one-shot episodes (3 per class), class mIoU %57.6157.5657.2857.6157.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).

variantkernels error vs original, mean / p99GPU, torchkernels used
insid3-vitl160.00038 / 0.00117RTX 5060 Ti, torch 2.14.1+cu130dpt_fused@48e0065bb7cf:sm_120, fastbb@7d058322634d:sm_120

Example output

No example rendered for this checkpoint yet.