This file contains 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
else if (n.op == "_copy") | |
{ | |
fprintf(pp, "%-16s", "UnaryOp"); | |
} |
This file contains 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 <iostream> | |
#include "ncnn/net.h" | |
#include "opencv2/opencv.hpp" | |
void normalize(std::vector<float>& arr) { | |
double mod = 0.0; | |
for (float i : arr) { | |
mod += i * i; | |
} |
This file contains 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.14) | |
project(ncnn-inference) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -fPIC -ffast-math -Ofast -fopenmp") | |
add_executable(ncnn_test main.cpp) | |
find_package( OpenCV REQUIRED ) | |
target_include_directories( | |
ncnn_test |
This file contains 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 os | |
import numpy as np | |
import nnvm.testing | |
import nnvm.compiler | |
import tvm | |
import mxnet as mx | |
from tvm import autotvm | |
import tvm.relay as relay | |
from tvm.autotvm.tuner import XGBTuner, GATuner, RandomTuner, GridSearchTuner |
This file contains 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 <fstream> | |
#include <iostream> | |
#include <memory> | |
#include "opencv2/opencv.hpp" | |
#include "tvm/runtime/module.h" | |
#include "tvm/runtime/registry.h" | |
#include "tvm/runtime/packed_func.h" | |
This file contains 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.14) | |
project(tvm-inference) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -fPIC -ffast-math -Ofast -ldl -lpthread") | |
add_executable(tvm_test tvm_runtime_pack.cc main.cpp) | |
set(HOME_TVM /path/to/tvm/dir) | |
find_package(OpenCV REQUIRED) |
This file contains 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) |
This file contains 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 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 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 ) |
OlderNewer