This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
products:sbc:edge2:npu:demos:retinaface [2023/08/25 04:37] louis |
products:sbc:edge2:npu:demos:retinaface [2023/09/20 03:12] (current) louis |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ~~tag> NPU RetinaFace Edge2 PyTorch~~ |
+ | |||
+ | ====== | ||
+ | |||
+ | {{indexmenu_n> | ||
===== Get Source Code ===== | ===== Get Source Code ===== | ||
- | The codes we use. | + | The codes we use [[gh> |
```shell | ```shell | ||
git clone https:// | git clone https:// | ||
+ | ``` | ||
+ | |||
+ | Before training, modify '' | ||
+ | |||
+ | ```diff | ||
+ | diff --git a/ | ||
+ | index 87bb528..4a22f2a 100644 | ||
+ | --- a/ | ||
+ | +++ b/ | ||
+ | @@ -25,5 +25,6 @@ def get_lr(optimizer): | ||
+ | | ||
+ | |||
+ | def preprocess_input(image): | ||
+ | - image -= np.array((104, | ||
+ | + image = image / 255.0 | ||
+ | | ||
``` | ``` | ||
Line 34: | Line 54: | ||
==== Get convert tool ==== | ==== Get convert tool ==== | ||
- | Download Tool from [[https:// | + | Download Tool from [[gh>rockchip-linux/ |
```shell | ```shell | ||
Line 52: | Line 72: | ||
==== Convert ==== | ==== Convert ==== | ||
- | |||
- | Before training, modify '' | ||
- | |||
- | ```diff | ||
- | diff --git a/ | ||
- | index 87bb528..4a22f2a 100644 | ||
- | --- a/ | ||
- | +++ b/ | ||
- | @@ -25,5 +25,6 @@ def get_lr(optimizer): | ||
- | | ||
- | |||
- | def preprocess_input(image): | ||
- | - image -= np.array((104, | ||
- | + image = image / 255.0 | ||
- | | ||
- | ``` | ||
After training model, we should convert pytorch model to onnx model. Create a python file written as follows and run. | After training model, we should convert pytorch model to onnx model. Create a python file written as follows and run. | ||
Line 132: | Line 136: | ||
==== Get source code ==== | ==== Get source code ==== | ||
- | Clone the source code form our [[https:// | + | Clone the source code from our [[gh>khadas/ |
```shell | ```shell | ||
Line 170: | Line 174: | ||
# Run | # Run | ||
$ cd install/ | $ cd install/ | ||
- | $ ./ | + | $ ./ |
``` | ``` | ||
'' | '' | ||