This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
products:sbc:edge2:npu:demos:vgg16 [2023/08/22 06:06] louis created |
products:sbc:edge2:npu:demos:vgg16 [2025/04/09 23:30] (current) louis |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Demo4 VGG16 ====== | + | ~~tag> |
| - | ===== Get Source Code ===== | + | ====== VGG16 TensorFlow Keras Edge2 Demo - 4 ====== |
| + | |||
| + | {{indexmenu_n> | ||
| + | |||
| + | ===== Introduction ===== | ||
| + | |||
| + | VGG16 is a classification model. It can assign a single label to an entire image. | ||
| + | |||
| + | Image and inference results on Edge2. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | | ||
| + | |||
| + | ===== Train Model ===== | ||
| ```shell | ```shell | ||
| Line 32: | Line 46: | ||
| ==== Get convert tool ==== | ==== Get convert tool ==== | ||
| - | Download Tool from [[https:// | + | Download Tool from [[gh>rockchip-linux/ |
| ```shell | ```shell | ||
| Line 39: | Line 53: | ||
| ``` | ``` | ||
| - | Install dependences and RKNN toolkit2 packages, | + | Install dependences and RKNN toolkit2 packages. |
| ```shell | ```shell | ||
| Line 49: | Line 63: | ||
| ``` | ``` | ||
| - | ==== 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 71: | ||
| ``` | ``` | ||
| - | Enter rknn-toolkit2/ | + | Enter '' |
| - | ```shell | + | ```python test.py |
| # Create RKNN object | # Create RKNN object | ||
| rknn = RKNN(verbose=True) | rknn = RKNN(verbose=True) | ||
| Line 96: | Line 110: | ||
| ``` | ``` | ||
| - | Run test.py to generate rknn model. | + | Run '' |
| ```shell | ```shell | ||
| Line 106: | Line 120: | ||
| ==== Get source code ==== | ==== Get source code ==== | ||
| - | Clone the source code form our [[https:// | + | Clone the source code from our [[gh>khadas/ |
| ```shell | ```shell | ||
| Line 123: | Line 137: | ||
| === Picture input demo === | === Picture input demo === | ||
| - | Put yolov8n.rknn in edge2-npu/ | + | Put '' |
| ```shell | ```shell | ||
| - | // compile | + | # Compile |
| $ bash build.sh | $ bash build.sh | ||
| - | // run | + | # Run |
| $ cd install/ | $ cd install/ | ||
| $ ./vgg16 data/ | $ ./vgg16 data/ | ||
| Line 135: | Line 149: | ||
| <WRAP tip > | <WRAP tip > | ||
| - | If your yolov8n | + | If your **VGG16** |
| </ | </ | ||