moli232777144 / mtcnn_ncnn

基于ncnn框架搭建win及android端的MTCNN人脸检测工程
527 stars 177 forks source link

Shifting Mtcnn_ncnn to other code and use other C++ file over it. #33

Open ankittecholution opened 5 years ago

ankittecholution commented 5 years ago

I was trying to Shift the code to one of my project which has a c++ file but was not able to do that as a project can't have more then one cmake fie so I was not able to do so if anyone has a solution to it please help me out. Any help will be great.

moli232777144 commented 5 years ago

which c++ file?

ankittecholution commented 5 years ago

I was trying to implement object tracking over it. for tracking faces.

moli232777144 commented 5 years ago

add c++ file path to cmakeList.txt

ankittecholution commented 5 years ago

This is the cmake file for object tracking ` cmake_minimum_required(VERSION 3.4.1) set(CMAKE_VERBOSE_MAKEFILE on)

project(TSAS)

add_subdirectory(tensorflow_demo)`

This is cmake file inside tensoreflow_demo `project(TENSORFLOW_DEMO)

get_filename_component(SRC_DIR ${CMAKE_SOURCE_DIR}/.. ABSOLUTE)

if (ANDROID_ABI MATCHES "^armeabi-v7a$") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfloat-abi=softfp -mfpu=neon") elseif(ANDROID_ABI MATCHES "^arm64-v8a") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -ftree-vectorize") endif()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTANDALONE_DEMO_LIB \ -std=c++11 -fno-exceptions -fno-rtti -O2 -Wno-narrowing \ -fPIE") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} \ -Wl,--allow-multiple-definition \ -Wl,--whole-archive -fPIE -v")

file(GLOB_RECURSE tensorflow_demo_sources ${SRC_DIR}/jni/tensorflow_demo/.) add_library(tensorflow_demo SHARED ${tensorflow_demo_sources}) target_include_directories(tensorflow_demo PRIVATE ${CMAKE_SOURCE_DIR})

target_link_libraries(tensorflow_demo android log jnigraphics m atomic z) `

ankittecholution commented 5 years ago

When I include this into mtcnn cmake there is an error and if I put mtcnn cmake file there is an error that we mtcnn source file not found.