Seg-Zero
Seg-Zero is a reasoning-chain-guided segmentation model based on cognitive reinforcement learning, designed to let the model output a reasoning chain before generating the final segmentation mask, thereby achieving emergent reasoning capability at test time. The project is trained entirely through reinforcement learning, without explicit supervision of reasoning data, and performs better than supervised fine-tuning on both in-domain and out-of-domain data. It adopts a decoupled architecture, comprising a reasoning model and a segmentation model, and manually designs a reward mechanism that fuses format and accuracy. The code is based on EasyR1 and veRL, supports the Qwen2-VL and Qwen2.5-VL series of models, and has implemented commonly used rewards for object detection and segmentation (such as IoU reward and L1 reward). The project also releases VisionReasoner and its related data and models, supports multiple targets and multiple tasks, and provides training data, pre-trained models, as well as evaluation data. Users can obtain resources through Hugging Face, support custom image and text inputs for inference, and can also perform GRPO training and checkpoint merging. This tool is suitable for visual understanding and reasoning research scenarios that require interpretable segmentation reasoning, but usage and training require attention to GPU memory requirements, and some operations are risky and require backup in advance.