| | --- |
| | license: mit |
| | language: |
| | - en |
| | metrics: |
| | - accuracy |
| | pipeline_tag: image-classification |
| | tags: |
| | - biology |
| | --- |
| | |
| | # Bird-Species-Classification |
| |
|
| | This project only to show a demo of Bird Species Classification model within 1400+ species of birds. |
| |
|
| | The model is trained with 224x224 resolution. |
| |
|
| | 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: |
| |
|
| | For those who are interested in model conversion, you can try to export axmodel through |
| |
|
| | - [Pulsar2 Link, How to Convert ONNX to axmodel](https://pulsar2-docs.readthedocs.io/en/latest/pulsar2/introduction.html) |
| |
|
| |
|
| | ## Support Platform |
| |
|
| | - AX650 |
| | - [M4N-Dock(η±θ―ζ΄ΎPro)](https://wiki.sipeed.com/hardware/zh/maixIV/m4ndock/m4ndock.html) |
| | - [M.2 Accelerator card](https://docs.m5stack.com/zh_CN/ai_hardware/LLM-8850_Card) |
| | - AX630C |
| | - [η±θ―ζ΄Ύ2](https://axera-pi-2-docs-cn.readthedocs.io/zh-cn/latest/index.html) |
| | - [Module-LLM](https://docs.m5stack.com/zh_CN/module/Module-LLM) |
| | - [LLM630 Compute Kit](https://docs.m5stack.com/zh_CN/core/LLM630%20Compute%20Kit) |
| | |
| | | Models | Platforms | latency | Top5 Accuracy | CMM size(MB) | |
| | | -------------| -------------| ------------- | --------------| --------------| |
| | | | AX650 | 0.19ms | | | |
| | | bird-s | AX630C | 0.54ms | 66% | 1.07 | |
| | | | AX615 | 0.87ms | | | |
| | | | AX650 | 0.58ms | | | |
| | | bird-m | AX630C | 2.52ms | 79% | 12.2 | |
| | | | AX615 | 4.97ms | | | |
| |
|
| | ## How to use |
| |
|
| | Download all files from this repository to the device |
| |
|
| | ``` |
| | root@ax650:~/Bird-Species-Classification# tree |
| | . |
| | βββ README.md |
| | βββ axmodel_infer.py |
| | βββ class_name.txt |
| | βββ model |
| | βΒ Β βββ AX615 |
| | βΒ Β βΒ Β βββ bird_615_npu1.axmodel |
| | βΒ Β βΒ Β βββ bird_615_npu2.axmodel |
| | βΒ Β βββ AX620E |
| | βΒ Β βΒ Β βββ bird_630_npu1.axmodel |
| | βΒ Β βΒ Β βββ bird_630_npu2.axmodel |
| | βΒ Β βββ AX650 |
| | βΒ Β βββ bird_650_npu3.axmodel |
| | βββ onnx_infer.py |
| | βββ prediction_result_top5.png |
| | βββ quant |
| | βΒ Β βββ Bird.json |
| | βΒ Β βββ README.md |
| | βΒ Β βββ 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 |
| | |
| | 6 directories, 20 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 AX650 Host, such as M4N-Dock(η±θ―ζ΄ΎPro) |
| |
|
| | ``` |
| | root@ax650:~/Bird-Species-Classification# python3 axmodel_infer.py --image test_images/04251_3a52191e-be71-4539-98ea-14a8f2347330.jpg |
| | [INFO] Available providers: ['AxEngineExecutionProvider'] |
| | 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 74996179 |
| | |
| | Image: test_images/04251_3a52191e-be71-4539-98ea-14a8f2347330.jpg |
| | Top-5 Predictions: |
| | #1: 04251_Animalia_Chordata_Aves_Passeriformes_Tityridae_Tityra_semifasciata (0.9823) |
| | #2: 04333_Animalia_Chordata_Aves_Passeriformes_Tyrannidae_Tyrannus_savana (0.0103) |
| | #3: 04208_Animalia_Chordata_Aves_Passeriformes_Sylviidae_Sylvia_melanocephala (0.0056) |
| | #4: 03561_Animalia_Chordata_Aves_Coraciiformes_Alcedinidae_Todiramphus_chloris (0.0009) |
| | #5: 04455_Animalia_Chordata_Aves_Piciformes_Picidae_Melanerpes_lewis (0.0005) |
| | Result saved to: prediction_result_top5.png |
| | ``` |
| |
|
| | outputοΌ |
| | <img src="./prediction_result_top5.png" width="200%" alt="ι’ζ΅η»ζ" /> |