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
| 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
| 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
| # 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
| #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
| # 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
| 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++) |
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 options for cross compiling | |
| option(BUILD_ARM32 "Cross compile the SDK for arm32" OFF) | |
| option(BUILD_ARM64 "Cross compile the SDK for arm64" OFF) | |
| # Choose the appropriate toolchain file | |
| if (BUILD_ARM32) | |
| SET (CMAKE_TOOLCHAIN_FILE tools/toolchain-arm32.cmake) | |
| elseif(BUILD_ARM64) | |
| SET (CMAKE_TOOLCHAIN_FILE tools/toolchain-aarch64.cmake) | |
| endif() |
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
| add_custom_target(my_sdk | |
| COMMAND | |
| /bin/echo -e 'create libmy_sdk.a\\naddlib libmy_sdk_static.a\\naddlib ${LIBCNN}\\naddlib ${LIBOPENCV_CORE}\\naddlib ${LIBOPENCV_IMGCODECS}\\naddlib ${LIBOPENCV_IMGPROC}\\naddlib ${LIBOPENCV_ZLIB}\\naddlib ${LIBOPENCV_PNG}\\naddlib ${LIBOPENCV_TIFF}\\naddlib ${LIBOPENCV_JPG}\\nsave\\nend' | ar -M | |
| DEPENDS | |
| my_sdk_static | |
| COMMENT | |
| "Merging dependency libraries into my_sdk_static to create libmy_sdk.a" | |
| ) |
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
| #define CATCH_CONFIG_MAIN | |
| #include <iostream> | |
| #include "my_sdk.h" | |
| #include "catch.hpp" | |
| TEST_CASE("Core functionality", "[core]") | |
| { | |
| sdk::MySDK mySdk; |