UnSAMv2: Self-Supervised Learning Enables Segment Anything at Any Granularity

Project Page  |  arXiv  |  Code  |  Demo

UnSAMv2 adds granularity control to promptable segmentation. Alongside the usual point or box prompt, you pass a continuous granularity scalar that selects how fine or coarse the returned mask should be, letting a single model move smoothly from whole objects down to their parts without retraining or prompt engineering.

The model is trained without any human labels. A granularity-aware divide-and-conquer pipeline mines mask–granularity pairs from unlabeled images, and those pseudo-labels supervise a lightweight granularity embedding added to SAM 2.

Checkpoints

File Description NoC80 NoC90 1-IoU ↑ AR1000
unsamv2.pt UnSAMv2 2.28 3.40 79.3 68.3
unsamv2_plus.pt UnSAMv2+, trained on more unlabeled data 2.07 3.10 81.7 74.1

For reference, SAM 2 scores 2.44 / 3.63 / 69.0 / 49.6 on the same metrics.

Both checkpoints are fine-tuned from SAM 2.1 Hiera-Small (46.4M parameters) and are saved in the SAM 2 training format, with the weights under the model key.

Usage

Install the code from the UnSAMv2 repository, then download a checkpoint:

from huggingface_hub import hf_hub_download

ckpt = hf_hub_download("yujunwei04/UnSAMv2", "unsamv2_plus.pt")

Load it the way the repository's notebooks do, passing a granularity scalar alongside your point or box prompt. The repository covers interactive segmentation, whole-image segmentation, and video segmentation.

Training data

Self-supervised pseudo-labels mined from unlabeled images. No human segmentation annotations were used to train these checkpoints.

License

Released under the Apache License 2.0.

Citation

@article{yu2025unsamv2,
  title={UnSAMv2: Self-Supervised Learning Enables Segment Anything at Any Granularity},
  author={Yu, Junwei and Darrell, Trevor and Wang, XuDong},
  journal={arXiv preprint arXiv:2511.13714},
  year={2025}
}
Downloads last month
80
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for yujunwei04/UnSAMv2

Finetuned
(19)
this model

Paper for yujunwei04/UnSAMv2