qaihm-bot commited on
Commit
d9297e5
·
verified ·
1 Parent(s): 0aa9e7e

See https://github.com/quic/ai-hub-models/releases/v0.46.1 for changelog.

README.md CHANGED
@@ -9,285 +9,133 @@ pipeline_tag: video-object-tracking
9
 
10
  ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/track_anything/web-assets/model_demo.png)
11
 
12
- # Track-Anything: Optimized for Mobile Deployment
13
- ## High-performance interactive tracking and segmentation in videos
14
-
15
 
16
  Track-Anything is a video based machine learning model to track an object in a video.
17
 
18
- This model is an implementation of Track-Anything found [here](https://github.com/gaomingqi/Track-Anything).
19
-
20
-
21
- This repository provides scripts to run Track-Anything on Qualcomm® devices.
22
- More details on model performance across various devices, can be found
23
- [here](https://aihub.qualcomm.com/models/track_anything).
24
-
25
-
26
-
27
- ### Model Details
28
-
29
- - **Model Type:** Model_use_case.video_object_tracking
30
- - **Model Stats:**
31
- - Model checkpoint: xmem
32
- - Input resolution: 320x568
33
- - Number of parameters (TrackAnythingEncodeKeyWithShrinkage): 9.72M
34
- - Model size (TrackAnythingEncodeKeyWithShrinkage) (float): 37.1 MB
35
- - Number of parameters (TrackAnythingEncodeValue): 23.3M
36
- - Model size (TrackAnythingEncodeValue) (float): 88.8 MB
37
- - Number of parameters (TrackAnythingEncodeKeyWithoutShrinkage): 9.71M
38
- - Model size (TrackAnythingEncodeKeyWithoutShrinkage) (float): 37.1 MB
39
- - Number of parameters (TrackAnythingSegment): 30.1M
40
- - Model size (TrackAnythingSegment) (float): 115 MB
41
-
42
- | Model | Precision | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit | Target Model
43
- |---|---|---|---|---|---|---|---|---|
44
- | TrackAnythingEncodeKeyWithShrinkage | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | TFLITE | 31.529 ms | 3 - 153 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
45
- | TrackAnythingEncodeKeyWithShrinkage | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | TFLITE | 12.005 ms | 3 - 180 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
46
- | TrackAnythingEncodeKeyWithShrinkage | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | TFLITE | 5.887 ms | 3 - 6 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
47
- | TrackAnythingEncodeKeyWithShrinkage | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | ONNX | 5.511 ms | 0 - 21 MB | NPU | [Track-Anything.onnx.zip](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.onnx.zip) |
48
- | TrackAnythingEncodeKeyWithShrinkage | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | TFLITE | 9.687 ms | 3 - 154 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
49
- | TrackAnythingEncodeKeyWithShrinkage | float | SA7255P ADP | Qualcomm® SA7255P | TFLITE | 31.529 ms | 3 - 153 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
50
- | TrackAnythingEncodeKeyWithShrinkage | float | SA8295P ADP | Qualcomm® SA8295P | TFLITE | 10.079 ms | 3 - 152 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
51
- | TrackAnythingEncodeKeyWithShrinkage | float | SA8775P ADP | Qualcomm® SA8775P | TFLITE | 9.687 ms | 3 - 154 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
52
- | TrackAnythingEncodeKeyWithShrinkage | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | TFLITE | 4.025 ms | 0 - 189 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
53
- | TrackAnythingEncodeKeyWithShrinkage | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 3.902 ms | 0 - 145 MB | NPU | [Track-Anything.onnx.zip](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.onnx.zip) |
54
- | TrackAnythingEncodeKeyWithShrinkage | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | TFLITE | 3.259 ms | 0 - 155 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
55
- | TrackAnythingEncodeKeyWithShrinkage | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | ONNX | 3.154 ms | 1 - 115 MB | NPU | [Track-Anything.onnx.zip](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.onnx.zip) |
56
- | TrackAnythingEncodeKeyWithShrinkage | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | TFLITE | 2.658 ms | 0 - 156 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
57
- | TrackAnythingEncodeKeyWithShrinkage | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | ONNX | 2.557 ms | 0 - 116 MB | NPU | [Track-Anything.onnx.zip](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.onnx.zip) |
58
- | TrackAnythingEncodeKeyWithShrinkage | float | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 5.551 ms | 19 - 19 MB | NPU | [Track-Anything.onnx.zip](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.onnx.zip) |
59
- | TrackAnythingEncodeValue | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | TFLITE | 52.329 ms | 3 - 201 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
60
- | TrackAnythingEncodeValue | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | TFLITE | 21.505 ms | 3 - 257 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
61
- | TrackAnythingEncodeValue | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | TFLITE | 12.234 ms | 3 - 7 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
62
- | TrackAnythingEncodeValue | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | ONNX | 15.677 ms | 0 - 44 MB | NPU | [Track-Anything.onnx.zip](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.onnx.zip) |
63
- | TrackAnythingEncodeValue | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | TFLITE | 17.516 ms | 3 - 201 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
64
- | TrackAnythingEncodeValue | float | SA7255P ADP | Qualcomm® SA7255P | TFLITE | 52.329 ms | 3 - 201 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
65
- | TrackAnythingEncodeValue | float | SA8295P ADP | Qualcomm® SA8295P | TFLITE | 19.451 ms | 3 - 198 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
66
- | TrackAnythingEncodeValue | float | SA8775P ADP | Qualcomm® SA8775P | TFLITE | 17.516 ms | 3 - 201 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
67
- | TrackAnythingEncodeValue | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | TFLITE | 8.659 ms | 0 - 261 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
68
- | TrackAnythingEncodeValue | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 9.994 ms | 12 - 165 MB | NPU | [Track-Anything.onnx.zip](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.onnx.zip) |
69
- | TrackAnythingEncodeValue | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | TFLITE | 7.196 ms | 3 - 174 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
70
- | TrackAnythingEncodeValue | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | ONNX | 8.451 ms | 7 - 125 MB | NPU | [Track-Anything.onnx.zip](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.onnx.zip) |
71
- | TrackAnythingEncodeValue | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | TFLITE | 5.718 ms | 2 - 172 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
72
- | TrackAnythingEncodeValue | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | ONNX | 6.479 ms | 12 - 132 MB | NPU | [Track-Anything.onnx.zip](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.onnx.zip) |
73
- | TrackAnythingEncodeValue | float | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 12.364 ms | 38 - 38 MB | NPU | [Track-Anything.onnx.zip](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.onnx.zip) |
74
- | TrackAnythingEncodeKeyWithoutShrinkage | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | TFLITE | 33.073 ms | 20 - 177 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
75
- | TrackAnythingEncodeKeyWithoutShrinkage | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | TFLITE | 13.522 ms | 20 - 214 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
76
- | TrackAnythingEncodeKeyWithoutShrinkage | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | TFLITE | 7.203 ms | 20 - 23 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
77
- | TrackAnythingEncodeKeyWithoutShrinkage | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | ONNX | 7.04 ms | 48 - 68 MB | NPU | [Track-Anything.onnx.zip](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.onnx.zip) |
78
- | TrackAnythingEncodeKeyWithoutShrinkage | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | TFLITE | 45.236 ms | 20 - 178 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
79
- | TrackAnythingEncodeKeyWithoutShrinkage | float | SA7255P ADP | Qualcomm® SA7255P | TFLITE | 33.073 ms | 20 - 177 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
80
- | TrackAnythingEncodeKeyWithoutShrinkage | float | SA8295P ADP | Qualcomm® SA8295P | TFLITE | 12.139 ms | 20 - 182 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
81
- | TrackAnythingEncodeKeyWithoutShrinkage | float | SA8775P ADP | Qualcomm® SA8775P | TFLITE | 45.236 ms | 20 - 178 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
82
- | TrackAnythingEncodeKeyWithoutShrinkage | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | TFLITE | 5.214 ms | 19 - 230 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
83
- | TrackAnythingEncodeKeyWithoutShrinkage | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 5.27 ms | 63 - 208 MB | NPU | [Track-Anything.onnx.zip](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.onnx.zip) |
84
- | TrackAnythingEncodeKeyWithoutShrinkage | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | TFLITE | 4.417 ms | 18 - 178 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
85
- | TrackAnythingEncodeKeyWithoutShrinkage | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | ONNX | 4.629 ms | 61 - 207 MB | NPU | [Track-Anything.onnx.zip](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.onnx.zip) |
86
- | TrackAnythingEncodeKeyWithoutShrinkage | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | TFLITE | 3.689 ms | 0 - 164 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
87
- | TrackAnythingEncodeKeyWithoutShrinkage | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | ONNX | 3.763 ms | 0 - 154 MB | NPU | [Track-Anything.onnx.zip](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.onnx.zip) |
88
- | TrackAnythingEncodeKeyWithoutShrinkage | float | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 6.909 ms | 66 - 66 MB | NPU | [Track-Anything.onnx.zip](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.onnx.zip) |
89
- | TrackAnythingSegment | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | TFLITE | 103.906 ms | 0 - 171 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
90
- | TrackAnythingSegment | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | TFLITE | 48.49 ms | 2 - 254 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
91
- | TrackAnythingSegment | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | TFLITE | 24.19 ms | 2 - 5 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
92
- | TrackAnythingSegment | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | ONNX | 23.596 ms | 22 - 24 MB | NPU | [Track-Anything.onnx.zip](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.onnx.zip) |
93
- | TrackAnythingSegment | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | TFLITE | 33.853 ms | 2 - 173 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
94
- | TrackAnythingSegment | float | SA7255P ADP | Qualcomm® SA7255P | TFLITE | 103.906 ms | 0 - 171 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
95
- | TrackAnythingSegment | float | SA8295P ADP | Qualcomm® SA8295P | TFLITE | 37.557 ms | 2 - 179 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
96
- | TrackAnythingSegment | float | SA8775P ADP | Qualcomm® SA8775P | TFLITE | 33.853 ms | 2 - 173 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
97
- | TrackAnythingSegment | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | TFLITE | 17.652 ms | 1 - 255 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
98
- | TrackAnythingSegment | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 17.523 ms | 25 - 211 MB | NPU | [Track-Anything.onnx.zip](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.onnx.zip) |
99
- | TrackAnythingSegment | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | TFLITE | 13.485 ms | 1 - 180 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
100
- | TrackAnythingSegment | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | ONNX | 14.038 ms | 5 - 166 MB | NPU | [Track-Anything.onnx.zip](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.onnx.zip) |
101
- | TrackAnythingSegment | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | TFLITE | 10.799 ms | 2 - 182 MB | NPU | [Track-Anything.tflite](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.tflite) |
102
- | TrackAnythingSegment | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | ONNX | 10.804 ms | 25 - 187 MB | NPU | [Track-Anything.onnx.zip](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.onnx.zip) |
103
- | TrackAnythingSegment | float | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 23.754 ms | 37 - 37 MB | NPU | [Track-Anything.onnx.zip](https://huggingface.co/qualcomm/Track-Anything/blob/main/Track-Anything.onnx.zip) |
104
-
105
-
106
-
107
-
108
- ## Installation
109
-
110
-
111
- Install the package via pip:
112
- ```bash
113
- # NOTE: 3.10 <= PYTHON_VERSION < 3.14 is supported.
114
- pip install "qai-hub-models[track-anything]" git+https://github.com/ChaoningZhang/MobileSAM@34bbbfd --use-pep517
115
- ```
116
-
117
-
118
- ## Configure Qualcomm® AI Hub Workbench to run this model on a cloud-hosted device
119
-
120
- Sign-in to [Qualcomm® AI Hub Workbench](https://workbench.aihub.qualcomm.com/) with your
121
- Qualcomm® ID. Once signed in navigate to `Account -> Settings -> API Token`.
122
-
123
- With this API token, you can configure your client to run models on the cloud
124
- hosted devices.
125
- ```bash
126
- qai-hub configure --api_token API_TOKEN
127
- ```
128
- Navigate to [docs](https://workbench.aihub.qualcomm.com/docs/) for more information.
129
-
130
-
131
-
132
- ## Demo off target
133
-
134
- The package contains a simple end-to-end demo that downloads pre-trained
135
- weights and runs this model on a sample input.
136
-
137
- ```bash
138
- python -m qai_hub_models.models.track_anything.demo
139
- ```
140
-
141
- The above demo runs a reference implementation of pre-processing, model
142
- inference, and post processing.
143
-
144
- **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
145
- environment, please add the following to your cell (instead of the above).
146
- ```
147
- %run -m qai_hub_models.models.track_anything.demo
148
- ```
149
-
150
-
151
- ### Run model on a cloud-hosted device
152
-
153
- In addition to the demo, you can also run the model on a cloud-hosted Qualcomm®
154
- device. This script does the following:
155
- * Performance check on-device on a cloud-hosted device
156
- * Downloads compiled assets that can be deployed on-device for Android.
157
- * Accuracy check between PyTorch and on-device outputs.
158
-
159
- ```bash
160
- python -m qai_hub_models.models.track_anything.export
161
- ```
162
-
163
-
164
-
165
- ## How does this work?
166
-
167
- This [export script](https://aihub.qualcomm.com/models/track_anything/qai_hub_models/models/Track-Anything/export.py)
168
- leverages [Qualcomm® AI Hub](https://aihub.qualcomm.com/) to optimize, validate, and deploy this model
169
- on-device. Lets go through each step below in detail:
170
-
171
- Step 1: **Compile model for on-device deployment**
172
-
173
- To compile a PyTorch model for on-device deployment, we first trace the model
174
- in memory using the `jit.trace` and then call the `submit_compile_job` API.
175
-
176
- ```python
177
- import torch
178
-
179
- import qai_hub as hub
180
- from qai_hub_models.models.track_anything import Model
181
-
182
- # Load the model
183
- torch_model = Model.from_pretrained()
184
-
185
- # Device
186
- device = hub.Device("Samsung Galaxy S25")
187
-
188
- # Trace model
189
- input_shape = torch_model.get_input_spec()
190
- sample_inputs = torch_model.sample_inputs()
191
-
192
- pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
193
-
194
- # Compile model on a specific device
195
- compile_job = hub.submit_compile_job(
196
- model=pt_model,
197
- device=device,
198
- input_specs=torch_model.get_input_spec(),
199
- )
200
-
201
- # Get target model to run on-device
202
- target_model = compile_job.get_target_model()
203
-
204
- ```
205
-
206
-
207
- Step 2: **Performance profiling on cloud-hosted device**
208
-
209
- After compiling models from step 1. Models can be profiled model on-device using the
210
- `target_model`. Note that this scripts runs the model on a device automatically
211
- provisioned in the cloud. Once the job is submitted, you can navigate to a
212
- provided job URL to view a variety of on-device performance metrics.
213
- ```python
214
- profile_job = hub.submit_profile_job(
215
- model=target_model,
216
- device=device,
217
- )
218
-
219
- ```
220
-
221
- Step 3: **Verify on-device accuracy**
222
-
223
- To verify the accuracy of the model on-device, you can run on-device inference
224
- on sample input data on the same cloud hosted device.
225
- ```python
226
- input_data = torch_model.sample_inputs()
227
- inference_job = hub.submit_inference_job(
228
- model=target_model,
229
- device=device,
230
- inputs=input_data,
231
- )
232
- on_device_output = inference_job.download_output_data()
233
-
234
- ```
235
- With the output of the model, you can compute like PSNR, relative errors or
236
- spot check the output with expected output.
237
-
238
- **Note**: This on-device profiling and inference requires access to Qualcomm®
239
- AI Hub Workbench. [Sign up for access](https://myaccount.qualcomm.com/signup).
240
-
241
-
242
-
243
- ## Run demo on a cloud-hosted device
244
-
245
- You can also run the demo on-device.
246
-
247
- ```bash
248
- python -m qai_hub_models.models.track_anything.demo --eval-mode on-device
249
- ```
250
-
251
- **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
252
- environment, please add the following to your cell (instead of the above).
253
- ```
254
- %run -m qai_hub_models.models.track_anything.demo -- --eval-mode on-device
255
- ```
256
-
257
-
258
- ## Deploying compiled model to Android
259
-
260
-
261
- The models can be deployed using multiple runtimes:
262
- - TensorFlow Lite (`.tflite` export): [This
263
- tutorial](https://www.tensorflow.org/lite/android/quickstart) provides a
264
- guide to deploy the .tflite model in an Android application.
265
-
266
-
267
- - QNN (`.so` export ): This [sample
268
- app](https://docs.qualcomm.com/bundle/publicresource/topics/80-63442-50/sample_app.html)
269
- provides instructions on how to use the `.so` shared library in an Android application.
270
-
271
-
272
- ## View on Qualcomm® AI Hub
273
- Get more details on Track-Anything's performance across various devices [here](https://aihub.qualcomm.com/models/track_anything).
274
- Explore all available models on [Qualcomm® AI Hub](https://aihub.qualcomm.com/)
275
-
276
 
277
  ## License
278
  * The license for the original implementation of Track-Anything can be found
279
  [here](https://github.com/gaomingqi/Track-Anything/blob/master/LICENSE).
280
 
281
-
282
-
283
  ## References
284
  * [Track Anything: Segment Anything Meets Videos](https://arxiv.org/abs/2304.11968)
285
  * [Source Model Implementation](https://github.com/gaomingqi/Track-Anything)
286
 
287
-
288
-
289
  ## Community
290
  * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
291
  * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).
292
-
293
-
 
9
 
10
  ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/track_anything/web-assets/model_demo.png)
11
 
12
+ # Track-Anything: Optimized for Qualcomm Devices
 
 
13
 
14
  Track-Anything is a video based machine learning model to track an object in a video.
15
 
16
+ This is based on the implementation of Track-Anything found [here](https://github.com/gaomingqi/Track-Anything).
17
+ This repository contains pre-exported model files optimized for Qualcomm® devices. You can use the [Qualcomm® AI Hub Models](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/track_anything) library to export with custom configurations. More details on model performance across various devices, can be found [here](#performance-summary).
18
+
19
+ Qualcomm AI Hub Models uses [Qualcomm AI Hub Workbench](https://workbench.aihub.qualcomm.com) to compile, profile, and evaluate this model. [Sign up](https://myaccount.qualcomm.com/signup) to run these models on a hosted Qualcomm® device.
20
+
21
+ ## Getting Started
22
+ There are two ways to deploy this model on your device:
23
+
24
+ ### Option 1: Download Pre-Exported Models
25
+
26
+ Below are pre-exported model assets ready for deployment.
27
+
28
+ | Runtime | Precision | Chipset | SDK Versions | Download |
29
+ |---|---|---|---|---|
30
+ | ONNX | float | Universal | QAIRT 2.37, ONNX Runtime 1.23.0 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/track_anything/releases/v0.46.1/track_anything-onnx-float.zip)
31
+ | TFLITE | float | Universal | QAIRT 2.42, TFLite 2.17.0 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/track_anything/releases/v0.46.1/track_anything-tflite-float.zip)
32
+
33
+ For more device-specific assets and performance metrics, visit **[Track-Anything on Qualcomm® AI Hub](https://aihub.qualcomm.com/models/track_anything)**.
34
+
35
+
36
+ ### Option 2: Export with Custom Configurations
37
+
38
+ Use the [Qualcomm® AI Hub Models](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/track_anything) Python library to compile and export the model with your own:
39
+ - Custom weights (e.g., fine-tuned checkpoints)
40
+ - Custom input shapes
41
+ - Target device and runtime configurations
42
+
43
+ This option is ideal if you need to customize the model beyond the default configuration provided here.
44
+
45
+ See our repository for [Track-Anything on GitHub](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/track_anything) for usage instructions.
46
+
47
+ ## Model Details
48
+
49
+ **Model Type:** Model_use_case.video_object_tracking
50
+
51
+ **Model Stats:**
52
+ - Model checkpoint: xmem
53
+ - Input resolution: 320x568
54
+ - Number of parameters (TrackAnythingEncodeKeyWithShrinkage): 9.72M
55
+ - Model size (TrackAnythingEncodeKeyWithShrinkage) (float): 37.1 MB
56
+ - Number of parameters (TrackAnythingEncodeValue): 23.3M
57
+ - Model size (TrackAnythingEncodeValue) (float): 88.8 MB
58
+ - Number of parameters (TrackAnythingEncodeKeyWithoutShrinkage): 9.71M
59
+ - Model size (TrackAnythingEncodeKeyWithoutShrinkage) (float): 37.1 MB
60
+ - Number of parameters (TrackAnythingSegment): 30.1M
61
+ - Model size (TrackAnythingSegment) (float): 115 MB
62
+
63
+ ## Performance Summary
64
+ | Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit
65
+ |---|---|---|---|---|---|---
66
+ | TrackAnythingEncodeKeyWithShrinkage | ONNX | float | Snapdragon® X Elite | 5.562 ms | 19 - 19 MB | NPU
67
+ | TrackAnythingEncodeKeyWithShrinkage | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 3.893 ms | 10 - 152 MB | NPU
68
+ | TrackAnythingEncodeKeyWithShrinkage | ONNX | float | Qualcomm® QCS8550 (Proxy) | 5.415 ms | 0 - 20 MB | NPU
69
+ | TrackAnythingEncodeKeyWithShrinkage | ONNX | float | Qualcomm® QCS9075 | 9.595 ms | 10 - 13 MB | NPU
70
+ | TrackAnythingEncodeKeyWithShrinkage | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 3.175 ms | 0 - 115 MB | NPU
71
+ | TrackAnythingEncodeKeyWithShrinkage | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 2.572 ms | 0 - 117 MB | NPU
72
+ | TrackAnythingEncodeKeyWithShrinkage | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 4.098 ms | 0 - 217 MB | NPU
73
+ | TrackAnythingEncodeKeyWithShrinkage | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 31.289 ms | 3 - 181 MB | NPU
74
+ | TrackAnythingEncodeKeyWithShrinkage | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 5.889 ms | 3 - 34 MB | NPU
75
+ | TrackAnythingEncodeKeyWithShrinkage | TFLITE | float | Qualcomm® SA8775P | 41.8 ms | 3 - 181 MB | NPU
76
+ | TrackAnythingEncodeKeyWithShrinkage | TFLITE | float | Qualcomm® QCS9075 | 11.161 ms | 2 - 29 MB | NPU
77
+ | TrackAnythingEncodeKeyWithShrinkage | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 11.69 ms | 3 - 201 MB | NPU
78
+ | TrackAnythingEncodeKeyWithShrinkage | TFLITE | float | Qualcomm® SA7255P | 31.289 ms | 3 - 181 MB | NPU
79
+ | TrackAnythingEncodeKeyWithShrinkage | TFLITE | float | Qualcomm® SA8295P | 10.203 ms | 3 - 164 MB | NPU
80
+ | TrackAnythingEncodeKeyWithShrinkage | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 3.32 ms | 0 - 187 MB | NPU
81
+ | TrackAnythingEncodeKeyWithShrinkage | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 2.45 ms | 0 - 191 MB | NPU
82
+ | TrackAnythingEncodeKeyWithoutShrinkage | ONNX | float | Snapdragon® X Elite | 6.877 ms | 66 - 66 MB | NPU
83
+ | TrackAnythingEncodeKeyWithoutShrinkage | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 5.172 ms | 64 - 212 MB | NPU
84
+ | TrackAnythingEncodeKeyWithoutShrinkage | ONNX | float | Qualcomm® QCS8550 (Proxy) | 7.005 ms | 58 - 78 MB | NPU
85
+ | TrackAnythingEncodeKeyWithoutShrinkage | ONNX | float | Qualcomm® QCS9075 | 11.772 ms | 62 - 64 MB | NPU
86
+ | TrackAnythingEncodeKeyWithoutShrinkage | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 4.611 ms | 61 - 208 MB | NPU
87
+ | TrackAnythingEncodeKeyWithoutShrinkage | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 3.76 ms | 0 - 155 MB | NPU
88
+ | TrackAnythingEncodeKeyWithoutShrinkage | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 5.302 ms | 20 - 239 MB | NPU
89
+ | TrackAnythingEncodeKeyWithoutShrinkage | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 33.117 ms | 20 - 205 MB | NPU
90
+ | TrackAnythingEncodeKeyWithoutShrinkage | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 7.511 ms | 18 - 20 MB | NPU
91
+ | TrackAnythingEncodeKeyWithoutShrinkage | TFLITE | float | Qualcomm® SA8775P | 11.533 ms | 20 - 206 MB | NPU
92
+ | TrackAnythingEncodeKeyWithoutShrinkage | TFLITE | float | Qualcomm® QCS9075 | 12.674 ms | 20 - 63 MB | NPU
93
+ | TrackAnythingEncodeKeyWithoutShrinkage | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 14.205 ms | 20 - 221 MB | NPU
94
+ | TrackAnythingEncodeKeyWithoutShrinkage | TFLITE | float | Qualcomm® SA7255P | 33.117 ms | 20 - 205 MB | NPU
95
+ | TrackAnythingEncodeKeyWithoutShrinkage | TFLITE | float | Qualcomm® SA8295P | 12.482 ms | 20 - 184 MB | NPU
96
+ | TrackAnythingEncodeKeyWithoutShrinkage | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 4.413 ms | 19 - 205 MB | NPU
97
+ | TrackAnythingEncodeKeyWithoutShrinkage | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 3.729 ms | 0 - 229 MB | NPU
98
+ | TrackAnythingEncodeValue | ONNX | float | Snapdragon® X Elite | 12.251 ms | 38 - 38 MB | NPU
99
+ | TrackAnythingEncodeValue | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 10.039 ms | 0 - 150 MB | NPU
100
+ | TrackAnythingEncodeValue | ONNX | float | Qualcomm® QCS8550 (Proxy) | 15.664 ms | 0 - 52 MB | NPU
101
+ | TrackAnythingEncodeValue | ONNX | float | Qualcomm® QCS9075 | 19.384 ms | 6 - 14 MB | NPU
102
+ | TrackAnythingEncodeValue | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 8.45 ms | 7 - 127 MB | NPU
103
+ | TrackAnythingEncodeValue | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 6.443 ms | 4 - 125 MB | NPU
104
+ | TrackAnythingEncodeValue | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 8.276 ms | 2 - 290 MB | NPU
105
+ | TrackAnythingEncodeValue | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 51.6 ms | 3 - 224 MB | NPU
106
+ | TrackAnythingEncodeValue | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 11.859 ms | 3 - 6 MB | NPU
107
+ | TrackAnythingEncodeValue | TFLITE | float | Qualcomm® SA8775P | 17.544 ms | 3 - 218 MB | NPU
108
+ | TrackAnythingEncodeValue | TFLITE | float | Qualcomm® QCS9075 | 18.977 ms | 0 - 55 MB | NPU
109
+ | TrackAnythingEncodeValue | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 22.669 ms | 3 - 285 MB | NPU
110
+ | TrackAnythingEncodeValue | TFLITE | float | Qualcomm® SA7255P | 51.6 ms | 3 - 224 MB | NPU
111
+ | TrackAnythingEncodeValue | TFLITE | float | Qualcomm® SA8295P | 19.664 ms | 0 - 223 MB | NPU
112
+ | TrackAnythingEncodeValue | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 7.178 ms | 2 - 197 MB | NPU
113
+ | TrackAnythingEncodeValue | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 6.542 ms | 2 - 213 MB | NPU
114
+ | TrackAnythingSegment | ONNX | float | Snapdragon® X Elite | 23.784 ms | 38 - 38 MB | NPU
115
+ | TrackAnythingSegment | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 17.9 ms | 4 - 191 MB | NPU
116
+ | TrackAnythingSegment | ONNX | float | Qualcomm® QCS8550 (Proxy) | 24.373 ms | 17 - 28 MB | NPU
117
+ | TrackAnythingSegment | ONNX | float | Qualcomm® QCS9075 | 39.271 ms | 21 - 45 MB | NPU
118
+ | TrackAnythingSegment | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 14.036 ms | 5 - 166 MB | NPU
119
+ | TrackAnythingSegment | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 10.769 ms | 6 - 170 MB | NPU
120
+ | TrackAnythingSegment | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 17.532 ms | 0 - 283 MB | NPU
121
+ | TrackAnythingSegment | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 521.551 ms | 38 - 56 MB | GPU
122
+ | TrackAnythingSegment | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 23.497 ms | 0 - 239 MB | NPU
123
+ | TrackAnythingSegment | TFLITE | float | Qualcomm® SA8775P | 33.249 ms | 0 - 196 MB | NPU
124
+ | TrackAnythingSegment | TFLITE | float | Qualcomm® QCS9075 | 38.367 ms | 0 - 83 MB | NPU
125
+ | TrackAnythingSegment | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 54.61 ms | 2 - 285 MB | NPU
126
+ | TrackAnythingSegment | TFLITE | float | Qualcomm® SA7255P | 521.551 ms | 38 - 56 MB | GPU
127
+ | TrackAnythingSegment | TFLITE | float | Qualcomm® SA8295P | 37.307 ms | 2 - 209 MB | NPU
128
+ | TrackAnythingSegment | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 13.587 ms | 1 - 204 MB | NPU
129
+ | TrackAnythingSegment | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 10.892 ms | 2 - 227 MB | NPU
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
 
131
  ## License
132
  * The license for the original implementation of Track-Anything can be found
133
  [here](https://github.com/gaomingqi/Track-Anything/blob/master/LICENSE).
134
 
 
 
135
  ## References
136
  * [Track Anything: Segment Anything Meets Videos](https://arxiv.org/abs/2304.11968)
137
  * [Source Model Implementation](https://github.com/gaomingqi/Track-Anything)
138
 
 
 
139
  ## Community
140
  * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
141
  * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).
 
 
Track-Anything_TrackAnythingEncodeKeyWithShrinkage_float.onnx.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:59c205ce58ca52bc06a24a57ff08bdbb67569908061d3faf27348511903946ec
3
- size 36328298
 
 
 
 
Track-Anything_TrackAnythingEncodeKeyWithShrinkage_float.tflite DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:dbea6398f607f2eddde14746bb4ee898531b0fec9515504e350816b3c5901434
3
- size 38892364
 
 
 
 
Track-Anything_TrackAnythingEncodeKeyWithoutShrinkage_float.onnx.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:5021d82d8965ad40abdc1deecb00dd242e23bed5ae008ea30cdaa1aa23441257
3
- size 36293645
 
 
 
 
Track-Anything_TrackAnythingEncodeKeyWithoutShrinkage_float.tflite DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:67c1d6d50eb0251cae1cdf43b945751304f031eaae0d0d22d12b5454003e1460
3
- size 38854696
 
 
 
 
Track-Anything_TrackAnythingEncodeValue_float.onnx.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:53eef1b096364caa49bf5407946fd2060b0a466768c3fded671145d0741da974
3
- size 84510135
 
 
 
 
Track-Anything_TrackAnythingEncodeValue_float.tflite DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:25d37bfc41740b6c67b9a4cee06bf0936d5ddabb0b3c5ca034098273292b7fa7
3
- size 93124104
 
 
 
 
Track-Anything_TrackAnythingSegment_float.onnx.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:7fe302cfdc2dc66d3a62e6e6ffc5453358ca57e578c242b67ccef82e529f873d
3
- size 110771794
 
 
 
 
Track-Anything_TrackAnythingSegment_float.tflite DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:84100b8a2f7d0c8f444726be7e954d0e0ac8df202bdb39ba29d071b56aebad0b
3
- size 120533856
 
 
 
 
tool-versions.yaml DELETED
@@ -1,4 +0,0 @@
1
- tool_versions:
2
- onnx:
3
- qairt: 2.37.1.250807093845_124904
4
- onnx_runtime: 1.23.0