INSID3 (fastforks)
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.
This repo is the model card only: it holds no weights. fastforks downloads the authors' weights from the links below and checks them against the SHA-256 in the model card. Code: https://github.com/kleinicke/fastforks. Kernels for the kernels backend: https://huggingface.co/fastforks/kernels. Original code: https://github.com/visinf/INSID3 at 0c165a10cf52.
Author weight repos: https://huggingface.co/facebook/dinov3-vitl16-pretrain-lvd1689m.
Task: promptable_segmentation. Tier: experimental. Outputs: similarity, masks. Backends: portable, kernels.
Input: one image plus a point, box or text prompt. Output: masks with quality scores.
Variants
Weights are the authors' files (not hosted here). SHA-256 shortened to 12 hex digits; the full hashes are in card.toml.
| variant | weights (author link) | SHA-256 | weights licence | commercial use |
|---|---|---|---|---|
insid3-vitl16@1 |
dinov3-vitl16-pretrain-lvd1689m/model.safetensors | dcb2e45127cc |
LicenseRef-DINOv3-License | yes |
Licence
Original-code strings, recorded as they are (research-use package; check them before any other use). Code: Apache-2.0. Licence files: LICENSE.
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.
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)
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)
Speed and memory
Promptable segmentation, synthetic, 1024x1024
| model | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
|---|---|---|---|---|---|---|---|---|---|
insid3-vitl16 |
1649 | 713 | 255 | 157 | 4.5x | 1.6x | 2148 / 2226 | 986 / 1228 | 987 / 1228 |
Startup and first call
| model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
|---|---|---|---|---|---|---|
insid3-vitl16 |
1.06 | 2.69 | 1.39 | 1.11 | 0.44 | 0.46 |
torch.compile and TensorRT
| model | input | time: portable | compile | TensorRT fp16 | kernels | preparation: compile (cold first call) | ONNX + engine build | peak MiB (alloc / reserved): portable | compile | kernels | TensorRT (engine + torch) |
|---|---|---|---|---|---|---|---|---|---|---|---|
insid3-vitl16 |
1024x1024 | 255 ms | 235 ms | 64.1 ms (image encoder only) | 157 ms | 17.2 s | 42.1 s | 986 / 1228 | 985 / 1206 | 987 / 1228 | 1339 / 1508 |
Fixed-size cells: time (ms) / peak allocated / peak reserved memory (MiB).
Hardware, protocol and caveats: benchmarks (RTX 5060 Ti 16 GB, sm_120). Original = the original code named above at the precision of portable (fp16, or (fp32) where fp16 is unsupported or not finite); original fp32 = its default fp32 run. Peak memory is the torch allocator's.
Accuracy
On public datasets
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 | kernels | note |
|---|---|---|---|---|---|---|
insid3-vitl16 |
COCO val2017, one-shot episodes (3 per class), class mIoU % | 57.61 | 57.56 | 57.28 | 57.21 |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 7f5b4581+insid3, 2026-11-13.
Parity with the original code
Every variant is checked against reference outputs of the original code at its pinned commit. 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).
Usage
from fastforks import promptable_segmentation
model = promptable_segmentation.load("insid3-vitl16") # mode="auto": the preferred backend from recorded measurements
result = model("photo.jpg", reference_images="ref.jpg", reference_masks=ref_mask) # ref_mask [H, W] bool
result.masks # [M, H, W] bool: the referenced concept in photo.jpg
result.backend # what ran, e.g. Backend(mode='portable', device='cuda:0', dtype='float16')
Install with pip install fastforks (see https://github.com/kleinicke/fastforks). Other variants: insid3-vitl16.
Kernels backend
promptable_segmentation.load("insid3-vitl16", mode="kernels") runs our CUDA kernels (fastbb, dpt_fused). It needs a prebuilt kernel for your GPU architecture (downloaded from https://huggingface.co/fastforks/kernels on first use) and a recent NVIDIA driver; if there is none it raises BackendUnavailableError with the reason and never falls back silently. mode="auto" picks kernels when it can run and logs the choice.