pdf-icon

Product Guide

Offline Voice Recognition

Industrial Control

IoT Measuring Instruments

Air Quality

Module13.2 PPS

Ethernet Camera

DIP Switch Usage Guide

Module GPS v2.0

Module GNSS

Module ExtPort For Core2

Module LoRa868 V1.2

MixFormerV2

MixFormerV2 is an improved unified Transformer-based object tracking model that enhances tracking accuracy and speed by integrating the feature extraction and matching processes.

  1. Manually download the model and upload it to raspberrypi5, or pull the model repository using the following command:
Tip
If git lfs is not installed, please refer to git lfs installation instructions for installation.
git clone https://huggingface.co/AXERA-TECH/MixFormerV2

File Description:

m5stack@raspberrypi:~/rsp/MixFormerV2 $ ls -lh
total 63M
drwxrwxr-x 2 m5stack m5stack 4.0K Aug 11 18:28 ax630c
drwxrwxr-x 2 m5stack m5stack 4.0K Aug 11 18:28 ax650
-rw-rw-r-- 1 m5stack m5stack  63M Aug 11 18:28 car.avi
-rw-rw-r-- 1 m5stack m5stack    0 Aug 11 18:28 config.json
drwxrwxr-x 2 m5stack m5stack 4.0K Aug 11 18:28 onnx
-rw-rw-r-- 1 m5stack m5stack 4.0K Aug 11 18:28 README.md
-rw-rw-r-- 1 m5stack m5stack  15K Aug 11 18:28 run_mixformer2_axmodel.py
-rw-rw-r-- 1 m5stack m5stack  14K Aug 11 18:28 run_mixformer2_onnx.py
  1. Create a virtual environment
python -m venv mixformer
  1. Activate the virtual environment
source mixformer/bin/activate
  1. Install dependencies
pip install https://github.com/AXERA-TECH/pyaxengine/releases/download/0.1.3.rc1/axengine-0.1.3-py3-none-any.whl
pip install argparse numpy opencv-python glob2
  1. Run
python3 run_mixformer2_axmodel.py --model-path ax650/mixformer_v2.axmodel --frame-path car.avi -r 10

Example Output:

(mixformer) m5stack@raspberrypi:~/rsp/MixFormerV2 $ python3 run_mixformer2_axmodel.py --model-path ax650/mixformer_v2.axmodel --frame-path car.avi -r 10
[INFO] Available providers:  ['AXCLRTExecutionProvider']
[INFO] Using provider: AXCLRTExecutionProvider
[INFO] SOC Name: AX650N
[INFO] VNPU type: VNPUType.DISABLED
[INFO] Compiler version: 3.4-dirty 4ff37520-dirty
====================type================= [1079, 482] <class 'list'> <class 'list'>
First frame initialized!
Video: tracking     1011.0fps
Video: tracking     8.0fps
Video: tracking     8.0fps
Video: tracking     8.0fps
Video: tracking     8.0fps
Video: tracking     8.0fps
Video: tracking     8.0fps
Video: tracking     8.0fps
Video: tracking     8.0fps
Video: tracking     8.0fps
Video: tracking     8.0fps
Reached the maximum number of frames (10). Exiting loop.
video: average finale average tracking fps 121.2 fps
On This Page