Skip to content

Commit

Permalink
adjust csrc includes
Browse files Browse the repository at this point in the history
  • Loading branch information
lzhangzz committed Jun 13, 2022
1 parent 6d48664 commit 8cd62d5
Show file tree
Hide file tree
Showing 221 changed files with 673 additions and 668 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ endif ()
# at function definition
include(cmake/MMDeploy.cmake)

add_subdirectory(csrc)
add_subdirectory(csrc/mmdeploy)

if (MMDEPLOY_BUILD_SDK)
install(TARGETS MMDeployStaticModules
Expand All @@ -87,7 +87,7 @@ if (MMDEPLOY_BUILD_SDK)
endif ()

if (MMDEPLOY_BUILD_SDK_PYTHON_API)
add_subdirectory(csrc/apis/python)
add_subdirectory(csrc/mmdeploy/apis/python)
endif ()

# export MMDeploy package
Expand Down
16 changes: 7 additions & 9 deletions csrc/mmdeploy/apis/c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ foreach (TASK ${COMMON_LIST})
mmdeploy_add_library(${TARGET_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/${TASK}.cpp)
target_link_libraries(${TARGET_NAME} PRIVATE mmdeploy::core)
target_include_directories(${TARGET_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/c>)
$<INSTALL_INTERFACE:include/mmdeploy/apis/c>)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${TASK}.h
DESTINATION include/c)
DESTINATION include/mmdeploy/apis/c)
endforeach ()

target_link_libraries(mmdeploy_executor PUBLIC
Expand All @@ -68,14 +67,13 @@ foreach (TASK ${TASK_LIST})
target_link_libraries(${TARGET_NAME} PRIVATE
mmdeploy_pipeline mmdeploy::core)
target_include_directories(${TARGET_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/c>)
$<INSTALL_INTERFACE:include/mmdeploy/apis/c>)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${TASK}.h
DESTINATION include/c)
DESTINATION include/mmdeploy/apis/c)
endforeach ()

install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/common.h
DESTINATION include/c)
#install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/common.h
# DESTINATION include/c)

if (MMDEPLOY_BUILD_SDK_CSHARP_API)
# build MMDeployExtern.dll just for csharp nuget package.
Expand All @@ -86,4 +84,4 @@ if (MMDEPLOY_BUILD_SDK_CSHARP_API)
mmdeploy_load_static(MMDeployExtern MMDeployStaticModules)
mmdeploy_load_dynamic(MMDeployExtern MMDeployDynamicModules)
target_link_libraries(MMDeployExtern PRIVATE MMDeployLibs)
endif()
endif ()
16 changes: 8 additions & 8 deletions csrc/mmdeploy/apis/c/classifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

#include <numeric>

#include "apis/c/common_internal.h"
#include "apis/c/handle.h"
#include "apis/c/pipeline.h"
#include "archive/value_archive.h"
#include "codebase/mmcls/mmcls.h"
#include "core/device.h"
#include "core/graph.h"
#include "core/utils/formatter.h"
#include "mmdeploy/apis/c/common_internal.h"
#include "mmdeploy/apis/c/handle.h"
#include "mmdeploy/apis/c/pipeline.h"
#include "mmdeploy/archive/value_archive.h"
#include "mmdeploy/codebase/mmcls/mmcls.h"
#include "mmdeploy/core/device.h"
#include "mmdeploy/core/graph.h"
#include "mmdeploy/core/utils/formatter.h"

using namespace mmdeploy;
using namespace std;
Expand Down
6 changes: 3 additions & 3 deletions csrc/mmdeploy/apis/c/common.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "common.h"

#include "apis/c/common_internal.h"
#include "apis/c/handle.h"
#include "core/mat.h"
#include "mmdeploy/apis/c/common_internal.h"
#include "mmdeploy/apis/c/handle.h"
#include "mmdeploy/core/mat.h"

mmdeploy_value_t mmdeploy_value_copy(mmdeploy_value_t input) {
if (!input) {
Expand Down
8 changes: 4 additions & 4 deletions csrc/mmdeploy/apis/c/common_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#ifndef MMDEPLOY_CSRC_APIS_C_COMMON_INTERNAL_H_
#define MMDEPLOY_CSRC_APIS_C_COMMON_INTERNAL_H_

#include "apis/c/common.h"
#include "apis/c/model.h"
#include "core/value.h"
#include "mmdeploy/apis/c/common.h"
#include "mmdeploy/apis/c/model.h"
#include "mmdeploy/core/value.h"

using namespace mmdeploy;

Expand Down Expand Up @@ -68,7 +68,7 @@ class wrapped<T, std::void_t<decltype(Cast(T{}))> > {
T release() noexcept { return std::exchange(v_, nullptr); }

auto operator*() { return Cast(v_); }
auto operator-> () { return Cast(v_); }
auto operator->() { return Cast(v_); }

T* ptr() noexcept { return &v_; }

Expand Down
20 changes: 10 additions & 10 deletions csrc/mmdeploy/apis/c/detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

#include <numeric>

#include "apis/c/common_internal.h"
#include "apis/c/executor_internal.h"
#include "apis/c/model.h"
#include "apis/c/pipeline.h"
#include "archive/value_archive.h"
#include "codebase/mmdet/mmdet.h"
#include "core/device.h"
#include "core/model.h"
#include "core/utils/formatter.h"
#include "core/value.h"
#include "mmdeploy/apis/c/common_internal.h"
#include "mmdeploy/apis/c/executor_internal.h"
#include "mmdeploy/apis/c/model.h"
#include "mmdeploy/apis/c/pipeline.h"
#include "mmdeploy/archive/value_archive.h"
#include "mmdeploy/codebase/mmdet/mmdet.h"
#include "mmdeploy/core/device.h"
#include "mmdeploy/core/model.h"
#include "mmdeploy/core/utils/formatter.h"
#include "mmdeploy/core/value.h"

using namespace std;
using namespace mmdeploy;
Expand Down
4 changes: 2 additions & 2 deletions csrc/mmdeploy/apis/c/executor.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright (c) OpenMMLab. All rights reserved.

#include "apis/c/executor.h"
#include "mmdeploy/apis/c/executor.h"

#include "common.h"
#include "common_internal.h"
#include "execution/when_all_value.h"
#include "executor_internal.h"
#include "mmdeploy/execution/when_all_value.h"

using namespace mmdeploy;

Expand Down
2 changes: 1 addition & 1 deletion csrc/mmdeploy/apis/c/executor_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#ifndef MMDEPLOY_CSRC_APIS_C_EXECUTOR_INTERNAL_H_
#define MMDEPLOY_CSRC_APIS_C_EXECUTOR_INTERNAL_H_

#include "execution/schedulers/registry.h"
#include "executor.h"
#include "mmdeploy/execution/schedulers/registry.h"

using namespace mmdeploy;

Expand Down
8 changes: 4 additions & 4 deletions csrc/mmdeploy/apis/c/handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

#include <memory>

#include "core/device.h"
#include "core/graph.h"
#include "core/value.h"
#include "graph/pipeline.h"
#include "mmdeploy/core/device.h"
#include "mmdeploy/core/graph.h"
#include "mmdeploy/core/value.h"
#include "mmdeploy/graph/pipeline.h"

namespace mmdeploy {

Expand Down
4 changes: 2 additions & 2 deletions csrc/mmdeploy/apis/c/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

#include <memory>

#include "core/logger.h"
#include "core/model.h"
#include "mmdeploy/core/logger.h"
#include "mmdeploy/core/model.h"
// clang-format on

using namespace mmdeploy;
Expand Down
8 changes: 4 additions & 4 deletions csrc/mmdeploy/apis/c/pipeline.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright (c) OpenMMLab. All rights reserved.

#include "apis/c/pipeline.h"
#include "pipeline.h"

#include "apis/c/common_internal.h"
#include "apis/c/executor_internal.h"
#include "apis/c/handle.h"
#include "mmdeploy/apis/c/common_internal.h"
#include "mmdeploy/apis/c/executor_internal.h"
#include "mmdeploy/apis/c/handle.h"

int mmdeploy_pipeline_create(mmdeploy_value_t config, const char* device_name, int device_id,
mmdeploy_exec_info_t exec_info, mm_handle_t* handle) {
Expand Down
16 changes: 8 additions & 8 deletions csrc/mmdeploy/apis/c/pose_detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

#include <numeric>

#include "apis/c/common_internal.h"
#include "apis/c/handle.h"
#include "apis/c/pipeline.h"
#include "codebase/mmpose/mmpose.h"
#include "core/device.h"
#include "core/graph.h"
#include "core/mat.h"
#include "core/utils/formatter.h"
#include "mmdeploy/apis/c/common_internal.h"
#include "mmdeploy/apis/c/handle.h"
#include "mmdeploy/apis/c/pipeline.h"
#include "mmdeploy/codebase/mmpose/mmpose.h"
#include "mmdeploy/core/device.h"
#include "mmdeploy/core/graph.h"
#include "mmdeploy/core/mat.h"
#include "mmdeploy/core/utils/formatter.h"

using namespace std;
using namespace mmdeploy;
Expand Down
16 changes: 8 additions & 8 deletions csrc/mmdeploy/apis/c/restorer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

#include "restorer.h"

#include "apis/c/common_internal.h"
#include "apis/c/executor_internal.h"
#include "apis/c/handle.h"
#include "apis/c/pipeline.h"
#include "codebase/mmedit/mmedit.h"
#include "core/device.h"
#include "core/graph.h"
#include "core/utils/formatter.h"
#include "mmdeploy/apis/c/common_internal.h"
#include "mmdeploy/apis/c/executor_internal.h"
#include "mmdeploy/apis/c/handle.h"
#include "mmdeploy/apis/c/pipeline.h"
#include "mmdeploy/codebase/mmedit/mmedit.h"
#include "mmdeploy/core/device.h"
#include "mmdeploy/core/graph.h"
#include "mmdeploy/core/utils/formatter.h"

using namespace mmdeploy;

Expand Down
14 changes: 7 additions & 7 deletions csrc/mmdeploy/apis/c/rotated_detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

#include <numeric>

#include "apis/c/common_internal.h"
#include "apis/c/handle.h"
#include "apis/c/pipeline.h"
#include "codebase/mmrotate/mmrotate.h"
#include "core/graph.h"
#include "core/mat.h"
#include "core/utils/formatter.h"
#include "mmdeploy/apis/c/common_internal.h"
#include "mmdeploy/apis/c/handle.h"
#include "mmdeploy/apis/c/pipeline.h"
#include "mmdeploy/codebase/mmrotate/mmrotate.h"
#include "mmdeploy/core/graph.h"
#include "mmdeploy/core/mat.h"
#include "mmdeploy/core/utils/formatter.h"

using namespace std;
using namespace mmdeploy;
Expand Down
22 changes: 11 additions & 11 deletions csrc/mmdeploy/apis/c/segmentor.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// Copyright (c) OpenMMLab. All rights reserved.

#include "apis/c/segmentor.h"

#include "apis/c/common_internal.h"
#include "apis/c/handle.h"
#include "apis/c/pipeline.h"
#include "codebase/mmseg/mmseg.h"
#include "core/device.h"
#include "core/graph.h"
#include "core/mat.h"
#include "core/tensor.h"
#include "core/utils/formatter.h"
#include "mmdeploy/apis/c/segmentor.h"

#include "mmdeploy/apis/c/common_internal.h"
#include "mmdeploy/apis/c/handle.h"
#include "mmdeploy/apis/c/pipeline.h"
#include "mmdeploy/codebase/mmseg/mmseg.h"
#include "mmdeploy/core/device.h"
#include "mmdeploy/core/graph.h"
#include "mmdeploy/core/mat.h"
#include "mmdeploy/core/tensor.h"
#include "mmdeploy/core/utils/formatter.h"

using namespace std;
using namespace mmdeploy;
Expand Down
16 changes: 8 additions & 8 deletions csrc/mmdeploy/apis/c/text_detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

#include <numeric>

#include "apis/c/common_internal.h"
#include "apis/c/executor_internal.h"
#include "apis/c/model.h"
#include "apis/c/pipeline.h"
#include "codebase/mmocr/mmocr.h"
#include "core/model.h"
#include "core/status_code.h"
#include "core/utils/formatter.h"
#include "mmdeploy/apis/c/common_internal.h"
#include "mmdeploy/apis/c/executor_internal.h"
#include "mmdeploy/apis/c/model.h"
#include "mmdeploy/apis/c/pipeline.h"
#include "mmdeploy/codebase/mmocr/mmocr.h"
#include "mmdeploy/core/model.h"
#include "mmdeploy/core/status_code.h"
#include "mmdeploy/core/utils/formatter.h"

using namespace std;
using namespace mmdeploy;
Expand Down
24 changes: 12 additions & 12 deletions csrc/mmdeploy/apis/c/text_recognizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@

#include <numeric>

#include "apis/c/common_internal.h"
#include "apis/c/executor_internal.h"
#include "apis/c/model.h"
#include "apis/c/pipeline.h"
#include "archive/value_archive.h"
#include "codebase/mmocr/mmocr.h"
#include "core/device.h"
#include "core/mat.h"
#include "core/model.h"
#include "core/status_code.h"
#include "core/utils/formatter.h"
#include "core/value.h"
#include "mmdeploy/apis/c/common_internal.h"
#include "mmdeploy/apis/c/executor_internal.h"
#include "mmdeploy/apis/c/model.h"
#include "mmdeploy/apis/c/pipeline.h"
#include "mmdeploy/archive/value_archive.h"
#include "mmdeploy/codebase/mmocr/mmocr.h"
#include "mmdeploy/core/device.h"
#include "mmdeploy/core/mat.h"
#include "mmdeploy/core/model.h"
#include "mmdeploy/core/status_code.h"
#include "mmdeploy/core/utils/formatter.h"
#include "mmdeploy/core/value.h"

using namespace mmdeploy;

Expand Down
2 changes: 1 addition & 1 deletion csrc/mmdeploy/apis/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set(MMDEPLOY_PYTHON_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/common.cpp)
set(CMAKE_CXX_STANDARD 17)

if (${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME})
add_subdirectory(${CMAKE_SOURCE_DIR}/../../../third_party/pybind11
add_subdirectory(${CMAKE_SOURCE_DIR}/../../../../third_party/pybind11
${CMAKE_CURRENT_BINARY_DIR}/pybind11)
find_package(MMDeploy REQUIRED)
elseif (NOT TARGET pybind11)
Expand Down
2 changes: 1 addition & 1 deletion csrc/mmdeploy/apis/python/classifier.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) OpenMMLab. All rights reserved.

#include "classifier.h"
#include "mmdeploy/apis/c/classifier.h"

#include "common.h"

Expand Down
2 changes: 1 addition & 1 deletion csrc/mmdeploy/apis/python/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <stdexcept>

#include "c/common.h"
#include "mmdeploy/apis/c/common.h"
#include "pybind11/numpy.h"
#include "pybind11/pybind11.h"
#include "pybind11/stl.h"
Expand Down
2 changes: 1 addition & 1 deletion csrc/mmdeploy/apis/python/detector.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) OpenMMLab. All rights reserved.

#include "detector.h"
#include "mmdeploy/apis/c/detector.h"

#include "common.h"

Expand Down
Loading

0 comments on commit 8cd62d5

Please sign in to comment.