From 4e7762631d8e97cddd9ef84186976579f84696b1 Mon Sep 17 00:00:00 2001 From: jario Date: Mon, 1 Jan 2024 11:44:48 +0800 Subject: [PATCH] fix bugs --- CMakeLists.txt | 16 +++++++--------- .../common_det/intel/common_det_intel_impl.cpp | 6 ++++-- .../common_det/intel/common_det_intel_impl.h | 13 +++++++++---- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 133163a..fb7114b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,8 +8,6 @@ add_definitions(-DAPI_EXPORTS) set(CMAKE_BUILD_TYPE "Release") - - ## JETSON, X86_CUDA, X86_INTEL message(STATUS "System:${CMAKE_HOST_SYSTEM_PROCESSOR}") if(NOT DEFINED PLATFORM) @@ -195,13 +193,6 @@ if(USE_CUDA) list(APPEND spirecv_SRCS ${ALG_SRC_FILES}) file(GLOB ALG_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/algorithm/veri/cuda/*.cpp) list(APPEND spirecv_SRCS ${ALG_SRC_FILES}) - file(GLOB ALG_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/video_io/ffmpeg/x86_cuda/*.cpp) - list(APPEND spirecv_SRCS ${ALG_SRC_FILES}) -endif() - -if(USE_INTEL) - file(GLOB ALG_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/video_io/ffmpeg/x86_intel/*.cpp) - list(APPEND spirecv_SRCS ${ALG_SRC_FILES}) endif() if(USE_INTEL) @@ -214,6 +205,13 @@ if(USE_INTEL) endif() if(USE_FFMPEG) + if(USE_INTEL) + file(GLOB ALG_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/video_io/ffmpeg/x86_intel/*.cpp) + list(APPEND spirecv_SRCS ${ALG_SRC_FILES}) + elseif(USE_CUDA) + file(GLOB ALG_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/video_io/ffmpeg/x86_cuda/*.cpp) + list(APPEND spirecv_SRCS ${ALG_SRC_FILES}) + endif() file(GLOB ALG_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/video_io/ffmpeg/*.cpp) list(APPEND spirecv_SRCS ${ALG_SRC_FILES}) endif() diff --git a/algorithm/common_det/intel/common_det_intel_impl.cpp b/algorithm/common_det/intel/common_det_intel_impl.cpp index ee8cd28..c61c507 100644 --- a/algorithm/common_det/intel/common_det_intel_impl.cpp +++ b/algorithm/common_det/intel/common_det_intel_impl.cpp @@ -221,7 +221,9 @@ namespace sv #endif } - void CommonObjectDetectorIntelImpl::postprocess_img_seg(cv::Mat &img_, std::vector &paddings, std::vector &boxes_x_, + void CommonObjectDetectorIntelImpl::postprocess_img_seg(cv::Mat &img_, + std::vector &paddings, + std::vector &boxes_x_, std::vector &boxes_y_, std::vector &boxes_w_, std::vector &boxes_h_, @@ -444,4 +446,4 @@ namespace sv #endif } -} \ No newline at end of file +} diff --git a/algorithm/common_det/intel/common_det_intel_impl.h b/algorithm/common_det/intel/common_det_intel_impl.h index ad4ac38..8c99a12 100644 --- a/algorithm/common_det/intel/common_det_intel_impl.h +++ b/algorithm/common_det/intel/common_det_intel_impl.h @@ -51,14 +51,21 @@ namespace sv bool input_4k_); void preprocess_img(cv::Mat &img_); void preprocess_img_seg(cv::Mat &img_, std::vector &paddings); - void postprocess_img_seg(cv::Mat &img_, std::vector &paddings, std::vector &boxes_x_, std::vector &boxes_y_, std::vector &boxes_w_, std::vector &boxes_h_, + void postprocess_img_seg(cv::Mat &img_, + std::vector &paddings, + std::vector &boxes_x_, + std::vector &boxes_y_, + std::vector &boxes_w_, + std::vector &boxes_h_, std::vector &boxes_label_, std::vector &boxes_score_, std::vector &boxes_seg_, double &thrs_conf, double &thrs_nms); - void postprocess_img(std::vector &boxes_x_, std::vector &boxes_y_, std::vector &boxes_w_, + void postprocess_img(std::vector &boxes_x_, + std::vector &boxes_y_, + std::vector &boxes_w_, std::vector &boxes_h_, std::vector &boxes_label_, std::vector &boxes_score_, @@ -66,7 +73,6 @@ namespace sv double &thrs_nms); #ifdef WITH_INTEL - int inpWidth; int inpHeight; bool with_segmentation; @@ -76,7 +82,6 @@ namespace sv ov::Tensor input_tensor; ov::InferRequest infer_request; ov::CompiledModel compiled_model; - #endif };