Skip to main content

A neural network compiler for AI accelerators

Project description

nncase

GitHub repository Gitee repository GitHub release

切换中文

nncase is a neural network compiler for AI accelerators.

Telegram: nncase community Technical Discussion QQ Group: 790699378 . Answer: 人工智能


K230

Install

  • Linux:

    pip install nncase nncase-kpu
    
  • Windows:

    1. pip install nncase
    2. Download `nncase_kpu-2.x.x-py2.py3-none-win_amd64.whl` in below link.
    3. pip install nncase_kpu-2.x.x-py2.py3-none-win_amd64.whl
    

All version of nncase and nncase-kpu in Release.

Supported operators

benchmark test

kind model shape quant_type(If/W) nncase_fps tflite_onnx_result accuracy info
Image Classification mobilenetv2 [1,224,224,3] u8/u8 600.24 top-1 = 71.3%
top-5 = 90.1%
top-1 = 71.1%
top-5 = 90.0%
dataset(ImageNet 2012, 50000 images)
tflite
resnet50V2 [1,3,224,224] u8/u8 86.17 top-1 = 75.44%
top-5 = 92.56%
top-1 = 75.11%
top-5 = 92.36%
dataset(ImageNet 2012, 50000 images)
onnx
yolov8s_cls [1,3,224,224] u8/u8 130.497 top-1 = 72.2%
top-5 = 90.9%
top-1 = 72.2%
top-5 = 90.8%
dataset(ImageNet 2012, 50000 images)
yolov8s_cls(v8.0.207)
Object Detection yolov5s_det [1,3,640,640] u8/u8 23.645 bbox
mAP50-90 = 0.374
mAP50 = 0.567
bbox
mAP50-90 = 0.369
mAP50 = 0.566
dataset(coco val2017, 5000 images)
yolov5s_det(v7.0 tag, rect=False, conf=0.001, iou=0.65)
yolov8s_det [1,3,640,640] u8/u8 9.373 bbox
mAP50-90 = 0.446
mAP50 = 0.612
mAP75 = 0.484
bbox
mAP50-90 = 0.404
mAP50 = 0.593
mAP75 = 0.45
dataset(coco val2017, 5000 images)
yolov8s_det(v8.0.207, rect = False)
Image Segmentation yolov8s_seg [1,3,640,640] u8/u8 7.845 bbox
mAP50-90 = 0.444
mAP50 = 0.606
mAP75 = 0.484
segm
mAP50-90 = 0.371
mAP50 = 0.578
mAP75 = 0.396
bbox
mAP50-90 = 0.444
mAP50 = 0.606
mAP75 = 0.484
segm
mAP50-90 = 0.371
mAP50 = 0.579
mAP75 = 0.397
dataset(coco val2017, 5000 images)
yolov8s_seg(v8.0.207, rect = False, conf_thres = 0.0008)
Pose Estimation yolov8n_pose_320 [1,3,320,320] u8/u8 36.066 bbox
mAP50-90 = 0.6
mAP50 = 0.843
mAP75 = 0.654
keypoints
mAP50-90 = 0.358
mAP50 = 0.646
mAP75 = 0.353
bbox
mAP50-90 = 0.6
mAP50 = 0.841
mAP75 = 0.656
keypoints
mAP50-90 = 0.359
mAP50 = 0.648
mAP75 = 0.357
dataset(coco val2017, 2346 images)
yolov8n_pose(v8.0.207, rect = False)
yolov8n_pose_640 [1,3,640,640] u8/u8 10.88 bbox
mAP50-90 = 0.694
mAP50 = 0.909
mAP75 = 0.776
keypoints
mAP50-90 = 0.509
mAP50 = 0.798
mAP75 = 0.544
bbox
mAP50-90 = 0.694
mAP50 = 0.909
mAP75 = 0.777
keypoints
mAP50-90 = 0.508
mAP50 = 0.798
mAP75 = 0.54
dataset(coco val2017, 2346 images)
yolov8n_pose(v8.0.207, rect = False)
yolov8s_pose [1,3,640,640] u8/u8 5.568 bbox
mAP50-90 = 0.733
mAP50 = 0.925
mAP75 = 0.818
keypoints
mAP50-90 = 0.605
mAP50 = 0.857
mAP75 = 0.666
bbox
mAP50-90 = 0.734
mAP50 = 0.925
mAP75 = 0.819
keypoints
mAP50-90 = 0.604
mAP50 = 0.859
mAP75 = 0.669
dataset(coco val2017, 2346 images)
yolov8s_pose(v8.0.207, rect = False)

Demo

eye gaze space_resize face pose
gif gif

K210/K510

Supported operators


Features

  • Supports multiple inputs and outputs and multi-branch structure
  • Static memory allocation, no heap memory acquired
  • Operators fusion and optimizations
  • Support float and quantized uint8 inference
  • Support post quantization from float model with calibration dataset
  • Flat model with zero copy loading

Architecture

nncase arch

Build from source

It is recommended to install nncase directly through pip. At present, the source code related to k510 and K230 chips is not open source, so it is not possible to use nncase-K510 and nncase-kpu (K230) directly by compiling source code.

If there are operators in your model that nncase does not yet support, you can request them in the issue or implement them yourself and submit the PR. Later versions will be integrated, or contact us to provide a temporary version. Here are the steps to compile nncase.

git clone https://github.com/kendryte/nncase.git
cd nncase
mkdir build && cd build

# Use Ninja
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./install
ninja && ninja install

# Use make
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./install
make && make install

Resources

Canaan developer community

Canaan developer community contains all resources related to K210, K510, and K230.

  • 资料下载 --> Pre-compiled images available for the development boards corresponding to the three chips.
  • 文档 --> Documents corresponding to the three chips.
  • 模型库 --> Examples and code for industrial, security, educational and other scenarios that can be run on the K210 and K230.
  • 模型训练 --> The model training platform for K210 and K230 supports the training of various scenarios.

Bilibili

K210 related repo

K230 related repo


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

nncase-2.10.0-cp313-cp313-win_amd64.whl (19.7 MB view details)

Uploaded CPython 3.13Windows x86-64

nncase-2.10.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (30.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

nncase-2.10.0-cp313-cp313-macosx_12_0_arm64.whl (22.0 MB view details)

Uploaded CPython 3.13macOS 12.0+ ARM64

nncase-2.10.0-cp312-cp312-win_amd64.whl (19.7 MB view details)

Uploaded CPython 3.12Windows x86-64

nncase-2.10.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (30.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

nncase-2.10.0-cp312-cp312-macosx_12_0_arm64.whl (22.0 MB view details)

Uploaded CPython 3.12macOS 12.0+ ARM64

nncase-2.10.0-cp311-cp311-win_amd64.whl (19.7 MB view details)

Uploaded CPython 3.11Windows x86-64

nncase-2.10.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (30.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

nncase-2.10.0-cp311-cp311-macosx_12_0_arm64.whl (22.0 MB view details)

Uploaded CPython 3.11macOS 12.0+ ARM64

nncase-2.10.0-cp310-cp310-win_amd64.whl (19.6 MB view details)

Uploaded CPython 3.10Windows x86-64

nncase-2.10.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (30.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

nncase-2.10.0-cp310-cp310-macosx_12_0_arm64.whl (22.0 MB view details)

Uploaded CPython 3.10macOS 12.0+ ARM64

nncase-2.10.0-cp39-cp39-win_amd64.whl (19.6 MB view details)

Uploaded CPython 3.9Windows x86-64

nncase-2.10.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (30.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

nncase-2.10.0-cp39-cp39-macosx_12_0_arm64.whl (22.0 MB view details)

Uploaded CPython 3.9macOS 12.0+ ARM64

File details

Details for the file nncase-2.10.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: nncase-2.10.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 19.7 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for nncase-2.10.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 cf8f2f123fc8a1f8405022612d0da96e85f621afd8348c44fc8ec5700ab43702
MD5 7c98abe912ca51c0db6ac1e74c5e86aa
BLAKE2b-256 1decb46e9e5ece8b75937e9b9ebef5567db09a304f5cd26366e03ef7e71135eb

See more details on using hashes here.

File details

Details for the file nncase-2.10.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for nncase-2.10.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 3a60644603e6d608f89790f33aa96952bb4c670977b02e50d672f05462b4ef05
MD5 d65dae94dca5dc636507c0f080efbe61
BLAKE2b-256 aeb1168f8694c0eef3d44a4c6dc78144da6809ee32c852fe3cc3af79c2f160db

See more details on using hashes here.

File details

Details for the file nncase-2.10.0-cp313-cp313-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for nncase-2.10.0-cp313-cp313-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 e1ad4678f833fb84c86cd080a5c718f8917bdbbaaa7cf9a279b97a9f0fddef01
MD5 9836edb137bff1631dedde3a97343901
BLAKE2b-256 44ce50ea334582d59ec2cac7b6633b11438716b1ac0ece7d29418623672f2c98

See more details on using hashes here.

File details

Details for the file nncase-2.10.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: nncase-2.10.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 19.7 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for nncase-2.10.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 70b67387478737ed66c4806b4e1170d243d34ebae7910cf0dbb1d21fbc369f44
MD5 29c8be38d6fb7a8691566fe6a466924d
BLAKE2b-256 7ddab67073c81a34c6211eb0d5ddf00c39e567050fb1ddd5ce067e92f8c85803

See more details on using hashes here.

File details

Details for the file nncase-2.10.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for nncase-2.10.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 dadc7d8381de6bd52b489a8c11c6aa3435af63b561a4b12e8c0a6b3d0db8cf7f
MD5 44625718d95b093f6c15e31598c7a036
BLAKE2b-256 1d03296df83848ce7ba9d15e0150086ccb34f0b983966ae9998fa84d7e909542

See more details on using hashes here.

File details

Details for the file nncase-2.10.0-cp312-cp312-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for nncase-2.10.0-cp312-cp312-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 a21cf263dafa884625f9945b1546c8af925469336ed9e20ce2d28e9a05ce8b86
MD5 8527566d1308a698c51059ad25da7406
BLAKE2b-256 b4e70374dd71abccb8fd5d9ce64750b544a54a077877e33c3762ab87768a70db

See more details on using hashes here.

File details

Details for the file nncase-2.10.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: nncase-2.10.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 19.7 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for nncase-2.10.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 87f1d3f178cbeedf7da1d89b5649a25859edf122f8db4789c787fae904b80567
MD5 0d0c5c0955f3d19c804341ca20424a3a
BLAKE2b-256 5609fdf728a16b80db104700b74e1703cdec4344cf990f92254df3809c82d18f

See more details on using hashes here.

File details

Details for the file nncase-2.10.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for nncase-2.10.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 98ce68866a19d4b52aafb48d43b780474ed225e43663e88d5c053d57c817deba
MD5 833377ee4a48a85e4b5cc82413a64aea
BLAKE2b-256 7c4b02f24bc431a415845a729fdbb06f37792e3da155efeb7a3c5c9478ac53a0

See more details on using hashes here.

File details

Details for the file nncase-2.10.0-cp311-cp311-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for nncase-2.10.0-cp311-cp311-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 74c1d79729c91fed3ad0560176e74dda6335d5a019780e04a75270f3c819c50f
MD5 9c5e58132881b5727c47ca9376433844
BLAKE2b-256 adc907b623dcc79e0e47ef2d81d1c68a74adcf4b724486085ffe7b6cdf7d9c54

See more details on using hashes here.

File details

Details for the file nncase-2.10.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: nncase-2.10.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 19.6 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for nncase-2.10.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 2af1da5ab309c57b79e30558df7b04fa2b0384532f315e141c020f365cac4fa1
MD5 be2a8ca779a62651274e4b525c9f56f6
BLAKE2b-256 b38b40f178f6c6457bef305c3dc4fcd1df014da9c296d66ba5330147ceb16922

See more details on using hashes here.

File details

Details for the file nncase-2.10.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for nncase-2.10.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 7ff4fa73cf838a2dda6ca65e7fba01f1582e02efd03c4af67b91082cf69572be
MD5 1d64c71a5ecfee994218a8788c723348
BLAKE2b-256 46419b289472e97787c58cd3c341f1e5840ca776347f538c03784c38c90f466a

See more details on using hashes here.

File details

Details for the file nncase-2.10.0-cp310-cp310-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for nncase-2.10.0-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 ada72193efdc6d4b2354ee0bca2e20e6e3389243b83611f92816508d7fe22474
MD5 4388645267f59be6cd6fd34ffa8c5956
BLAKE2b-256 3160c22ae7ce98462a515af47de20579d11d9f4e5b286a2c0e3a49582857d81f

See more details on using hashes here.

File details

Details for the file nncase-2.10.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: nncase-2.10.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 19.6 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for nncase-2.10.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 7751425d0dbde7e25c2c49d422e4678f6ab8899d73261a20bd9c4cc47de2fdeb
MD5 b3944d4ddea7e05e0a877654adc6d6cf
BLAKE2b-256 13b6cae47dd492b6c4fc8dfb90a740fe3a15c615d07aa7a15988b970bdd356af

See more details on using hashes here.

File details

Details for the file nncase-2.10.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for nncase-2.10.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 a9a3f3b672c0742ab319da26932a86e8f29791d1631b3590d806451fb75a3598
MD5 99d06c1a76d672a6b21d49328192ab38
BLAKE2b-256 24a24ee3fac644c720962ce02e76eaf6104dd98be1dfda1d6d07e75f10fccf66

See more details on using hashes here.

File details

Details for the file nncase-2.10.0-cp39-cp39-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for nncase-2.10.0-cp39-cp39-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 10ba03bee36b76ab18cfb148075cc8f711ec7657183507a04029dfd64dd371f2
MD5 e12fd4ded64e56c5afde122d733e7028
BLAKE2b-256 963a36c2bca36dcedf8757b6645efd337f65f02687b636270bb020e1bcb70f14

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page