Configuration Parsing Warning:Invalid JSON for config file config.json

Bird-Species-Classification

This project only to show a demo of Bird Species Classification model within 1400+ species of birds.

This model has been converted to run on the Axera NPU using w8a16 quantization.

This model has been optimized with the following LoRA:

Compatible with Pulsar2 version: 5.1

Convert tools links:

Do model convert from onnx to axmodel with commands like:

pulsar2 build --config ./quant/bird-l.json

For those who are interested in model conversion, you can try to export axmodel through

Support Platform

Models Platforms latency Top1 Accuracy Top5 Accuracy CMM size(MB)
AX650 0.19ms
bird-s AX630C 0.54ms 44% 66% 1.07
AX615 0.87ms
AX650 0.58ms
bird-m AX630C 2.52ms 59% 79% 12.2
AX615 4.97ms
AX650 5.60ms
bird-l AX630C 35.2ms 86% 95% 29.6
AX615 64.1ms

How to use

Download all files from this repository to the device

(base) root@ax650:~/Bird-Species-Classification# tree
.
β”œβ”€β”€ README.md
β”œβ”€β”€ axmodel_infer.py
β”œβ”€β”€ class_name.txt
β”œβ”€β”€ config.json
β”œβ”€β”€ model
β”‚   β”œβ”€β”€ bird-l
β”‚   β”‚   β”œβ”€β”€ AX615
β”‚   β”‚   β”‚   └── bird_615_npu2.axmodel
β”‚   β”‚   β”œβ”€β”€ AX620E
β”‚   β”‚   β”‚   β”œβ”€β”€ bird_630_npu1.axmodel
β”‚   β”‚   β”‚   └── bird_630_npu2.axmodel
β”‚   β”‚   └── AX650
β”‚   β”‚       └── bird_650_npu3.axmodel
β”‚   β”œβ”€β”€ bird-m
β”‚   β”‚   β”œβ”€β”€ AX615
β”‚   β”‚   β”‚   β”œβ”€β”€ bird_615_npu1.axmodel
β”‚   β”‚   β”‚   └── bird_615_npu2.axmodel
β”‚   β”‚   β”œβ”€β”€ AX620E
β”‚   β”‚   β”‚   β”œβ”€β”€ bird_630_npu1.axmodel
β”‚   β”‚   β”‚   └── bird_630_npu2.axmodel
β”‚   β”‚   └── AX650
β”‚   β”‚       └── bird_650_npu3.axmodel
β”‚   └── bird-s
β”‚       β”œβ”€β”€ AX615
β”‚       β”‚   β”œβ”€β”€ bird_615_npu1.axmodel
β”‚       β”‚   └── bird_615_npu2.axmodel
β”‚       β”œβ”€β”€ AX630C
β”‚       β”‚   β”œβ”€β”€ bird_630_npu1.axmodel
β”‚       β”‚   └── bird_630_npu2.axmodel
β”‚       └── AX650
β”‚           └── bird_650_npu3.axmodel
β”œβ”€β”€ onnx_infer.py
β”œβ”€β”€ prediction_result_top5.png
β”œβ”€β”€ quant
β”‚   β”œβ”€β”€ bird-l.json
β”‚   β”œβ”€β”€ bird-m.json
β”‚   β”œβ”€β”€ bird-s.json
β”‚   └── bird.tar.gz
└── test_images
    β”œβ”€β”€ 03111_2c0dfa5a-c4a0-47f8-ac89-6a289208050f.jpg
    β”œβ”€β”€ 03332_01b365c3-a741-4f45-bac2-4345bc901ec6.jpg
    β”œβ”€β”€ 03412_0ffc115b-43b4-4474-a373-24233f391de3.jpg
    β”œβ”€β”€ 03615_0dfbf6ae-434d-4648-b5d2-08412546ea64.jpg
    β”œβ”€β”€ 04251_3a52191e-be71-4539-98ea-14a8f2347330.jpg
    β”œβ”€β”€ 04405_0c5a6785-0bc2-49d9-9702-b9e94ba9b686.jpg
    └── 04593_3d74d5a7-15b1-4bb9-af6f-1bcd78485787.jpg

15 directories, 31 files

python env requirement

pyaxengine

https://github.com/AXERA-TECH/pyaxengine

wget https://github.com/AXERA-TECH/pyaxengine/releases/download/0.1.3rc0/axengine-0.1.3-py3-none-any.whl
pip install axengine-0.1.3-py3-none-any.whl

Inference with ONNX model

root@ebba5440b03c:/home/# python onnx_infer.py -m Birdmodel_inat_bird-l.onnx --image test_images/04251_3a52191e-be71-4539-98ea-14a8f2347330.jpg
build predictor with Birdmodel_inat_bird-l.onnx...
Loading ONNX model with providers: ['CPUExecutionProvider']

Image: test_images/04251_3a52191e-be71-4539-98ea-14a8f2347330.jpg
Top-5 Predictions:
#1: 04251_Animalia_Chordata_Aves_Passeriformes_Tityridae_Tityra_semifasciata (0.9231)
#2: 04019_Animalia_Chordata_Aves_Passeriformes_Oriolidae_Sphecotheres_vieilloti (0.0021)
#3: 03233_Animalia_Chordata_Aves_Anseriformes_Anatidae_Cairina_moschata (0.0006)
#4: 04219_Animalia_Chordata_Aves_Passeriformes_Thraupidae_Paroaria_capitata (0.0004)
#5: 03912_Animalia_Chordata_Aves_Passeriformes_Laniidae_Lanius_minor (0.0003)
Result saved to: prediction_result_top5.png

Inference with AX650 Host, such as M4N-Dock(爱芯派Pro)

root@ax650:~/bird# python3 axmodel_infer.py -m bird_650_npu3.axmodel -i test_images/04251_3a52191e-be71-4539-98ea-14a8f2347330.jpg
[INFO] Available providers:  ['AxEngineExecutionProvider']
build predictor with bird_650_npu3.axmodel...
Loading ONNX model with providers: ['AxEngineExecutionProvider']
[INFO] Using provider: AxEngineExecutionProvider
[INFO] Chip type: ChipType.MC50
[INFO] VNPU type: VNPUType.DISABLED
[INFO] Engine version: 2.12.0s
[INFO] Model type: 2 (triple core)
[INFO] Compiler version: 5.1-patch1 8c5871d5

Image: test_images/04251_3a52191e-be71-4539-98ea-14a8f2347330.jpg
Top-5 Predictions:
#1: 04251_Animalia_Chordata_Aves_Passeriformes_Tityridae_Tityra_semifasciata (0.9137)
#2: 04019_Animalia_Chordata_Aves_Passeriformes_Oriolidae_Sphecotheres_vieilloti (0.0022)
#3: 03233_Animalia_Chordata_Aves_Anseriformes_Anatidae_Cairina_moschata (0.0006)
#4: 03912_Animalia_Chordata_Aves_Passeriformes_Laniidae_Lanius_minor (0.0005)
#5: 04219_Animalia_Chordata_Aves_Passeriformes_Thraupidae_Paroaria_capitata (0.0004)
Result saved to: prediction_result_top5.png

output: ι’„ζ΅‹η»“ζžœ

Downloads last month
24
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support