This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
products:sbc:vim3:npu:opencv-dnn [2022/11/01 02:36] frank removed |
products:sbc:vim3:npu:opencv-dnn [2023/12/25 03:59] nick |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== OpenCV | + | ~~tag> VIM3 OpenCV~~ |
+ | ====== OpenCV DNN Usage ====== | ||
+ | |||
+ | <WRAP important > | ||
+ | For [[:VIM3]] only, not for [[:VIM3L]]. | ||
+ | </ | ||
+ | |||
+ | ===== Install Dependencies ===== | ||
+ | |||
+ | Before installing the OpenCV package, you need to install the dependencies. | ||
+ | |||
+ | ```shell | ||
+ | sudo apt update | ||
+ | sudo apt install python3 python3-dev python3-numpy cmake libgtk2.0-dev | ||
+ | ``` | ||
+ | |||
+ | ===== Install OpenCV ===== | ||
+ | |||
+ | Get the OpenCV package and install it. | ||
+ | |||
+ | ```shell | ||
+ | wget https:// | ||
+ | sudo dpkg -i opencv_4.8.1.deb | ||
+ | ``` | ||
+ | |||
+ | ===== Run Test ===== | ||
+ | |||
+ | ==== Get demo source ==== | ||
+ | |||
+ | Get the example repository from [[kg> | ||
+ | |||
+ | ```shell | ||
+ | cd ~ | ||
+ | git clone https:// | ||
+ | ``` | ||
+ | |||
+ | ==== Compile ==== | ||
+ | |||
+ | Compile with cmake tool. | ||
+ | |||
+ | ```shell | ||
+ | cd ~/ | ||
+ | mkdir build && cd build | ||
+ | cmake .. | ||
+ | make | ||
+ | ``` | ||
+ | |||
+ | ==== Run ==== | ||
+ | |||
+ | After the operation is successful, you can see that the camera has captured the face. | ||
+ | |||
+ | ```shell | ||
+ | cd ~/ | ||
+ | ./ | ||
+ | ``` | ||
+ | |||
+ | <WRAP tip > | ||
+ | For example my cam device node is ''/ | ||
+ | </ | ||
+ | |||
+ | {{products: | ||
+ | |||
+ | ===== Quantize Model ===== | ||
+ | |||
+ | We suggest that quantize your model before running on VIM3. If your model performs bad after quantizing, without quantification is okay. Get [[https:// |