This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
products:sbc:vim3:npu:ksnn:ksnn-usage [2023/09/10 05:27] hyphop [Example of use] |
products:sbc:vim3:npu:ksnn:ksnn-usage [2023/12/21 01:29] louis |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ~~tag> VIM3 VIM3L NPU Python API KSNN ~~ | + | ~~tag> VIM3 VIM3L NPU Python API KSNN ~~ |
====== KSNN Usage ====== | ====== KSNN Usage ====== | ||
- | This article shows VIM3 NPU usage examples through **KSSN** - Python API. | + | This article shows VIM3 NPU usage examples through **KSNN** - Python API. |
<WRAP help > | <WRAP help > | ||
- | **KSSN** is [[https:// | + | **KSNN** is [[https:// |
</ | </ | ||
===== Install KSNN ===== | ===== Install KSNN ===== | ||
- | Get code: [[gh> | + | Get the library and example |
```shell | ```shell | ||
Line 18: | Line 18: | ||
``` | ``` | ||
- | Installation | + | Install the dependencies: |
```shell | ```shell | ||
Line 33: | Line 33: | ||
===== Usage example ===== | ===== Usage example ===== | ||
- | Demos are all concentrated | + | All Demo examples |
```shell | ```shell | ||
Line 40: | Line 40: | ||
``` | ``` | ||
- | Take Inception V3 as an example, other demos are similar. | + | Choose '' |
```shell | ```shell | ||
- | $ cd tensorflow && ls | + | $ cd tensorflow && ls -1 |
- | README.md | + | data |
+ | libs | ||
+ | models | ||
+ | README.md | ||
+ | box_priors.txt | ||
+ | inceptionv3.py | ||
+ | mobilenet_ssd_picture.py | ||
``` | ``` | ||
- | The running commands and conversion parameters are in the '' | + | The running commands and conversion parameters are in the '' |
```shell | ```shell | ||
Line 66: | Line 72: | ||
--inputs input \ | --inputs input \ | ||
--outputs InceptionV3/ | --outputs InceptionV3/ | ||
- | --mean-values '128,128,128,128' \ | + | --mean-values '128 128 128 0.0078125' \ |
--quantized-dtype asymmetric_affine \ | --quantized-dtype asymmetric_affine \ | ||
--kboard VIM3 --print-level 1 | --kboard VIM3 --print-level 1 | ||
Line 77: | Line 83: | ||
--inputs FeatureExtractor/ | --inputs FeatureExtractor/ | ||
--outputs "' | --outputs "' | ||
- | --mean-values '127.5,127.5,127.5,127.5' \ | + | --mean-values '127.5 127.5 127.5 0.0078431' \ |
--quantized-dtype asymmetric_affine \ | --quantized-dtype asymmetric_affine \ | ||
--kboard VIM3 --print-level 1 | --kboard VIM3 --print-level 1 | ||
Line 85: | Line 91: | ||
``` | ``` | ||
- | Run Inception V3: | + | Run '' |
```shell | ```shell | ||
Line 161: | Line 167: | ||
1. The Demos that currently support cameras include the Yolo series and OpenPose. Take Yolov3 as an example, | 1. The Demos that currently support cameras include the Yolo series and OpenPose. Take Yolov3 as an example, | ||
- | ```shell | + | ```sh |
- | $ cd ksnn/ | + | cd ksnn/ |
- | $ python3 hand-cap.py --model ./ | + | |
+ | python3 hand-cap.py --model ./ | ||
+ | | ||
``` | ``` | ||
2. Currently, the only demo that supports RTSP is the yolo series. Take Yolov3 as an example, | 2. Currently, the only demo that supports RTSP is the yolo series. Take Yolov3 as an example, | ||
- | ```shell | + | ```sh |
- | $ cd ksnn/ | + | cd ksnn/ |
- | $ python3 flask-yolov3.py --model ./ | + | |
+ | python3 flask-yolov3.py --model ./ | ||
+ | | ||
``` | ``` | ||