OWL-ViT (Open-World Localization with Vision Transformers) is an open-vocabulary object detector that uses a CLIP-based ViT-B/32 backbone. Given an image and one or more free-form text queries, the model predicts bounding boxes and confidence scores for each query.
This is based on the implementation of OWL-ViT found here. This repository contains scripts for optimized on-device export suitable to run on Qualcomm® devices. More details on model performance across various devices, can be found here.
Qualcomm AI Hub Models uses Qualcomm AI Hub Workbench to compile, profile, and evaluate this model. Sign up to run these models on a hosted Qualcomm® device.
Use our lightweight command-line interface to inspect and download OWL-ViT:
pip install qai_hub_models_cli # (the CLI is also available with the qai-hub-models package)
# Inspect the model and list the available download options
qai-hub-models info OWL-ViT
# Print performance and accuracy metrics
qai-hub-models perf OWL-ViT
qai-hub-models numerics OWL-ViT
# Download a ready-to-deploy asset
qai-hub-models fetch OWL-ViT --runtime tflite --precision floatSee the CLI README for the full list of commands and filters.
Install the base package, then use the qai-hub-models CLI to install this
recipe's dependencies:
# NOTE: 3.10 <= PYTHON_VERSION < 3.14 is supported.
pip install qai-hub-models
qai-hub-models install owl_vitSign-in to Qualcomm® AI Hub Workbench with your
Qualcomm® ID. Once signed in navigate to Account -> Settings -> API Token.
With this API token, you can configure your client to run models on the cloud hosted devices.
qai-hub configure --api_token API_TOKENNavigate to docs for more information.
Run the following simple CLI demo to verify the model is working end to end:
qai-hub-models demo owl_vitMore details on the CLI tool can be found with the --help option. See
demo.py for sample usage of the model including pre/post processing
scripts. Please refer to our general instructions on using
models for more usage instructions.
By default, the demo will run locally in PyTorch. Pass --eval-mode on-device to run the model on a cloud-hosted target device.
To run the model on Qualcomm® devices, you must export the model for use with an edge runtime such as TensorFlow Lite, ONNX Runtime, or Qualcomm AI Engine Direct. Use the following command to export the model:
qai-hub-models export owl_vitAdditional options are documented with the --help option.
- The license for the original implementation of OWL-ViT can be found here.
- Join our AI Hub Slack community to collaborate, post questions and learn more about on-device AI.
- For questions or feedback please reach out to us.