This commit is contained in:
jario 2024-01-01 11:44:48 +08:00
parent 7a5012bd31
commit 4e7762631d
3 changed files with 20 additions and 15 deletions

View File

@ -8,8 +8,6 @@ add_definitions(-DAPI_EXPORTS)
set(CMAKE_BUILD_TYPE "Release") set(CMAKE_BUILD_TYPE "Release")
## JETSON, X86_CUDA, X86_INTEL ## JETSON, X86_CUDA, X86_INTEL
message(STATUS "System:${CMAKE_HOST_SYSTEM_PROCESSOR}") message(STATUS "System:${CMAKE_HOST_SYSTEM_PROCESSOR}")
if(NOT DEFINED PLATFORM) if(NOT DEFINED PLATFORM)
@ -195,13 +193,6 @@ if(USE_CUDA)
list(APPEND spirecv_SRCS ${ALG_SRC_FILES}) list(APPEND spirecv_SRCS ${ALG_SRC_FILES})
file(GLOB ALG_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/algorithm/veri/cuda/*.cpp) file(GLOB ALG_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/algorithm/veri/cuda/*.cpp)
list(APPEND spirecv_SRCS ${ALG_SRC_FILES}) 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() endif()
if(USE_INTEL) if(USE_INTEL)
@ -214,6 +205,13 @@ if(USE_INTEL)
endif() endif()
if(USE_FFMPEG) 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) file(GLOB ALG_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/video_io/ffmpeg/*.cpp)
list(APPEND spirecv_SRCS ${ALG_SRC_FILES}) list(APPEND spirecv_SRCS ${ALG_SRC_FILES})
endif() endif()

View File

@ -221,7 +221,9 @@ namespace sv
#endif #endif
} }
void CommonObjectDetectorIntelImpl::postprocess_img_seg(cv::Mat &img_, std::vector<float> &paddings, std::vector<float> &boxes_x_, void CommonObjectDetectorIntelImpl::postprocess_img_seg(cv::Mat &img_,
std::vector<float> &paddings,
std::vector<float> &boxes_x_,
std::vector<float> &boxes_y_, std::vector<float> &boxes_y_,
std::vector<float> &boxes_w_, std::vector<float> &boxes_w_,
std::vector<float> &boxes_h_, std::vector<float> &boxes_h_,
@ -444,4 +446,4 @@ namespace sv
#endif #endif
} }
} }

View File

@ -51,14 +51,21 @@ namespace sv
bool input_4k_); bool input_4k_);
void preprocess_img(cv::Mat &img_); void preprocess_img(cv::Mat &img_);
void preprocess_img_seg(cv::Mat &img_, std::vector<float> &paddings); void preprocess_img_seg(cv::Mat &img_, std::vector<float> &paddings);
void postprocess_img_seg(cv::Mat &img_, std::vector<float> &paddings, std::vector<float> &boxes_x_, std::vector<float> &boxes_y_, std::vector<float> &boxes_w_, std::vector<float> &boxes_h_, void postprocess_img_seg(cv::Mat &img_,
std::vector<float> &paddings,
std::vector<float> &boxes_x_,
std::vector<float> &boxes_y_,
std::vector<float> &boxes_w_,
std::vector<float> &boxes_h_,
std::vector<int> &boxes_label_, std::vector<int> &boxes_label_,
std::vector<float> &boxes_score_, std::vector<float> &boxes_score_,
std::vector<cv::Mat> &boxes_seg_, std::vector<cv::Mat> &boxes_seg_,
double &thrs_conf, double &thrs_conf,
double &thrs_nms); double &thrs_nms);
void postprocess_img(std::vector<float> &boxes_x_, std::vector<float> &boxes_y_, std::vector<float> &boxes_w_, void postprocess_img(std::vector<float> &boxes_x_,
std::vector<float> &boxes_y_,
std::vector<float> &boxes_w_,
std::vector<float> &boxes_h_, std::vector<float> &boxes_h_,
std::vector<int> &boxes_label_, std::vector<int> &boxes_label_,
std::vector<float> &boxes_score_, std::vector<float> &boxes_score_,
@ -66,7 +73,6 @@ namespace sv
double &thrs_nms); double &thrs_nms);
#ifdef WITH_INTEL #ifdef WITH_INTEL
int inpWidth; int inpWidth;
int inpHeight; int inpHeight;
bool with_segmentation; bool with_segmentation;
@ -76,7 +82,6 @@ namespace sv
ov::Tensor input_tensor; ov::Tensor input_tensor;
ov::InferRequest infer_request; ov::InferRequest infer_request;
ov::CompiledModel compiled_model; ov::CompiledModel compiled_model;
#endif #endif
}; };