Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:edge2:npu:demos:vgg16

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
products:sbc:edge2:npu:demos:vgg16 [2023/08/22 06:06]
louis created
products:sbc:edge2:npu:demos:vgg16 [2023/09/20 03:12] (current)
louis
Line 1: Line 1:
-====== Demo4 VGG16 ======+~~tag>NPU VGG16 Edge2 TensorFlow Keras ~~ 
 + 
 +====== VGG16 TensorFlow Keras Edge2 Demo - 4 ====== 
 + 
 +{{indexmenu_n>4}}
  
 ===== Get Source Code ===== ===== Get Source Code =====
Line 32: Line 36:
 ==== Get convert tool ==== ==== Get convert tool ====
  
-Download Tool from [[https://github.com/rockchip-linux/rknn-toolkit2.git|Rockchip Github]].+Download Tool from [[gh>rockchip-linux/rknn-toolkit2]].
  
 ```shell ```shell
Line 39: Line 43:
 ``` ```
  
-Install dependences and RKNN toolkit2 packages,+Install dependences and RKNN toolkit2 packages.
  
 ```shell ```shell
Line 49: Line 53:
 ``` ```
  
-==== convert ====+==== Convert ====
  
 Keras model can convert rknn model directly. But this demo is to convert tensorflow model(.pb) first, and convert tnesorflow model to rknn model. We use this tool to convert. Keras model can convert rknn model directly. But this demo is to convert tensorflow model(.pb) first, and convert tnesorflow model to rknn model. We use this tool to convert.
Line 57: Line 61:
 ``` ```
  
-Enter rknn-toolkit2/examples/tensorflow/ssd_mobilenet_v1 and modify test.py as follows.+Enter ''rknn-toolkit2/examples/tensorflow/ssd_mobilenet_v1'' and modify ''test.py'' as follows.
  
-```shell+```python test.py
 # Create RKNN object # Create RKNN object
 rknn = RKNN(verbose=True) rknn = RKNN(verbose=True)
Line 96: Line 100:
 ``` ```
  
-Run test.py to generate rknn model.+Run ''test.py'' to generate rknn model.
  
 ```shell ```shell
Line 106: Line 110:
 ==== Get source code ==== ==== Get source code ====
  
-Clone the source code form our [[https://github.com/khadas/edge2-npu|Github]].+Clone the source code from our [[gh>khadas/edge2-npu]].
  
 ```shell ```shell
Line 123: Line 127:
 === Picture input demo === === Picture input demo ===
  
-Put yolov8n.rknn in edge2-npu/C++/vgg16/data/model.+Put ''vgg16.rknn'' in ''edge2-npu/C++/vgg16/data/model''.
  
 ```shell ```shell
-// compile+# Compile
 $ bash build.sh $ bash build.sh
  
-// run+# Run
 $ cd install/vgg16 $ cd install/vgg16
 $ ./vgg16 data/model/vgg16.rknn data/img/airplane.jpeg $ ./vgg16 data/model/vgg16.rknn data/img/airplane.jpeg
Line 135: Line 139:
  
 <WRAP tip > <WRAP tip >
-If your yolov8n model classes is not the same as coco, please change ‘’data/class_str.txt’’ and the ‘’OBJ_CLASS_NUM’’ in ‘’include/postprocess.h’’.+If your **VGG16** model classes is not the same as **cifar10**, please change ''data/vgg16_class.txt'' and the ''OBJ_CLASS_NUM'' in ''include/postprocess.h''.
 </WRAP> </WRAP>
  
Last modified: 2023/08/22 06:06 by louis