AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
UnSAMv2: Self-Supervised Learning Enables Segment Anything at Any Granularity
Translation pending
Developer toolsJupyter Notebook · PythonGitHub @yujunwei04OnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
Code release for "UnSAMv2: Self-Supervised Learning Enables Segment Anything at Any Granularity"
Translation pending
Taken from the repository README
Loading the full README. The saved excerpt is shown below.
UnSAMv2: Self-Supervised Learning Enables Segment Anything at Any Granularity
Junwei Yu ,
Trevor Darrell ,
XuDong Wang *
UC Berkeley
• Corresponding author
News 🎉
• 11/17/2025: We released UnSAMv2.
Demo
We host our model on HuggingFace space, feel free to try our UnSAMv2 Demo! UnSAMv2 support granularity control for interactive image segmentation, whole image segmentation, and video segmentation.Read the full README ↗We host our model on HuggingFace space, feel free to try our UnSAMv2 Demo! UnSAMv2 support granularity control for interactive image segmentation, whole image segmentation, and video segmentation.
Interactive Segmentation: Add point prompts and granularity scaler first, and click segment to run inference. Click the little cross icon on the top-right corner if you want to try your own image!
Whole Image Segmentation: UnSAMv2 supports to find all instance at a given granularity score in images. Click "generate masks" to run inference.
Video Segmentation: UnSAMv2 can propagate mask at your desired granularity across video frames! Firstly, add point prompts and granularity and click "segment frame". Then, we can propagate the mask to later frames by clicking "propagate video."
We provide installation instructions here.
UnSAMv2 has two stages. (1) We generate pseudo mask-granularity pairs with granularity-aware divide-and-conquer. (2) We utilize these unsupervised data to finetune SAM-2 with granularity module.
To run granularity-aware divide-and-conquer, please download CutLER's weights here
Then, specify the input, output, and checkpoint path in the script and run
cd granularity_divide_and_conquer
bash run_gra_dico.sh
We host UnSAMv2 model on HuggingFace Space, feel free to try it out by following demo. If you want to run UnSAMv2 or UnSAMv2+ locally, we provide tutorial notebooks for different tasks, please download UnSAMv2/UnSAMv2+ checkpoints from the model zoo.
We provide the tutorial notebook for running UnSAMv2's interactive segmentation here.
We provide the tutorial notebook for running UnSAMv2's whole image segmentation here.
We provide the tutorial notebook for running UnSAMv2's video segmentation here.
UnSAMv2 achieves state-of-the-art performance on interactive segmentation and whole image segmentation by finetuning SAM-2 with pseudo-labeled mask-granularity pairs on 6,000 images.
For interactive segmentation, we report averaged Number of clicks (NoC) and Intersection of Union with 1 click(1-IoU) across 5 datasets: GrabCut, Berkeley, DAVIS, SA-1B, PartImageNet.
For whole image segmentation, we report Average Recall (AR) on 5 datasets: COCO, LVIS, ADE20K, Entity, SA-1B.
| Method | Models | NoC80 ↓ | NoC90 ↓ | 1-IoU ↑ | AR1000 ↑ |
|---|---|---|---|---|---|
| SimpleClick | - | 3.32 | 4.87 | 60.2 | - |
| UnSAM | - | - | - | - | 39.2 |
| GraCo | - | 2.35 | 3.42 | 74.4 | - |
| SAM-2 | - | 2.44 | 3.63 | 69.0 | 49.6 |
| UnSAMv2 | Download | 2.28 | 3.40 | 79.3 | 68.3 |
| UnSAMv2+ | Download | 2.07 | 3.10 | 81.7 | 74.1 |
Download corresponding datasets and specify the data path here. Then run the evaluation
cd evaluation/interactive
bash sam2_eval.sh
Download corresponding dataset and run inference script to get coco style annotations
cd ./evaluation/whole_image
bash run_coco_annotator.sh
Then we can get numbers by running
cd ./evaluation/whole_image
bash evaluate.sh
This project is licensed under the Apache License 2.0.
This codebase is built on UnSAM, SAM-2, CutLER, DINOv3, HQ-SAM, and GraCo. We sincerely appreciate the authors for open-sourcing their code.
If you have any general questions, feel free to email us at [email protected] and [email protected]. If you have code questions, we encourage you to open an issue in this repo as your question may help others.
If you find our work inspiring or use our codebase in your research, please consider giving us a star ⭐ and a 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}
}
@article{wang2024segment,
title={Segment anything without supervision},
author={Wang, XuDong and Yang, Jingfeng and Darrell, Trevor},
journal={Advances in Neural Information Processing Systems},
volume={37},
pages={138731--138755},
year={2024}
}