Skip to content

Commit

Permalink
Merge pull request #51 from JDAI-CV/unify_onnx2daq
Browse files Browse the repository at this point in the history
Read onnx model directly in dnnlibrary
  • Loading branch information
daquexian authored May 13, 2019
2 parents 3191182 + 82ff1b5 commit b0cad5b
Show file tree
Hide file tree
Showing 21 changed files with 817 additions and 176 deletions.
2 changes: 1 addition & 1 deletion .daq_pm/configs/onnx2daq
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# It is configuration file for [project_manager.vim](https://github.com/daquexian/project_manager.vim)
name DNNLibrary
type cpp
target onnx2daq
target onnx2daq-bin
cmake_options -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
build_dir build_onnx2daq

6 changes: 6 additions & 0 deletions .daq_pm/configs/onnx_infer
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name DNNLibrary
type cpp
target dnn_retrieve_result
build_dir build_onnxinfer
cmake_options -DCMAKE_SYSTEM_NAME=Android -DCMAKE_TOOLCHAIN_FILE=~/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_CPP_FEATURES=exceptions -DANDROID_PLATFORM=android-28 -DANDROID_ABI=arm64-v8a -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DDNN_READ_ONNX=ON -DONNX_CUSTOM_PROTOC_EXECUTABLE=/usr/bin/protoc
program_arguments ~/adb_push_and_run.sh binaries/dnn_retrieve_result
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ project(DNNLibrary)

option(DNN_BUILD_BIN "Build binaries" ON)
option(DNN_BUILD_JNI "Build Java Wrapper" OFF)
option(DNN_READ_ONNX "Read ONNX model directly instead of converting to .daq" OFF)
option(DNN_SYSTEM_PROTOBUF "Use system protobuf when building onnx2daq" OFF)

include(cmake/system.cmake)
Expand All @@ -14,7 +15,15 @@ configure_glog()
if (${CMAKE_SYSTEM_NAME} STREQUAL "Android")
set (CMAKE_CXX_STANDARD 17)

add_compile_options(-Os -fno-rtti)
add_compile_options(-Os)
if (${DNN_READ_ONNX} AND NOT TARGET onnx)
include(cmake/onnx.cmake)
configure_onnx()
set(ONNX2DAQ_ONLY_LIB ON)
add_subdirectory(tools)
else()
add_compile_options(-fno-rtti)
endif()
add_subdirectory(dnnlibrary)
add_subdirectory(binaries)
else()
Expand Down
Loading

0 comments on commit b0cad5b

Please sign in to comment.