This repo is the official implementation of Text-guided Visual Prompt DINO for Generic Segmentation, by Yuchen Guan, Chong Sun, Canmiao Fu, Zhipeng Huang, Chun Yuan, Chen Li.

Prompt-DINO is a unified model for open vocabulary detection and segmentation, capable of simultaneously outputting detection bounding boxes and segmentation masks. It accepts both text prompts and visual prompts, allowing it to perform detection and segmentation of the specified categories based on the given prompts. Prompt-DINO has been trained using over 10 million datasets and hundreds of millions of target instance boxes. It demonstrates strong performance in the field of open vocabulary detection and segmentation.
cd WeVisionOne/pixel_decoder/ops && sh make.sh
cd /path_to_detectron2/detectron2/ && python setup.py install
cd /path_to_mmcv/mmcv/ && MMCV_WITH_EXT=1 MMCV_WITH_OPS=1 MAX_JOBS=8 python setup.py build_ext && MMCV_WITH_OPS=1 python setup.py develop
pip3 install timm -i https://mirrors.tencent.com/pypi/simple/
pip3 install pycocotools -i https://mirrors.tencent.com/pypi/simple/
pip3 install omegaconf==2.4.0.dev2 -i https://mirrors.tencent.com/pypi/simple/
pip3 install shapely -i https://mirrors.tencent.com/pypi/simple/
pip3 install transformers -i https://mirrors.tencent.com/pypi/simple/
pip3 install panopticapi -i https://mirrors.tencent.com/pypi/simple/
We provide both a script and a Gradio demo: * Script Demo
cd Inference
IMG_PATH=resources/ships.jpg
python text_prompt.py --config-file configs/text_model_cfgs.yaml --img_path $IMG_PATH --text_prompts "ship"
Two outputs will be produced in "./output" folder, they should be like:

cd Inference
python gradio_demo.py


If you find our work helpful for your research, please consider citing the following BibTeX entry.
@inproceedings{guan2025text,
title={Text-guided Visual Prompt DINO for Generic Segmentation},
author={Guan, Yuchen and Sun, Chong and Fu, Canmiao and Huang, Zhipeng and Yuan, Chun and Li, Chen},
booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision},
pages={21288--21298},
year={2025}
}
$ claude mcp add WeVisionOne \
-- python -m otcore.mcp_server <graph>