Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ev-1.x

Cherry pick PR 1663, 1666, 1486 to dev-1.x
  • Loading branch information
lvhan028 authored Jan 31, 2023
2 parents dc1d9df + 7d96969 commit 3bf1336
Show file tree
Hide file tree
Showing 67 changed files with 2,917 additions and 1,265 deletions.
4 changes: 4 additions & 0 deletions csrc/mmdeploy/apis/c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ macro(add_object name)
target_compile_options(${name} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-fvisibility=hidden>)
endif ()
target_link_libraries(${name} PRIVATE mmdeploy::core)
target_include_directories(${name} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>)
set(CAPI_OBJS ${CAPI_OBJS} ${name})
mmdeploy_export(${name})
endmacro()
Expand All @@ -31,6 +34,7 @@ foreach (TASK ${COMMON_LIST})
mmdeploy_add_library(${TARGET_NAME})
target_link_libraries(${TARGET_NAME} PRIVATE ${OBJECT_NAME})
target_include_directories(${TARGET_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mmdeploy/${TASK}.h
DESTINATION include/mmdeploy)
Expand Down
8 changes: 4 additions & 4 deletions csrc/mmdeploy/apis/c/mmdeploy/classifier.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Copyright (c) OpenMMLab. All rights reserved.

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

#include <numeric>

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

using namespace mmdeploy;
using namespace std;
Expand Down
6 changes: 3 additions & 3 deletions csrc/mmdeploy/apis/c/mmdeploy/classifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#ifndef MMDEPLOY_CLASSIFIER_H
#define MMDEPLOY_CLASSIFIER_H

#include "common.h"
#include "executor.h"
#include "model.h"
#include "mmdeploy/common.h"
#include "mmdeploy/executor.h"
#include "mmdeploy/model.h"

#ifdef __cplusplus
extern "C" {
Expand Down
6 changes: 3 additions & 3 deletions csrc/mmdeploy/apis/c/mmdeploy/common.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "common.h"
#include "mmdeploy/common.h"

#include "common_internal.h"
#include "executor_internal.h"
#include "mmdeploy/common_internal.h"
#include "mmdeploy/core/mat.h"
#include "mmdeploy/core/profiler.h"
#include "mmdeploy/executor_internal.h"

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

#include "common.h"
#include "handle.h"
#include "mmdeploy/common.h"
#include "mmdeploy/core/mat.h"
#include "mmdeploy/core/value.h"
#include "model.h"
#include "pipeline.h"
#include "mmdeploy/handle.h"
#include "mmdeploy/model.h"
#include "mmdeploy/pipeline.h"

using namespace mmdeploy;

Expand Down
2 changes: 1 addition & 1 deletion csrc/mmdeploy/apis/c/mmdeploy/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/detector.h"

#include <deque>
#include <numeric>
Expand Down
6 changes: 3 additions & 3 deletions csrc/mmdeploy/apis/c/mmdeploy/detector.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#ifndef MMDEPLOY_DETECTOR_H
#define MMDEPLOY_DETECTOR_H

#include "common.h"
#include "executor.h"
#include "model.h"
#include "mmdeploy/common.h"
#include "mmdeploy/executor.h"
#include "mmdeploy/model.h"

#ifdef __cplusplus
extern "C" {
Expand Down
8 changes: 4 additions & 4 deletions csrc/mmdeploy/apis/c/mmdeploy/executor.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright (c) OpenMMLab. All rights reserved.

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

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

using namespace mmdeploy;

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

#include "common.h"
#include "mmdeploy/common.h"

#if __cplusplus
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion csrc/mmdeploy/apis/c/mmdeploy/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 "executor.h"
#include "mmdeploy/execution/schedulers/registry.h"
#include "mmdeploy/executor.h"

using namespace mmdeploy;

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

// clang-format off
#include "model.h"
#include "mmdeploy/model.h"

#include <memory>

#include "common_internal.h"
#include "mmdeploy/common_internal.h"
#include "mmdeploy/core/logger.h"
#include "mmdeploy/core/model.h"
// clang-format on
Expand Down
2 changes: 1 addition & 1 deletion csrc/mmdeploy/apis/c/mmdeploy/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#ifndef MMDEPLOY_SRC_APIS_C_MODEL_H_
#define MMDEPLOY_SRC_APIS_C_MODEL_H_

#include "common.h"
#include "mmdeploy/common.h"

#ifdef __cplusplus
extern "C" {
Expand Down
8 changes: 4 additions & 4 deletions csrc/mmdeploy/apis/c/mmdeploy/pipeline.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright (c) OpenMMLab. All rights reserved.

#include "pipeline.h"
#include "mmdeploy/pipeline.h"

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

int mmdeploy_pipeline_create_v3(mmdeploy_value_t config, mmdeploy_context_t context,
mmdeploy_pipeline_t* pipeline) {
Expand Down
4 changes: 2 additions & 2 deletions csrc/mmdeploy/apis/c/mmdeploy/pipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#ifndef MMDEPLOY_CSRC_APIS_C_PIPELINE_H_
#define MMDEPLOY_CSRC_APIS_C_PIPELINE_H_

#include "common.h"
#include "executor.h"
#include "mmdeploy/common.h"
#include "mmdeploy/executor.h"

#ifdef __cplusplus
extern "C" {
Expand Down
10 changes: 5 additions & 5 deletions csrc/mmdeploy/apis/c/mmdeploy/pose_detector.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Copyright (c) OpenMMLab. All rights reserved.

#include "pose_detector.h"
#include "mmdeploy/pose_detector.h"

#include <numeric>

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

using namespace std;
using namespace mmdeploy;
Expand Down Expand Up @@ -117,7 +117,7 @@ int mmdeploy_pose_detector_create_input(const mmdeploy_mat_t* mats, int mat_coun
} else {
b = {0, 0, img.width(), img.height(), 1.0};
}
input_images.push_back({{"ori_img", img}, {"bbox", std::move(b)}, {"rotation", 0.f}});
input_images.push_back({{"ori_img", img}, {"bbox", std::move(b)}});
};

for (int i = 0; i < mat_count; ++i) {
Expand Down
6 changes: 3 additions & 3 deletions csrc/mmdeploy/apis/c/mmdeploy/pose_detector.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#ifndef MMDEPLOY_SRC_APIS_C_POSE_DETECTOR_H_
#define MMDEPLOY_SRC_APIS_C_POSE_DETECTOR_H_

#include "common.h"
#include "executor.h"
#include "model.h"
#include "mmdeploy/common.h"
#include "mmdeploy/executor.h"
#include "mmdeploy/model.h"

#ifdef __cplusplus
extern "C" {
Expand Down
Loading

0 comments on commit 3bf1336

Please sign in to comment.