v0.46.1
Browse filesSee https://github.com/quic/ai-hub-models/releases/v0.46.1 for changelog.
Files changed (5)
- README.md+75-212
- Video-MAE_float.dlcDeleted-3
- Video-MAE_float.onnx.zipDeleted-3
- Video-MAE_float.tfliteDeleted-3
- tool-versions.yamlDeleted-4
9 unmodified lines1011121314151314151619202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022117181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495227228969798992332341001011022382399 unmodified lines

# Video-MAE: Optimized for Mobile Deployment## Sports and human action recognition in videos
# Video-MAE: Optimized for Qualcomm Devices
Video MAE (Masked Auto Encoder) is a network for doing video classification that uses the ViT (Vision Transformer) backbone.
This model is an implementation of Video-MAE found [here](https://github.com/MCG-NJU/VideoMAE).
This repository provides scripts to run Video-MAE on Qualcomm® devices.More details on model performance across various devices, can be found[here](https://aihub.qualcomm.com/models/video_mae).
### Model Details
- **Model Type:** Model_use_case.video_classification- **Model Stats:** - Model checkpoint: Kinectics-400 - Input resolution: 224x224 - Number of parameters: 87.7M - Model size (float): 335 MB
| Model | Precision | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit | Target Model|---|---|---|---|---|---|---|---|---|| Video-MAE | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | TFLITE | 423.568 ms | 0 - 908 MB | NPU | [Video-MAE.tflite](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.tflite) || Video-MAE | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | QNN_DLC | 1136.783 ms | 4 - 851 MB | NPU | [Video-MAE.dlc](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.dlc) || Video-MAE | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | TFLITE | 291.792 ms | 1 - 1054 MB | NPU | [Video-MAE.tflite](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.tflite) || Video-MAE | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | QNN_DLC | 575.304 ms | 9 - 1005 MB | NPU | [Video-MAE.dlc](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.dlc) || Video-MAE | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | TFLITE | 139.117 ms | 0 - 5 MB | NPU | [Video-MAE.tflite](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.tflite) || Video-MAE | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | QNN_DLC | 495.828 ms | 9 - 12 MB | NPU | [Video-MAE.dlc](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.dlc) || Video-MAE | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | ONNX | 572.575 ms | 0 - 217 MB | NPU | [Video-MAE.onnx.zip](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.onnx.zip) || Video-MAE | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | TFLITE | 723.049 ms | 0 - 901 MB | NPU | [Video-MAE.tflite](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.tflite) || Video-MAE | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | QNN_DLC | 501.186 ms | 2 - 887 MB | NPU | [Video-MAE.dlc](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.dlc) || Video-MAE | float | SA7255P ADP | Qualcomm® SA7255P | TFLITE | 423.568 ms | 0 - 908 MB | NPU | [Video-MAE.tflite](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.tflite) || Video-MAE | float | SA7255P ADP | Qualcomm® SA7255P | QNN_DLC | 1136.783 ms | 4 - 851 MB | NPU | [Video-MAE.dlc](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.dlc) || Video-MAE | float | SA8295P ADP | Qualcomm® SA8295P | QNN_DLC | 669.5 ms | 0 - 845 MB | NPU | [Video-MAE.dlc](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.dlc) || Video-MAE | float | SA8775P ADP | Qualcomm® SA8775P | TFLITE | 723.049 ms | 0 - 901 MB | NPU | [Video-MAE.tflite](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.tflite) || Video-MAE | float | SA8775P ADP | Qualcomm® SA8775P | QNN_DLC | 501.186 ms | 2 - 887 MB | NPU | [Video-MAE.dlc](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.dlc) || Video-MAE | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | TFLITE | 100.899 ms | 1 - 1109 MB | NPU | [Video-MAE.tflite](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.tflite) || Video-MAE | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | QNN_DLC | 349.189 ms | 9 - 1059 MB | NPU | [Video-MAE.dlc](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.dlc) || Video-MAE | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 416.581 ms | 1 - 1183 MB | NPU | [Video-MAE.onnx.zip](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.onnx.zip) || Video-MAE | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | TFLITE | 74.924 ms | 0 - 899 MB | NPU | [Video-MAE.tflite](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.tflite) || Video-MAE | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | QNN_DLC | 259.329 ms | 9 - 867 MB | NPU | [Video-MAE.dlc](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.dlc) || Video-MAE | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | ONNX | 439.219 ms | 1 - 966 MB | NPU | [Video-MAE.onnx.zip](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.onnx.zip) || Video-MAE | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | TFLITE | 59.82 ms | 1 - 913 MB | NPU | [Video-MAE.tflite](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.tflite) || Video-MAE | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | QNN_DLC | 294.871 ms | 11 - 902 MB | NPU | [Video-MAE.dlc](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.dlc) || Video-MAE | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | ONNX | 593.719 ms | 9 - 989 MB | NPU | [Video-MAE.onnx.zip](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.onnx.zip) || Video-MAE | float | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN_DLC | 516.587 ms | 9 - 9 MB | NPU | [Video-MAE.dlc](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.dlc) || Video-MAE | float | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 599.153 ms | 187 - 187 MB | NPU | [Video-MAE.onnx.zip](https://huggingface.co/qualcomm/Video-MAE/blob/main/Video-MAE.onnx.zip) |
## Installation
Install the package via pip:```bash# NOTE: 3.10 <= PYTHON_VERSION < 3.14 is supported.pip install "qai-hub-models[video-mae]"```
## Configure Qualcomm® AI Hub Workbench to run this model on a cloud-hosted device
Sign-in to [Qualcomm® AI Hub Workbench](https://workbench.aihub.qualcomm.com/) with yourQualcomm® ID. Once signed in navigate to `Account -> Settings -> API Token`.
With this API token, you can configure your client to run models on the cloudhosted devices.```bashqai-hub configure --api_token API_TOKEN```Navigate to [docs](https://workbench.aihub.qualcomm.com/docs/) for more information.
## Demo off target
The package contains a simple end-to-end demo that downloads pre-trainedweights and runs this model on a sample input.
```bashpython -m qai_hub_models.models.video_mae.demo```
The above demo runs a reference implementation of pre-processing, modelinference, and post processing.
**NOTE**: If you want running in a Jupyter Notebook or Google Colab likeenvironment, please add the following to your cell (instead of the above).```%run -m qai_hub_models.models.video_mae.demo```
### Run model on a cloud-hosted device
In addition to the demo, you can also run the model on a cloud-hosted Qualcomm®device. This script does the following:* Performance check on-device on a cloud-hosted device* Downloads compiled assets that can be deployed on-device for Android.* Accuracy check between PyTorch and on-device outputs.
```bashpython -m qai_hub_models.models.video_mae.export```
## How does this work?
This [export script](https://aihub.qualcomm.com/models/video_mae/qai_hub_models/models/Video-MAE/export.py)leverages [Qualcomm® AI Hub](https://aihub.qualcomm.com/) to optimize, validate, and deploy this modelon-device. Lets go through each step below in detail:
Step 1: **Compile model for on-device deployment**
To compile a PyTorch model for on-device deployment, we first trace the modelin memory using the `jit.trace` and then call the `submit_compile_job` API.
```pythonimport torch
import qai_hub as hubfrom qai_hub_models.models.video_mae import Model
# Load the modeltorch_model = Model.from_pretrained()
# Devicedevice = hub.Device("Samsung Galaxy S25")
# Trace modelinput_shape = torch_model.get_input_spec()sample_inputs = torch_model.sample_inputs()
pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
# Compile model on a specific devicecompile_job = hub.submit_compile_job( model=pt_model, device=device, input_specs=torch_model.get_input_spec(),)
# Get target model to run on-devicetarget_model = compile_job.get_target_model()
```
Step 2: **Performance profiling on cloud-hosted device**
After compiling models from step 1. Models can be profiled model on-device using the`target_model`. Note that this scripts runs the model on a device automaticallyprovisioned in the cloud. Once the job is submitted, you can navigate to aprovided job URL to view a variety of on-device performance metrics.```pythonprofile_job = hub.submit_profile_job( model=target_model, device=device,) ```
Step 3: **Verify on-device accuracy**
To verify the accuracy of the model on-device, you can run on-device inferenceon sample input data on the same cloud hosted device.```pythoninput_data = torch_model.sample_inputs()inference_job = hub.submit_inference_job( model=target_model, device=device, inputs=input_data,) on_device_output = inference_job.download_output_data()
```With the output of the model, you can compute like PSNR, relative errors orspot check the output with expected output.
**Note**: This on-device profiling and inference requires access to Qualcomm®AI Hub Workbench. [Sign up for access](https://myaccount.qualcomm.com/signup).
## Deploying compiled model to Android
The models can be deployed using multiple runtimes:- TensorFlow Lite (`.tflite` export): [This tutorial](https://www.tensorflow.org/lite/android/quickstart) provides a guide to deploy the .tflite model in an Android application.
- QNN (`.so` export ): This [sample app](https://docs.qualcomm.com/bundle/publicresource/topics/80-63442-50/sample_app.html)provides instructions on how to use the `.so` shared library in an Android application.
## View on Qualcomm® AI HubGet more details on Video-MAE's performance across various devices [here](https://aihub.qualcomm.com/models/video_mae).Explore all available models on [Qualcomm® AI Hub](https://aihub.qualcomm.com/)
This is based on the implementation of Video-MAE found [here](https://github.com/MCG-NJU/VideoMAE).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/video_mae) library to export with custom configurations. More details on model performance across various devices, can be found [here](#performance-summary).
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.
## Getting StartedThere are two ways to deploy this model on your device:
### Option 1: Download Pre-Exported Models
Below are pre-exported model assets ready for deployment.
| Runtime | Precision | Chipset | SDK Versions | Download ||---|---|---|---|---|| 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/video_mae/releases/v0.46.1/video_mae-onnx-float.zip)| ONNX | w8a16 | Universal | QAIRT 2.37, ONNX Runtime 1.23.0 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/video_mae/releases/v0.46.1/video_mae-onnx-w8a16.zip)| QNN_DLC | float | Universal | QAIRT 2.42 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/video_mae/releases/v0.46.1/video_mae-qnn_dlc-float.zip)| QNN_DLC | w8a16 | Universal | QAIRT 2.42 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/video_mae/releases/v0.46.1/video_mae-qnn_dlc-w8a16.zip)| 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/video_mae/releases/v0.46.1/video_mae-tflite-float.zip)
For more device-specific assets and performance metrics, visit **[Video-MAE on Qualcomm® AI Hub](https://aihub.qualcomm.com/models/video_mae)**.
### Option 2: Export with Custom Configurations
Use the [Qualcomm® AI Hub Models](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/video_mae) Python library to compile and export the model with your own:- Custom weights (e.g., fine-tuned checkpoints)- Custom input shapes- Target device and runtime configurations
This option is ideal if you need to customize the model beyond the default configuration provided here.
See our repository for [Video-MAE on GitHub](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/video_mae) for usage instructions.
## Model Details
**Model Type:** Model_use_case.video_classification
**Model Stats:**- Model checkpoint: Kinectics-400- Input resolution: 224x224- Number of parameters: 87.7M- Model size (float): 335 MB
## Performance Summary| Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit|---|---|---|---|---|---|---| Video-MAE | ONNX | float | Snapdragon® X Elite | 599.027 ms | 187 - 187 MB | NPU| Video-MAE | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 417.051 ms | 10 - 1193 MB | NPU| Video-MAE | ONNX | float | Qualcomm® QCS8550 (Proxy) | 572.814 ms | 0 - 217 MB | NPU| Video-MAE | ONNX | float | Qualcomm® QCS9075 | 672.39 ms | 9 - 21 MB | NPU| Video-MAE | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 439.593 ms | 1 - 971 MB | NPU| Video-MAE | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 594.011 ms | 1 - 977 MB | NPU| Video-MAE | QNN_DLC | float | Snapdragon® X Elite | 473.072 ms | 9 - 9 MB | NPU| Video-MAE | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 354.537 ms | 9 - 1124 MB | NPU| Video-MAE | QNN_DLC | float | Qualcomm® QCS8275 (Proxy) | 1038.798 ms | 0 - 914 MB | NPU| Video-MAE | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 454.586 ms | 9 - 12 MB | NPU| Video-MAE | QNN_DLC | float | Qualcomm® SA8775P | 485.216 ms | 0 - 956 MB | NPU| Video-MAE | QNN_DLC | float | Qualcomm® QCS9075 | 515.489 ms | 11 - 22 MB | NPU| Video-MAE | QNN_DLC | float | Qualcomm® QCS8450 (Proxy) | 579.173 ms | 9 - 1066 MB | NPU| Video-MAE | QNN_DLC | float | Qualcomm® SA7255P | 1038.798 ms | 0 - 914 MB | NPU| Video-MAE | QNN_DLC | float | Qualcomm® SA8295P | 565.13 ms | 0 - 858 MB | NPU| Video-MAE | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 331.251 ms | 9 - 928 MB | NPU| Video-MAE | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 249.902 ms | 11 - 966 MB | NPU| Video-MAE | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 100.537 ms | 0 - 1169 MB | NPU| Video-MAE | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 5536.906 ms | 42 - 59 MB | CPU| Video-MAE | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 138.298 ms | 0 - 4 MB | NPU| Video-MAE | TFLITE | float | Qualcomm® SA8775P | 160.51 ms | 0 - 961 MB | NPU| Video-MAE | TFLITE | float | Qualcomm® QCS9075 | 172.102 ms | 0 - 207 MB | NPU| Video-MAE | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 298.251 ms | 0 - 1115 MB | NPU| Video-MAE | TFLITE | float | Qualcomm® SA7255P | 5536.906 ms | 42 - 59 MB | CPU| Video-MAE | TFLITE | float | Qualcomm® SA8295P | 214.16 ms | 0 - 912 MB | NPU| Video-MAE | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 74.663 ms | 0 - 962 MB | NPU| Video-MAE | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 60.822 ms | 0 - 954 MB | NPU
## License* The license for the original implementation of Video-MAE can be found [here](https://github.com/MCG-NJU/VideoMAE/blob/main/LICENSE).
## References* [Masked Autoencoders are Data-Efficient Learners for Self-Supervised Video Pre-Training](https://arxiv.org/abs/2203.12602)* [Source Model Implementation](https://github.com/MCG-NJU/VideoMAE)
## Community* Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.* For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).
123version https://git-lfs.github.com/spec/v1oid sha256:5809fa48eda668973b39cd9d074507cb4f3142ce11a9bf31e4ee5e3c96a8df49size 351314884123version https://git-lfs.github.com/spec/v1oid sha256:c42437267f75e065a1c448a9e1a4ee0759b1e5634aba9c1fdfb80a9b06d014f7size 221427620123version https://git-lfs.github.com/spec/v1oid sha256:05e2c7e3ae7a1ccc588bf07bcfa47af934ed473b9259558339d23a394fe7d2b3size 3510518601234tool_versions: onnx: qairt: 2.37.1.250807093845_124904 onnx_runtime: 1.23.0README.md+75-212
Video-MAE_float.dlcDeleted-3
Video-MAE_float.onnx.zipDeleted-3
Video-MAE_float.tfliteDeleted-3
tool-versions.yamlDeleted-4