### Installing VisionReasoner Dependencies (Bash) Source: https://github.com/dvlab-research/visionreasoner/blob/main/README.md This snippet provides the commands to clone the VisionReasoner repository, navigate into it, create and activate a new Conda environment named `visionreasoner_test` with Python 3.12, and then install the necessary Python packages including `torch`, `torchvision`, and other dependencies listed in `requirements.txt`. It sets up the development environment for the project. ```bash git clone https://github.com/dvlab-research/VisionReasoner.git cd VisionReasoner conda create -n visionreasoner_test python=3.12 conda activate visionreasoner_test pip3 install torch torchvision pip install -r requirements.txt ``` -------------------------------- ### Downloading Pretrained VisionReasoner Models (Bash) Source: https://github.com/dvlab-research/visionreasoner/blob/main/README.md This snippet outlines the steps to download the pretrained VisionReasoner-7B and TaskRouter-1.5B models from Hugging Face. It first creates a `pretrained_models` directory, changes into it, initializes Git LFS, and then clones the two model repositories. These models are essential for running inference with VisionReasoner. ```bash mkdir pretrained_models cd pretrained_models git lfs install git clone https://huggingface.co/Ricky06662/VisionReasoner-7B git clone https://huggingface.co/Ricky06662/TaskRouter-1.5B ``` -------------------------------- ### Performing Detection/Segmentation with VisionReasoner (Bash) Source: https://github.com/dvlab-research/visionreasoner/blob/main/README.md This command demonstrates how to use VisionReasoner for a detection or segmentation task. It takes an image path and a natural language query to identify and segment objects. The output includes a thinking process in the command line and a visualization in `result_visualization.png`. ```bash python vision_reasoner/inference.py --image_path "assets/donuts.png" --query "please segment the donuts" ``` -------------------------------- ### Running Simple Queries in Hybrid Mode (Bash) Source: https://github.com/dvlab-research/visionreasoner/blob/main/README.md This command demonstrates VisionReasoner's hybrid reasoning mode for simple queries. When `--hybrid_mode` is enabled, the model directly uses YOLO-World for object detection for straightforward queries, resulting in faster response times without engaging the full reasoning process. ```bash python vision_reasoner/inference.py --image "assets/crowd.png" --query "person" --hybrid_mode ``` -------------------------------- ### Running VisionReasoner Inference Script (Bash) Source: https://github.com/dvlab-research/visionreasoner/blob/main/README.md This command executes the main inference script for VisionReasoner. It runs `inference.py` located within the `vision_reasoner` directory, which processes an image (defaulting to a counting task) and outputs the thinking process and final answer to the command line. This script is the entry point for using the trained models for predictions. ```bash python vision_reasoner/inference.py ``` -------------------------------- ### Executing Reasoning Tasks with VisionReasoner (Bash) Source: https://github.com/dvlab-research/visionreasoner/blob/main/README.md This command illustrates how to perform a reasoning-based task using VisionReasoner. It processes an image and a complex query requiring spatial or contextual understanding. The system provides a detailed thinking process in the command line and visualizes the result. ```bash python vision_reasoner/inference.py --image_path "assets/stand_higher.png" --query "find what can make the woman stand higher?" ``` -------------------------------- ### Performing Visual QA/Captioning with VisionReasoner (Bash) Source: https://github.com/dvlab-research/visionreasoner/blob/main/README.md This command shows how to use VisionReasoner for a direct Visual Question Answering (VQA) or captioning task. Unlike reasoning tasks, VQA provides a direct answer in the command line without a detailed thinking process. It takes an image and a straightforward question. ```bash python vision_reasoner/inference.py --image_path "assets/company_name.png" --query "What is name of the company?" ``` -------------------------------- ### Evaluating Segmentation with HuggingFace Dataset (Bash) Source: https://github.com/dvlab-research/visionreasoner/blob/main/README.md This bash command executes the segmentation evaluation script using a dataset specified by its HuggingFace path. It's designed to test VisionReasoner's segmentation performance on standard benchmarks like RefCOCO, RefCOCO+, RefCOCOg, and ReasonSeg. ```bash bash evaluation/eval_segmentation.sh Ricky06662/refcoco_val ``` -------------------------------- ### Custom Image and Query Inference with VisionReasoner (Bash) Source: https://github.com/dvlab-research/visionreasoner/blob/main/README.md This general command allows users to run VisionReasoner inference with their own image path and custom query text. It serves as a flexible template for various tasks, including detection, segmentation, reasoning, or VQA, depending on the provided query. ```bash python vision_reasoner/inference.py --image_path "your_image_path" --query "your question text" ``` -------------------------------- ### BibTeX Citations for VisionReasoner and Seg-Zero Source: https://github.com/dvlab-research/visionreasoner/blob/main/README.md This BibTeX block provides academic citations for the Seg-Zero and VisionReasoner projects. It includes details such as titles, authors, publication venues (arXiv preprints), and years, suitable for inclusion in research papers. ```bibtex @article{liu2025segzero, title = {Seg-Zero: Reasoning-Chain Guided Segmentation via Cognitive Reinforcement}, author = {Liu, Yuqi and Peng, Bohao and Zhong, Zhisheng and Yue, Zihao and Lu, Fanbin and Yu, Bei and Jia, Jiaya}, journal = {arXiv preprint arXiv:2503.06520}, year = {2025} } @misc{liu2025visionreasoner, title = {VisionReasoner: Unified Visual Perception and Reasoning via Reinforcement Learning}, author = {Liu, Yuqi and Qu, Tianyuan and Zhong, Zhisheng and Peng, Bohao and Liu, Shu and Yu, Bei and Jia, Jiaya}, howpublished = {arXiv preprint arXiv:2505.12081}, year = {2025} } ``` -------------------------------- ### Evaluating Segmentation with Local Dataset (Bash) Source: https://github.com/dvlab-research/visionreasoner/blob/main/README.md This bash command runs the segmentation evaluation script using a dataset located on the local filesystem. It allows users to test VisionReasoner's segmentation performance against custom or locally stored datasets, providing flexibility in evaluation. ```bash bash evaluation/eval_segmentation.sh /path/to/your/local/refcoco_val ``` -------------------------------- ### Evaluating Segmentation with VisionReasoner (Bash) Source: https://github.com/dvlab-research/visionreasoner/blob/main/README.md These bash commands execute the segmentation evaluation script for the VisionReasoner project across various RefCOCO, RefCOCO+, RefCOCOg, and ReasonSeg datasets. Each command specifies a different dataset to be evaluated using the 'eval_segmentation.sh' script. ```bash bash evaluation/eval_segmentation.sh Ricky06662/refcoco_val ``` ```bash bash evaluation/eval_segmentation.sh Ricky06662/refcoco_testA ``` ```bash bash evaluation/eval_segmentation.sh Ricky06662/refcocoplus_val ``` ```bash bash evaluation/eval_segmentation.sh Ricky06662/refcocoplus_testA ``` ```bash bash evaluation/eval_segmentation.sh Ricky06662/refcocog_val ``` ```bash bash evaluation/eval_segmentation.sh Ricky06662/refcocog_test ``` ```bash bash evaluation/eval_segmentation.sh Ricky06662/ReasonSeg_val ``` ```bash bash evaluation/eval_segmentation.sh Ricky06662/ReasonSeg_test ``` -------------------------------- ### Running Complex Queries in Hybrid Mode (Bash) Source: https://github.com/dvlab-research/visionreasoner/blob/main/README.md This command illustrates VisionReasoner's hybrid reasoning mode for complex queries. With `--hybrid_mode` enabled, the model intelligently switches to a reasoning-based approach when the query requires spatial understanding or complex visual attributes, providing a detailed thinking process. ```bash python vision_reasoner/inference.py --image "assets/crowd.png" --query "the person who is facing to the camera" --hybrid_mode ``` -------------------------------- ### Customizing Evaluation with Local Model Paths (Bash) Source: https://github.com/dvlab-research/visionreasoner/blob/main/README.md This bash command allows for advanced customization of the evaluation process by specifying local paths for VisionReasoner, TaskRouter, and segmentation models. This is useful for testing custom or fine-tuned models without relying on HuggingFace downloads, enabling comprehensive local evaluation. ```bash bash evaluation/eval_segmentation.sh [dataset_path] \ --model_path /path/to/local/VisionReasoner-7B \ --task_router_model_path /path/to/local/TaskRouter-1.5B \ --segmentation_model_path /path/to/local/sam2-model ``` -------------------------------- ### Evaluating Counting Performance (Bash) Source: https://github.com/dvlab-research/visionreasoner/blob/main/README.md This bash command runs the `eval_count.sh` script to evaluate VisionReasoner's performance on counting benchmarks. This script assesses the model's ability to accurately count objects within images, which is a specific and challenging computer vision task. ```bash bash evaluation/eval_count.sh ``` -------------------------------- ### Evaluating Counting with VisionReasoner (Bash) Source: https://github.com/dvlab-research/visionreasoner/blob/main/README.md These bash commands execute the counting evaluation script for the VisionReasoner project on various counting datasets. The 'eval_count.sh' script is used to evaluate performance on 'counting_pixmo_validation', 'counting_pixmo_test', and 'counting_countbench' datasets. ```bash bash evaluation/eval_count.sh Ricky06662/counting_pixmo_validation ``` ```bash bash evaluation/eval_count.sh Ricky06662/counting_pixmo_test ``` ```bash bash evaluation/eval_count.sh Ricky06662/counting_countbench ``` -------------------------------- ### Evaluating COCO Dataset with VisionReasoner (Bash) Source: https://github.com/dvlab-research/visionreasoner/blob/main/README.md This bash command runs the COCO evaluation script for the VisionReasoner project. It specifically targets the 'coco_val' dataset, utilizing the 'eval_coco.sh' script to assess performance on the COCO benchmark. ```bash bash evaluation/eval_coco.sh Ricky06662/coco_val ``` -------------------------------- ### Evaluating COCO Detection Performance (Bash) Source: https://github.com/dvlab-research/visionreasoner/blob/main/README.md This bash command executes the `eval_coco.sh` script to evaluate VisionReasoner's detection performance specifically on the COCO dataset. It is used to assess the model's accuracy in object detection tasks against a widely recognized benchmark. ```bash bash evaluation/eval_coco.sh ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.