mmdeploy/csrc/apis/python/CMakeLists.txt
lzhangzz bb655af629
Add Python wrapper for SDK (#27)
* add python API for detector

* integrate detection

* add python segmentor

* add segmentation support

* add classifier, text-detector, text-recognizer and restorer

* integrate classifier

* integrate textdet, textrecog and restorer

* simplify

* add inst-seg

* fix inst-seg

* integrate inst-seg

* Moidfy _build_wrapper

* better pipeline substitution

* use registry for backend model creation

* build Python module according to C API targets

* minor fix

* move sdk data pipeline to backend_config

* remove debugging lines

* add docstring for SDKEnd2EndModel

* fix type hint

* fix lint

* fix lint

* insert build/lib to sys.path

Co-authored-by: SingleZombie <singlezombie@163.com>
2022-01-13 11:31:51 +08:00

34 lines
1.1 KiB
CMake

# Copyright (c) OpenMMLab. All rights reserved.
cmake_minimum_required(VERSION 3.14)
project(mmdeploy_python)
if (NOT TARGET pybind11)
add_subdirectory(${CMAKE_SOURCE_DIR}/third_party/pybind11 pybind11)
endif ()
set(MMDEPLOY_PYTHON_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/common.cpp)
macro(mmdeploy_python_add_module name)
if (TARGET mmdeploy_${name})
list(APPEND MMDEPLOY_PYTHON_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.cpp)
endif ()
endmacro()
mmdeploy_python_add_module(classifier)
mmdeploy_python_add_module(detector)
mmdeploy_python_add_module(segmentor)
mmdeploy_python_add_module(text_detector)
mmdeploy_python_add_module(text_recognizer)
mmdeploy_python_add_module(restorer)
pybind11_add_module(${PROJECT_NAME} ${MMDEPLOY_PYTHON_SRCS})
target_link_libraries(${PROJECT_NAME} PRIVATE
${MMDEPLOY_LIBS}
-Wl,--whole-archive ${MMDEPLOY_STATIC_MODULES} -Wl,--no-whole-archive
-Wl,--no-as-needed ${MMDEPLOY_DYNAMIC_MODULES} -Wl,--as-need)
target_include_directories(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../..)