Skip to content

Commit 43b6d4f

Browse files
baiyfqingqing01
authored andcommitted
put detection op together (#10595)
1 parent 2924c92 commit 43b6d4f

17 files changed

+42
-8
lines changed

paddle/fluid/operators/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,11 @@ foreach(src ${READER_LIBRARY})
270270
set(OP_LIBRARY ${src} ${OP_LIBRARY})
271271
endforeach()
272272

273+
add_subdirectory(detection)
274+
foreach(src ${DETECTION_LIBRARY})
275+
set(OP_LIBRARY ${src} ${OP_LIBRARY})
276+
endforeach()
277+
273278
set(GLOB_OP_LIB ${OP_LIBRARY} CACHE INTERNAL "Global OP library")
274279

275280
cc_test(gather_test SRCS gather_test.cc DEPS tensor)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
set(LOCAL_DETECTION_LIBS)
2+
3+
function(detection_library TARGET_NAME)
4+
set(oneValueArgs "")
5+
set(multiValueArgs SRCS DEPS)
6+
set(options "")
7+
set(common_deps op_registry)
8+
set(pybind_flag 0)
9+
cmake_parse_arguments(detection_library "${options}" "${oneValueArgs}"
10+
"${multiValueArgs}" ${ARGN})
11+
op_library(${TARGET_NAME} SRCS ${detection_library_SRCS} DEPS ${common_deps} ${detection_library_DEPS})
12+
set(LOCAL_DETECTION_LIBS
13+
${TARGET_NAME}
14+
${LOCAL_DETECTION_LIBS}
15+
PARENT_SCOPE)
16+
endfunction()
17+
18+
detection_library(bipartite_match_op SRCS bipartite_match_op.cc)
19+
detection_library(box_coder_op SRCS box_coder_op.cc box_coder_op.cu)
20+
detection_library(iou_similarity_op SRCS iou_similarity_op.cc
21+
iou_similarity_op.cu)
22+
detection_library(mine_hard_examples_op SRCS mine_hard_examples_op.cc)
23+
detection_library(multiclass_nms_op SRCS multiclass_nms_op.cc)
24+
detection_library(prior_box_op SRCS prior_box_op.cc prior_box_op.cu)
25+
detection_library(target_assign_op SRCS target_assign_op.cc
26+
target_assign_op.cu)
27+
28+
# Export local libraries to parent
29+
set(DETECTION_LIBRARY ${LOCAL_DETECTION_LIBS} PARENT_SCOPE)

paddle/fluid/operators/box_coder_op.cc renamed to paddle/fluid/operators/detection/box_coder_op.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
99
See the License for the specific language governing permissions and
1010
limitations under the License. */
1111

12-
#include "paddle/fluid/operators/box_coder_op.h"
12+
#include "paddle/fluid/operators/detection/box_coder_op.h"
1313

1414
namespace paddle {
1515
namespace operators {

paddle/fluid/operators/box_coder_op.cu renamed to paddle/fluid/operators/detection/box_coder_op.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
99
See the License for the specific language governing permissions and
1010
limitations under the License. */
1111

12-
#include "paddle/fluid/operators/box_coder_op.h"
12+
#include "paddle/fluid/operators/detection/box_coder_op.h"
1313
#include "paddle/fluid/platform/cuda_primitives.h"
1414

1515
namespace paddle {

paddle/fluid/operators/iou_similarity_op.cc renamed to paddle/fluid/operators/detection/iou_similarity_op.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License. */
1414

15-
#include "paddle/fluid/operators/iou_similarity_op.h"
15+
#include "paddle/fluid/operators/detection/iou_similarity_op.h"
1616

1717
namespace paddle {
1818
namespace operators {

paddle/fluid/operators/iou_similarity_op.cu renamed to paddle/fluid/operators/detection/iou_similarity_op.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License. */
1414

15-
#include "paddle/fluid/operators/iou_similarity_op.h"
15+
#include "paddle/fluid/operators/detection/iou_similarity_op.h"
1616

1717
namespace ops = paddle::operators;
1818
REGISTER_OP_CUDA_KERNEL(

0 commit comments

Comments
 (0)