Rex-Omni

IDEA-Research更新放缓

基于多模态大模型的目标检测方案,把检测任务转成下一个点预测,支持开放场景下检测任意物体。

[CVPR2026] Detect Anything via Next Point Prediction

暂无版本1,635star110fork同步于 2026-11-07 07:30 UTC

怎么上手

由 README 提炼,执行前请确认
git clone https://github.com/IDEA-Research/Rex-Omni.git
cd Rex-Omni
conda create -n rexomni python=3.10 -y
conda activate rexomni
pip install torch==2.7.0 torchvision --index-url https://download.pytorch.org/whl/cu128
pip install -r requirements.txt
pip install -v -e .
硬件要求按 README 说明

README 未明确给出显存要求;示例用 CUDA_VISIBLE_DEVICES 指定单卡运行,安装命令使用 cu128 版 PyTorch,说明需要 NVIDIA GPU;vllm 后端需兼容环境,AWQ 量化版需配合 vllm 使用。

多卡 / 张量并行
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

3B 多模态大模型,把目标检测等视觉感知任务统一成下一个点预测

基于多模态大模型的目标检测方案,把检测任务转成下一个点预测,支持开放场景下检测任意物体。

核心能力

  • 把检测、指向、关键点、OCR 等任务统一为 next-token 预测
  • 支持 detection、pointing、keypoint、ocr_box、gui_grounding 等多种任务
  • 提供 transformers 与 vllm 两种推理后端,vllm 面向高吞吐
  • 提供 AWQ 量化权重,节省约 50% 存储空间
  • 附带评测代码、微调代码(SFT/GRPO)与 Gradio Demo

容易踩的坑

模型权重需从 Hugging Face(IDEA-Research/Rex-Omni 或 Rex-Omni-AWQ)加载,首次运行会自动下载;vllm 后端需额外安装 vllm 包并保证环境兼容,AWQ 量化版必须用 vllm 后端;Gradio Demo 的 server_name 默认是 192.168.81.138、端口默认 5211,本地访问需自行改参数。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    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.

    News 🎉

    • [2026-01-10] Pointing Task Finetuning is now supported! Train Rex-Omni on custom pointing datasets with SFT and GRPO. See Fine-tuning Guide for details.
    • [2025-10-31] We release the AWQ quantized version of Rex-Omni, which saves 50% of the storage space. Rex-Omni-AWQ
    • [2025-10-29] Fine-tuning code is now available.
    • [2025-10-17] Evaluation code and dataset is now available.
    • [2025-10-15] Rex-Omni is released.

    Table of Contents

    TODO LIST 📝

    • Add Evaluation Code
    • Add Fine-tuning Code
    • Add Quantilized Rex-Omni

    1. Installation ⛳️

    git clone https://github.com/IDEA-Research/Rex-Omni.git
    cd Rex-Omni
    conda create -n rexomni python=3.10 -y
    conda activate rexomni
    pip install torch==2.7.0 torchvision --index-url https://download.pytorch.org/whl/cu128
    pip install -r requirements.txt
    pip install -v -e .
    

    Test Installation

    CUDA_VISIBLE_DEVICES=1 python tutorials/detection_example/detection_example.py
    

    If the installation is successful, you will find a visualization of the detection results at tutorials/detection_example/test_images/cafe_visualize.jpg

    2. Quick Start: Using Rex-Omni for Detection

    Below is a minimal example showing how to run object detection using the rex_omni package.

    from PIL import Image
    from rex_omni import RexOmniWrapper, RexOmniVisualize
    
    # 1) Initialize the wrapper (model loads internally)
    rex = RexOmniWrapper(
        model_path="IDEA-Research/Rex-Omni",   # HF repo or local path
        backend="transformers",                # or "vllm" for high-throughput inference
        # Inference/generation controls (applied across backends)
        max_tokens=2048,
        temperature=0.0,
        top_p=0.05,
        top_k=1,
        repetition_penalty=1.05,
    )
    
    # If you are using the AWQ quantized version of Rex-Omni, you can use the following code:
    rex = RexOmniWrapper(
        model_path="IDEA-Research/Rex-Omni-AWQ",
        backend="vllm",
        quantization="awq",
        max_tokens=2048,
        temperature=0.0,
        top_p=0.05,
        top_k=1,
        repetition_penalty=1.05,
    )
    
    # 2) Prepare input
    image = Image.open("tutorials/detection_example/test_images/cafe.jpg").convert("RGB")
    categories = [
        "man", "woman", "yellow flower", "sofa", "robot-shope light",
        "blanket", "microwave", "laptop", "cup", "white chair", "lamp",
    ]
    
    # 3) Run detection
    results = rex.inference(images=image, task="detection", categories=categories)
    result = results[0]
    
    # 4) Visualize
    vis = RexOmniVisualize(
        image=image,
        predictions=result["extracted_predictions"],
        font_size=20,
        draw_width=5,
        show_labels=True,
    )
    vis.save("tutorials/detection_example/test_images/cafe_visualize.jpg")
    
    Initialization parameters (RexOmniWrapper)
    • model_path: Hugging Face repo ID or a local checkpoint directory for the Rexe-Omni model.
    • backend: "transformers" or "vllm".
      • transformers: easy to use, good baseline latency.
      • vllm: high-throughput, low-latency inference. Requires the vllm package and a compatible environment.
    • max_tokens: Maximum number of tokens to generate for each output.
    • temperature: Sampling temperature; higher values increase randomness (0.0 = deterministic/greedy).
    • top_p: Nucleus sampling parameter; model samples from the smallest set of tokens with cumulative probability ≥ top_p.
    • top_k: Top-k sampling; restricts sampling to the k most likely tokens.
    • repetition_penalty: Penalizes repeated tokens; >1.0 discourages repetition.
    • Optional advanced settings (supported via kwargs when constructing the wrapper):
      • Transformers: torch_dtype, attn_implementation, device_map, trust_remote_code, etc.
      • VLLM: tokenizer_mode, limit_mm_per_prompt, max_model_len, gpu_memory_utilization, tensor_parallel_size, trust_remote_code, etc.
    Inference parameters (rex.inference)
    • images: A single PIL.Image.Image or a list of images for batch inference.
    • task: One of "detection", "pointing", "visual_prompting", "keypoint", "ocr_box", "ocr_polygon", "gui_grounding", "gui_pointing".
    • categories: List of category names/phrases to detect or extract, e.g., ["person", "cup"]. Used to build task prompts.
    • **keypoint_type": Type of keypoints for keypoint detection task. Options: "person", "hand", "animal"
    • visual_prompt_boxes: Reference bounding boxes for visual prompting task. Format: [[x0, y0, x1, y1], ...] in absolute coordinates

    Returns a list of dictionaries (one per input image). Each dictionary includes:

    • raw_output: The raw text generated by the LLM.
    • extracted_predictions: Structured predictions parsed from the raw output, grouped by category.
      • For detection: {category: [{"type": "box", "coords": [x0,y0,x1,y1]}, ...], ...}
      • For pointing: {category: [{"type": "point", "coords": [x0,y0]}, ...], ...}
      • For polygon: {category: [{"type": "polygon", "coords": [x0,y0, ...]}, ...], ...}
      • For keypointing: Structured Json

    Tips:

    • For best performance with VLLM, set backend="vllm" and tune gpu_memory_utilization and tensor_parallel_size according to your GPUs.

    3. Cookbooks

    We provide comprehensive tutorials for each supported task. Each tutorial includes both standalone Python scripts and interactive Jupyter notebooks.

    TaskApplicationsDemoPython ExampleNotebook
    Detectionobject detectioncodenotebook
    object referringcodenotebook
    gui groundingcodenotebook
    layout groundingcodenotebook
    Pointingobject pointingcodenotebook
    gui pointingcodenotebook
    affordance pointingcodenotebook
    Visual promptingvisual promptingcodenotebook
    OCRocr word boxcodenotebook
    ocr textline boxcodenotebook
    ocr polygoncodenotebook
    Keypointingperson keypointingcodenotebook
    animal keypointingcodenotebook
    Otherbatch inferencecode

    4. Applications of Rex-Omni

    Rex-Omni's unified detection framework enables seamless integration with other vision models.

    ApplicationDescriptionDemoDocumentation
    Rex-Omni + SAMCombine language-driven detection with pixel-perfect segmentation. Rex-Omni detects objects → SAM generates precise masksREADME
    Grounding Data EngineAutomatically generate phrase grounding annotations from image captions using spaCy and Rex-Omni.README

    5. Gradio Demo

    img

    We provide an interactive Gradio demo that allows you to test all Rex-Omni capabilities through a web interface.

    Quick Start

    # Launch the demo
    CUDA_VISIBLE_DEVICES=0 python app.py --model_path IDEA-Research/Rex-Omni
    
    # With custom settings
    CUDA_VISIBLE_DEVICES=0 python app.py \
        --model_path IDEA-Research/Rex-Omni \
        --backend vllm \
        --server_name 0.0.0.0 \
        --server_port 7890
    

    Available Options

    • --model_path: Model path or HuggingFace repo ID (default: "IDEA-Research/Rex-Omni")
    • --backend: Backend to use - "transformers" or "vllm" (default: "transformers")
    • --server_name: Server host address (default: "192.168.81.138")
    • --server_port: Server port (default: 5211)
    • --temperature: Sampling temperature (default: 0.0)
    • --top_p: Nucleus sampling parameter (default: 0.05)
    • --max_tokens: Maximum tokens to generate (default: 2048)

    6. Evaluation

    Please refer to Evaluation for more details.

    7. Fine-tuning Rex-Omni

    Please refer to Fine-tuning Rex-Omni for more details.

    8. LICENSE

    Rex-Omni is licensed under the IDEA License 1.0, Copyright (c) IDEA. All Rights Reserved. This model is based on Qwen, which is licensed under the Qwen RESEARCH LICENSE AGREEMENT, Copyright (c) Alibaba Cloud. All Rights Reserved.

    9. Citation

    Rex-Omni comes from a series of prior works. If you’re interested, you can take a look.

    @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}, 
    }