Image-Text-to-Text
Transformers
Safetensors
English
qwen2_5_vl
vision
object-detection
multimodal
ocr
keypoint-detection
visual-prompting
open-set-detection
object-pointing
conversational
text-generation-inference
Instructions to use IDEA-Research/Rex-Omni with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use IDEA-Research/Rex-Omni with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="IDEA-Research/Rex-Omni") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("IDEA-Research/Rex-Omni") model = AutoModelForMultimodalLM.from_pretrained("IDEA-Research/Rex-Omni", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use IDEA-Research/Rex-Omni with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "IDEA-Research/Rex-Omni" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IDEA-Research/Rex-Omni", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/IDEA-Research/Rex-Omni
- SGLang
How to use IDEA-Research/Rex-Omni with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "IDEA-Research/Rex-Omni" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IDEA-Research/Rex-Omni", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "IDEA-Research/Rex-Omni" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IDEA-Research/Rex-Omni", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use IDEA-Research/Rex-Omni with Docker Model Runner:
docker model run hf.co/IDEA-Research/Rex-Omni
File size: 5,477 Bytes
8bf3b08 8cf62b2 8bf3b08 8cf62b2 8bf3b08 6c2b81f 8cf62b2 8bf3b08 8cf62b2 8bf3b08 029ccfa 8bf3b08 8cf62b2 8bf3b08 71d9b90 8bf3b08 8cf62b2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | ---
base_model:
- Qwen/Qwen2.5-VL-3B-Instruct
language:
- en
pipeline_tag: image-text-to-text
tags:
- vision
- object-detection
- multimodal
- ocr
- keypoint-detection
- visual-prompting
- open-set-detection
- object-pointing
library_name: transformers
license: other
---
This model is **Rex-Omni**, a 3B-parameter Multimodal Large Language Model (MLLM) presented in the paper "[Detect Anything via Next Point Prediction](https://huggingface.co/papers/2510.12798)". It is compatible with the Hugging Face `transformers` library and is licensed under the [IDEA License 1.0](https://github.com/IDEA-Research/Rex-Omni/blob/main/LICENSE).
<div align=center>
<img src="assets/logo.png" width=600 >
</div>
<h1 align="center">Detect Anything via Next Point Prediction</h1>
<div align=center>
<p align="center">
<a href="https://rex-omni.github.io/">
<img
src="https://img.shields.io/badge/RexOmni-Website-BADFDB?style=flat-square&logo=deno&logoColor=violet&color=BADFDB"
alt="RexThinker Website"
/>
</a>
<a href="https://arxiv.org/abs/2510.12798">
<img
src="https://img.shields.io/badge/RexOmni-Paper-Red%25red?logo=arxiv&logoColor=red&color=yellow"
alt="RexThinker Paper on arXiv"
/>
</a>
<a href="https://huggingface.co/IDEA-Research/Rex-Omni">
<img
src="https://img.shields.io/badge/RexOmni-Weight-orange?logo=huggingface&logoColor=yellow"
alt="RexThinker weight on Hugging Face"
/>
</a>
<a href="https://huggingface.co/spaces/Mountchicken/Rex-Omni">
<img
src="https://img.shields.io/badge/RexOmni-Demo-orange?logo=huggingface&logoColor=yellow"
alt="RexThinker Demo on Hugging Face"
/>
</a>
<a href="https://github.com/IDEA-Research/Rex-Omni">
<img
src="https://img.shields.io/badge/GitHub-Code-blue?logo=github&logoColor=white"
alt="GitHub Code"
/>
</a>
</p>
</div>
> Rex-Omni is a 3B-parameter Multimodal Large Language Model (MLLM) that redefines object detection and a wide range of other visual perception tasks as a simple next-token prediction problem.
<p align="center"><img src="assets/teaser.png" width="95%"></p>
## ๐ Quick Start
### Installation
```bash
conda create -n rexomni -m python=3.10
pip install torch==2.6.0 torchvision==0.21.0 --index-url https://download.pytorch.org/whl/cu124
git clone https://github.com/IDEA-Research/Rex-Omni.git
cd Rex-Omni
pip install -v -e .
```
## 2. Quick Start: Using Rex-Omni for Detection
```python
from PIL import Image
from rex_omni import RexOmniWrapper, RexOmniVisualize
# Initialize model
model = RexOmniWrapper(
model_path="IDEA-Research/Rex-Omni",
backend="transformers" # or "vllm"
)
# Load image
image = Image.open("your_image.jpg")
# Object Detection
results = model.inference(
images=image,
task="detection",
categories=["person", "car", "dog"]
)
result = results[0]
# 4) Visualize
vis = RexOmniVisualize(
image=image,
predictions=result["extracted_predictions"],
font_size=20,
draw_width=5,
show_labels=True,
)
vis.save("visualize.jpg")
```
## 3. Tutorials
We provide a series of tutorials to help you get started with Rex-Omni.
- [Detection Example](https://github.com/IDEA-Research/Rex-Omni/blob/master/tutorials/detection_example/_full_notebook.ipynb)
- [Pointing Example](https://github.com/IDEA-Research/Rex-Omni/blob/master/tutorials/pointing_example/_full_tutorial.ipynb)
- [OCR Example](https://github.com/IDEA-Research/Rex-Omni/blob/master/tutorials/ocr_example/_full_tutorial.ipynb)
- [Keypointing Example](https://github.com/IDEA-Research/Rex-Omni/blob/master/tutorials/keypointing_example/_full_tutorial.ipynb)
- [Visual Prompting Example](https://github.com/IDEA-Research/Rex-Omni/blob/master/tutorials/visual_prompting_example/_full_tutorial.ipynb)
- [Batch Inference Example](https://github.com/IDEA-Research/Rex-Omni/blob/master/tutorials/other_example/batch_inference.py)
## ๐ License
Rex-Omni is licensed under the [IDEA License 1.0](LICENSE), Copyright (c) IDEA. All Rights Reserved. This model is based on Qwen, which is licensed under the [Qwen RESEARCH LICENSE AGREEMENT](https://huggingface.co/Qwen/Qwen2.5-VL-3B-Instruct/blob/main/LICENSE), Copyright (c) Alibaba Cloud. All Rights Reserved.
## ๐ Links
- ๐ [Homepage](https://rex-omni.github.io/)
- ๐ฎ [Demo](https://huggingface.co/spaces/Mountchicken/Rex-Omni)
## ๐ง Contact
For questions and feedback, please contact us at:
- Email: jiangqing@idea.edu.cn
- GitHub Issues: [IDEA-Research/Rex-Omni](https://github.com/IDEA-Research/Rex-Omni/issues)
## 7. Citation
Rex-Omni comes from a series of prior works. If youโre interested, you can take a look.
- [RexThinker](https://arxiv.org/abs/2506.04034)
- [RexSeek](https://arxiv.org/abs/2503.08507)
- [ChatRex](https://arxiv.org/abs/2411.18363)
- [DINO-X](https://arxiv.org/abs/2411.14347)
- [Grounidng DINO 1.5](https://arxiv.org/abs/2405.10300)
- [T-Rex2](https://link.springer.com/chapter/10.1007/978-3-031-73414-4_3)
- [T-Rex](https://arxiv.org/abs/2311.13596)
```bibtex
@misc{jiang2025detectpointprediction,
title={Detect Anything via Next Point Prediction},
author={Qing Jiang and Junan Huo and Xingyu Chen and Yuda Xiong and Zhaoyang Zeng and Yihao Chen and Tianhe Ren and Junzhi Yu and Lei Zhang},
year={2025},
eprint={2510.12798},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2510.12798},
}
``` |