opencv_dnn/README.md
Example to deploy libfacedetection with the OpenCV's FaceDetectorYN in both Python and C++.
Please note that OpenCV DNN does not support the latest version of YuNet with dynamic input shape. Please ensure you have the exact same input shape as the one in the ONNX model to run latest YuNet with OpenCV DNN.
Important Notes:
FaceDetectorYN.Envrionment tested:
numpy and opencv-python.
pip install numpy
pip install "opencv-python>=4.5.4.58"
python python/detect.py --help.
# detect on an image
python python/detect.py --model=/path/to/yunet.onnx --input=/path/to/example/image
# detect on default camera
python python/detect.py --model=/path/to/yunet.onnx
cmake:
cd cpp
mkdir build && cd build
cmake .. # NOTE: if cmake failed finding OpenCV, add the option `-DCMAKE_PREFIX_PATH=/path/to/opencv/install`
make
# detect on an image
./detect -m/path/to/yunet.onnx -i=/path/to/image
# detect on default camera
./detect -m/path/to/yunet.onnx