T-Rex2 is a generic object detection model from IDEA Research that works through text-visual prompt synergy, with this repository providing its API code on GitHub, where it has about 2,700 stars. It detects and counts objects in images using either text descriptions, visual examples, or both.
Traditional detectors are limited to fixed category lists. T-Rex2 is open-set: you point it at an image with a visual prompt, such as drawing a box around one example, or describe targets in text, and it finds all matching objects, which makes it strong at interactive detection and object counting in cluttered scenes. The repository contains example code for calling the T-Rex2 API hosted on DeepDataSpace, plus guidance for the interactive playground. The work was presented at ECCV 2024, and the team has since released Rex-Omni, a fully open-sourced successor. The repo remains maintained, with updates in 2025.
The API code in this repository is open source. Running T-Rex2 uses the DeepDataSpace cloud API, which requires an API key and paid usage beyond any trial quota, so the practical path is freemium.
T-Rex2 is for computer vision developers and researchers who need flexible, prompt-driven detection and counting without training a custom detector for every new category.