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.11.0-cp313-cp313-win_amd64.whl (19.7 MB view details)

Uploaded CPython 3.13Windows x86-64

nncase-2.11.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.11.0-cp313-cp313-macosx_12_0_arm64.whl (22.0 MB view details)

Uploaded CPython 3.13macOS 12.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

nncase-2.11.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.11.0-cp312-cp312-macosx_12_0_arm64.whl (22.0 MB view details)

Uploaded CPython 3.12macOS 12.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

nncase-2.11.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.11.0-cp311-cp311-macosx_12_0_arm64.whl (22.0 MB view details)

Uploaded CPython 3.11macOS 12.0+ ARM64

nncase-2.11.0-cp310-cp310-win_amd64.whl (19.7 MB view details)

Uploaded CPython 3.10Windows x86-64

nncase-2.11.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.11.0-cp310-cp310-macosx_12_0_arm64.whl (22.0 MB view details)

Uploaded CPython 3.10macOS 12.0+ ARM64

nncase-2.11.0-cp39-cp39-win_amd64.whl (19.7 MB view details)

Uploaded CPython 3.9Windows x86-64

nncase-2.11.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.11.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.11.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: nncase-2.11.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.2.0 CPython/3.10.12

File hashes

Hashes for nncase-2.11.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 73750f039bd68897cbdcff302cc7f68e6dd78a87568d0ef5b872a3c2ddfd4074
MD5 c9fd842e593496d392cbf3e546897fb4
BLAKE2b-256 71877b294803d61f3e25e284bfded1c84561fe1a7dea6dd3a3e423af4335c039

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nncase-2.11.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 fb0e9a7dabdc1c312ffbd341bb0be6ca60e703d8832a9ed014799790ffc7f946
MD5 513ea9efd7efbb9b7239c3ff5422b04e
BLAKE2b-256 cd17075c8dda8b70aec8c53a3e54ff65e23d49fd4098ae48e3fb2446eedb9f61

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nncase-2.11.0-cp313-cp313-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 6fa1a3e97e8e2e612ed19aa30ed31704c7f6ca7a5b75837b91bf4f466d3da009
MD5 39199655d5caba8245fd861bed031a4c
BLAKE2b-256 afc4e7e1464370ef2ad5ad195e1e939843d8c4f34dfb002afebcedb4a36bcb99

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nncase-2.11.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.2.0 CPython/3.10.12

File hashes

Hashes for nncase-2.11.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 68beb2b3e7d46fc1d7f185c7a6619e40995160ae9f5d94bfd3965be1e980b193
MD5 48cac96ed0adb0316f9c2ea0c653df0f
BLAKE2b-256 26654d2cf669e77286b52c6a5237cda84fb7f4be220110c127a627364680f04f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nncase-2.11.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 016addd4fbdca88ff99da4198323812244a09414960e88190f6ea83432b23cc6
MD5 6c00a243447ad9f2a5a641f3494c4de7
BLAKE2b-256 780b5e0020490d6a43f9e54b8821fed1adaa85b9a67c8bc624483e90dcf9a249

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nncase-2.11.0-cp312-cp312-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 feeb2c9b38bd57a432b6228c29184299d40de3170c24a332b95226c223b61536
MD5 b9e77c90ec8a36be32d33b16322be99f
BLAKE2b-256 541ae7333a7fa4f36a939be96175e24bbce5c3c5f4af5d0c5c6965ce595b91e1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nncase-2.11.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.2.0 CPython/3.10.12

File hashes

Hashes for nncase-2.11.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 864a8fed26d7291cbe488e7a05a3dba480cb0d691967a957b60d78947d42d467
MD5 53bf2ae52710f439cbc7991168d36797
BLAKE2b-256 09f0f2adb930af31079aaff38b56fe0b4922e91035b4a72926097261c13cfc17

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nncase-2.11.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 7d5fd66134484a3eb6cf452646e3d0a3df134869b7a03532e74103dfa189b616
MD5 9ca4af2bd69658d70bf9b41300b8ef19
BLAKE2b-256 ea1654c41ed69ce91fca3a64d9577e792a45a57cfd89861f3e2b28e3cb341264

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nncase-2.11.0-cp311-cp311-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 9b0c86b8e3828fb69b8906d9b8de518720d0bbf561ce5e708ed50461da352d78
MD5 0a61cb0488420226d32bcbf12aa66d55
BLAKE2b-256 36a20f44413617999061d0a6fc7e76ff81e38de60b3ca7c339e29e467cfd4c07

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nncase-2.11.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 19.7 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for nncase-2.11.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3a32fd1ce6525c238a3b2f96d12cd20d9f4454b73236bb591bc9413751bceac8
MD5 564b4cd835696e21ddefe5fb9362ed36
BLAKE2b-256 a43759ccb193503f6fca5ecc8e9ff473ac599794b2d34b1850504d5c98fd84be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nncase-2.11.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 c49dfd48b668d45c44230eac7d18eac4e03a13b6b573af3e01ea39baa48903fd
MD5 2a9791f3da00ec53db6c5b1b51e716f3
BLAKE2b-256 e126f56a80a0b4867ab636eb23431abe9a964a70c2afe1acceb0af784688212c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nncase-2.11.0-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 e981426c4e20a1293ba08675cbe3c35568383a541deb47afb73ed847a39691d6
MD5 1cee61dd2bd043d6de8438d03cd24085
BLAKE2b-256 9a5a16d7b41e6fbc18c9d4d63629afe5248e4507ba6eaa72e82b371424238a72

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nncase-2.11.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 19.7 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for nncase-2.11.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 0708c862c7d8cdb933c9e5a20cd62e284dbe70eebc0fdaf1107170e9864861d5
MD5 099b376515905eca73ae586c600d3599
BLAKE2b-256 6a8c4426524042bfbd43c7da9de23a4af3289cf2d618237abe9003d51c969721

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nncase-2.11.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 b49938bda3bd6a0a15f712486b5ec60d0d0d23d58d0df2ba7574910aa0e326b5
MD5 eb69a3b40128e51f28216a188757ad2f
BLAKE2b-256 8f3c3ccf43cd8a20c5bf391b9eeb9fbb08d32eebae5f5473902958d8099d7349

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nncase-2.11.0-cp39-cp39-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 1adcaf6e0f0d78a5aa4f24925fba406291494397aa2dcfa964787c5473d77367
MD5 ee7c25d6ece44882affffb7535f52176
BLAKE2b-256 a3be705de14c74b32bfbeeae05fc471f2d0e002dbf3ee02740cfd7b5d8ec872b

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