From 296dd5e54b54f6d58db104a5b919d1eeebabf87a Mon Sep 17 00:00:00 2001 From: ZHEQIUSHUI <46700201+ZHEQIUSHUI@users.noreply.github.com> Date: Wed, 29 Nov 2023 15:15:52 +0800 Subject: [PATCH] fix cmake bug,support rtmpose more keypoint (#112) --- examples/CMakeLists.txt | 21 +++++++++++++++++---- examples/ax620/CMakeLists.txt | 1 + examples/ax650/ax_simcc_pose_steps.cc | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 681ff1a..87a9d4c 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -18,19 +18,32 @@ if(NOT BSP_MSP_DIR) set(BSP_MSP_DIR ${CMAKE_SOURCE_DIR}/out) endif() + message(STATUS "BSP_MSP_DIR = ${BSP_MSP_DIR}") if(AXERA_TARGET_CHIP MATCHES "ax650") - set(OpenCV_DIR ${CMAKE_SOURCE_DIR}/3rdparty/opencv-aarch64-linux/lib/cmake/opencv4) + if(NOT OpenCV_DIR) + set(OpenCV_DIR ${CMAKE_SOURCE_DIR}/3rdparty/opencv-aarch64-linux/lib/cmake/opencv4) + endif() + add_definitions(-DAXERA_TARGET_CHIP_AX650) elseif(AXERA_TARGET_CHIP MATCHES "ax620e") - set(OpenCV_DIR ${CMAKE_SOURCE_DIR}/3rdparty/opencv-aarch64-linux/lib/cmake/opencv4) + if(NOT OpenCV_DIR) + set(OpenCV_DIR ${CMAKE_SOURCE_DIR}/3rdparty/opencv-aarch64-linux/lib/cmake/opencv4) + endif() + add_definitions(-DAXERA_TARGET_CHIP_AX620E) elseif(AXERA_TARGET_CHIP MATCHES "ax620a") - set(OpenCV_DIR ${CMAKE_SOURCE_DIR}/3rdparty/opencv-arm-linux/lib/cmake/opencv4) + if(NOT OpenCV_DIR) + set(OpenCV_DIR ${CMAKE_SOURCE_DIR}/3rdparty/opencv-arm-linux/lib/cmake/opencv4) + endif() + add_definitions(-DAXERA_TARGET_CHIP_AX620) elseif(AXERA_TARGET_CHIP MATCHES "ax630a") - set(OpenCV_DIR ${CMAKE_SOURCE_DIR}/3rdparty/opencv-aarch64-linux/lib/cmake/opencv4) + if(NOT OpenCV_DIR) + set(OpenCV_DIR ${CMAKE_SOURCE_DIR}/3rdparty/opencv-aarch64-linux/lib/cmake/opencv4) + endif() + add_definitions(-DAXERA_TARGET_CHIP_AX630) endif() diff --git a/examples/ax620/CMakeLists.txt b/examples/ax620/CMakeLists.txt index 7386522..416acc4 100644 --- a/examples/ax620/CMakeLists.txt +++ b/examples/ax620/CMakeLists.txt @@ -103,6 +103,7 @@ if(AXERA_TARGET_CHIP MATCHES "ax620a") # ax620 support axera_example(ax_yolov6s ax_yolov6s_steps.cc) axera_example(ax_yolov8s ax_yolov8s_steps.cc) axera_example(ax_yolov8s_seg ax_yolov8s_seg_steps.cc) + axera_example(ax_yolov8s_pose ax_yolov8s_pose_steps.cc) # ******************************** MMYOLO model ********************************# # axera_example (ax_mmyolov5s mmyolo/ax_mmyolov5s.cc) diff --git a/examples/ax650/ax_simcc_pose_steps.cc b/examples/ax650/ax_simcc_pose_steps.cc index 23ceb95..2760e21 100644 --- a/examples/ax650/ax_simcc_pose_steps.cc +++ b/examples/ax650/ax_simcc_pose_steps.cc @@ -98,7 +98,7 @@ namespace ax *min_max_time.second, *min_max_time.first); fprintf(stdout, "--------------------------------------\n"); - pose::draw_result(mat, ai_point_result, NUM_JOINTS, INPUT_W, INPUT_H); + pose::draw_result(mat, ai_point_result, ai_point_result.keypoints.size(), INPUT_W, INPUT_H); cv::imwrite("./simcc_out.jpg", mat); }