Merge pull request #2918 from horror-proton/test/onnx_linux

feat: 更新 `CMakeLists.txt`
This commit is contained in:
MistEO
2022-11-28 19:40:43 +08:00
committed by GitHub
2 changed files with 26 additions and 6 deletions

View File

@@ -8,6 +8,10 @@ endif ()
option(BUILD_TEST "build a demo" OFF)
option(BUILD_XCFRAMEWORK "build xcframework for macOS app" OFF)
option(BUILD_UNIVERSAL "build both arm64 and x86_64 on macOS" OFF)
option(INSTALL_PYTHON "install python ffi" OFF)
option(INSTALL_RESOURCE "install resource" OFF)
set(CMAKE_INSTALL_RPATH "$ORIGIN/")
if (BUILD_UNIVERSAL)
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
@@ -65,11 +69,27 @@ else ()
"-framework Accelerate"
)
else ()
find_package(OpenCV REQUIRED)
find_package(OpenCV REQUIRED PATHS ${OpenCV_DIR})
target_include_directories(MeoAssistant PRIVATE ${OpenCV_INCLUDE_DIRS})
target_link_libraries(MeoAssistant ${OpenCV_LIBS})
target_link_libraries(MeoAssistant ppocr paddle_inference protobuf cryptopp gflags glog utf8proc xxhash iomp5 mkldnn mklml_intel)
include(${FASTDEPLOY_INSTALL_DIR}/FastDeploy.cmake)
include_directories(${FASTDEPLOY_INCS})
target_link_libraries(MeoAssistant ${FDLIB})
target_link_libraries(MeoAssistant ${PADDLE2ONNX_LIB})
target_link_libraries(MeoAssistant ${ORT_LIB})
install(TARGETS MeoAssistant DESTINATION .)
install(DIRECTORY ${FASTDEPLOY_INSTALL_DIR}/lib/ DESTINATION . USE_SOURCE_PERMISSIONS)
install(DIRECTORY ${FASTDEPLOY_INSTALL_DIR}/third_libs/install/paddle2onnx/lib/ DESTINATION . USE_SOURCE_PERMISSIONS)
install(DIRECTORY ${ORT_LIB_PATH}/ DESTINATION . USE_SOURCE_PERMISSIONS)
if (INSTALL_PYTHON)
install(DIRECTORY src/Python DESTINATION .)
endif (INSTALL_PYTHON)
if (INSTALL_RESOURCE)
install(DIRECTORY resource DESTINATION .)
endif (INSTALL_RESOURCE)
endif (APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -idirafter ${PROJECT_SOURCE_DIR}/3rdparty/include")

View File

@@ -46,10 +46,10 @@ namespace asst
protected:
OcrPack();
std::unique_ptr<fastdeploy::RuntimeOption> m_ocr_option = nullptr;
std::unique_ptr<fastdeploy::vision::ocr::DBDetector> m_det = nullptr;
std::unique_ptr<fastdeploy::vision::ocr::Recognizer> m_rec = nullptr;
std::unique_ptr<fastdeploy::pipeline::PPOCRv3> m_ocr = nullptr;
std::unique_ptr<fastdeploy::RuntimeOption> m_ocr_option;
std::unique_ptr<fastdeploy::vision::ocr::DBDetector> m_det;
std::unique_ptr<fastdeploy::vision::ocr::Recognizer> m_rec;
std::unique_ptr<fastdeploy::pipeline::PPOCRv3> m_ocr;
};
class WordOcr final : public SingletonHolder<WordOcr>, public OcrPack