This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # xxd --> bash utility for generating hex dumps | |
| xxd -i face_detector.param > face_detector_param.h | |
| xxd -i face_detector.bin > face_detector_bin.h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| #include <array> | |
| #include <vector> | |
| #include <memory> | |
| namespace sdk { | |
| enum class ErrorCode { | |
| NO_ERROR, | |
| FAILED |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Obtain release tag 20200916, set up build directories | |
| test -e 20200916.zip || wget https://github.com/Tencent/ncnn/archive/20200916.zip | |
| test -e ncnn-20200916 || unzip 20200916.zip | |
| cd ncnn-20200916 | |
| test -e build_amd64 && rm -rf build_amd64 | |
| test -e build_arm32 && rm -rf build_arm32 | |
| test -e build_arm64 && rm -rf build_arm64 | |
| mkdir build_amd64 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import tfsdk | |
| import cv2 | |
| import os | |
| # Set the configuration options | |
| options = tfsdk.ConfigurationOptions() | |
| # Use the FULL model | |
| options.fr_model = tfsdk.FACIALRECOGNITIONMODEL.FULL | |
| # Enable vector compression |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import tfsdk | |
| import os | |
| # Set the configuration options | |
| options = tfsdk.ConfigurationOptions() | |
| # Use the FULL model | |
| options.fr_model = tfsdk.FACIALRECOGNITIONMODEL.FULL | |
| # Enable vector compression | |
| options.fr_vector_compression = True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cmake_minimum_required(VERSION 3.0) | |
| SET ( CMAKE_SYSTEM_NAME Linux ) | |
| SET ( CMAKE_SYSTEM_PROCESSOR aarch64 ) | |
| SET ( CMAKE_C_COMPILER "aarch64-linux-gnu-gcc" ) | |
| SET ( CMAKE_CXX_COMPILER "aarch64-linux-gnu-g++" ) | |
| SET ( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER ) | |
| SET ( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) | |
| SET ( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cmake_minimum_required(VERSION 3.0) | |
| SET ( CMAKE_SYSTEM_NAME Linux ) | |
| SET ( CMAKE_SYSTEM_PROCESSOR arm ) | |
| SET ( CMAKE_C_COMPILER "arm-linux-gnueabihf-gcc" ) | |
| SET ( CMAKE_CXX_COMPILER "arm-linux-gnueabihf-g++" ) | |
| SET ( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER ) | |
| SET ( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) | |
| SET ( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <opencv2/opencv.hpp> | |
| #include <memory> | |
| #include <string> | |
| #include <vector> | |
| #include "mtcnn.h" | |
| #include "net.h" | |
| // Loads image, computes landmark locations, draws landmarks on image and save to disk | |
| void detectLandmarks(const std::string& imgPath, const std::unique_ptr<MTCNN>& mtcnnPtr); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #################### | |
| # build for aarch32 | |
| #################### | |
| mkdir build_aarch32 | |
| cd build_aarch32 | |
| cmake -D NCNN_BUILD_TOOLS=OFF -D NCNN_VULKAN=OFF -D CMAKE_BUILD_TYPE=Release -D NCNN_DISABLE_RTTI=OFF -D CMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabihf.toolchain.cmake .. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #################### | |
| # build for aarch32 | |
| #################### | |
| mkdir build_aarch32 | |
| cd build_aarch32 | |
| cmake -DCMAKE_TOOLCHAIN_FILE="../platforms/linux/arm-gnueabi.toolchain.cmake" -D CMAKE_INSTALL_PREFIX="/usr/local" -D BUILD_SHARED_LIBS=OFF -D CMAKE_BUILD_TYPE=RELEASE -D BUILD_DOCS=OFF -D BUILD_EXAMPLES=OFF -D BUILD_opencv_apps=OFF -D WITH_CAROTENE=OFF -D BUILD_opencv_python2=OFF -D BUILD_opencv_python3=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D FORCE_VTK=OFF -D WITH_FFMPEG=OFF -D WITH_GDAL=OFF -D WITH_IPP=OFF -D WITH_OPENEXR=OFF -D WITH_OPENGL=OFF -D WITH_QT=OFF -D WITH_TBB=OFF -D WITH_XINE=OFF -D BUILD_JPEG=ON -D BUILD_ZLIB=ON -D BUILD_PNG=ON -D BUILD_TIFF=OFF -D BUILD_BUILD_JASPER=OFF -D WITH_ITT=OFF -D WITH_LAPACK=OFF -D WITH_OPENCL=OFF -D WITH_TIFF=OFF -D WITH_PNG=ON -D WITH_OPENCLAMDFFT=OFF -D WITH_OPENCLAMDBLAS=OFF -D WITH_VA_INTEL=OFF -D WITH_WEBP=OFF -D WITH_JASPER=OFF .. | |
| make -j$(nproc) |