diff --git a/algorithm/common_det/sv_common_det.cpp b/algorithm/common_det/sv_common_det.cpp index 73efa00..fb4e3ee 100644 --- a/algorithm/common_det/sv_common_det.cpp +++ b/algorithm/common_det/sv_common_det.cpp @@ -9,7 +9,7 @@ #endif #ifdef WITH_INTEL -#include +#include #include "common_det_intel_impl.h" #endif diff --git a/algorithm/sv_algorithm_base.cpp b/algorithm/sv_algorithm_base.cpp index 7bf4863..840e26e 100644 --- a/algorithm/sv_algorithm_base.cpp +++ b/algorithm/sv_algorithm_base.cpp @@ -1002,11 +1002,11 @@ void CommonObjectDetectorBase::detect(cv::Mat img_, TargetsInFrame& tgts_, Box* if (this->_with_segmentation) { cv::Mat mask_j = boxes_seg[j].clone(); - #ifdef WITH_INTEL +#ifdef WITH_INTEL tgt.setMask(mask_j); - #endif +#endif - #ifdef WITH_CUDA +#ifdef WITH_CUDA int maskh = mask_j.rows, maskw = mask_j.cols; assert(maskh == maskw); @@ -1036,7 +1036,7 @@ void CommonObjectDetectorBase::detect(cv::Mat img_, TargetsInFrame& tgts_, Box* { tgt.setMask(mask_j); } - #endif +#endif } tgts_.targets.push_back(tgt); diff --git a/include/sv_color_line.h b/include/sv_color_line.h index 3d2da94..5bdea64 100644 --- a/include/sv_color_line.h +++ b/include/sv_color_line.h @@ -25,7 +25,6 @@ public: double line_location_a2; bool is_load_parameter; - std::string line_color; protected: @@ -40,4 +39,4 @@ protected: void seg(cv::Mat line_area_, cv::Mat line_area_a1_, cv::Mat line_area_a2_, std::string line_color_, cv::Point ¢er_, int &area_, cv::Point ¢er_a1_, cv::Point ¢er_a2_); }; } -#endif \ No newline at end of file +#endif diff --git a/include/sv_common_det.h b/include/sv_common_det.h index f8511e9..9d3b4ef 100644 --- a/include/sv_common_det.h +++ b/include/sv_common_det.h @@ -10,42 +10,34 @@ namespace sv { -#ifdef WITH_CUDA - class CommonObjectDetectorCUDAImpl; -#endif -#ifdef WITH_INTEL - class CommonObjectDetectorIntelImpl; -#endif +class CommonObjectDetectorCUDAImpl; +class CommonObjectDetectorIntelImpl; - class CommonObjectDetector : public CommonObjectDetectorBase - { - public: - CommonObjectDetector(bool input_4k = false); - ~CommonObjectDetector(); - protected: - bool setupImpl(); - void detectImpl( - cv::Mat 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_, - std::vector &boxes_seg_); +class CommonObjectDetector : public CommonObjectDetectorBase +{ +public: + CommonObjectDetector(bool input_4k = false); + ~CommonObjectDetector(); -#ifdef WITH_CUDA - CommonObjectDetectorCUDAImpl *_cuda_impl; -#endif +protected: + bool setupImpl(); + void detectImpl( + cv::Mat 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_, + std::vector &boxes_seg_); -#ifdef WITH_INTEL - CommonObjectDetectorIntelImpl *_intel_impl; -#endif + CommonObjectDetectorCUDAImpl *_cuda_impl; + CommonObjectDetectorIntelImpl *_intel_impl; - bool _input_4k; - }; + bool _input_4k; +}; } #endif diff --git a/include/sv_landing_det.h b/include/sv_landing_det.h index 76cd385..6242986 100644 --- a/include/sv_landing_det.h +++ b/include/sv_landing_det.h @@ -10,13 +10,9 @@ namespace sv { -#ifdef WITH_CUDA - class LandingMarkerDetectorCUDAImpl; -#endif -#ifdef WITH_INTEL - class LandingMarkerDetectorIntelImpl; -#endif +class LandingMarkerDetectorCUDAImpl; +class LandingMarkerDetectorIntelImpl; class LandingMarkerDetector : public LandingMarkerDetectorBase { @@ -30,13 +26,8 @@ protected: std::vector& output_labels_ ); -#ifdef WITH_CUDA - LandingMarkerDetectorCUDAImpl *_cuda_impl; -#endif - -#ifdef WITH_INTEL - LandingMarkerDetectorIntelImpl *_intel_impl; -#endif + LandingMarkerDetectorCUDAImpl *_cuda_impl; + LandingMarkerDetectorIntelImpl *_intel_impl; }; diff --git a/include/sv_veri_det.h b/include/sv_veri_det.h index 13a05fa..9545bcd 100644 --- a/include/sv_veri_det.h +++ b/include/sv_veri_det.h @@ -10,44 +10,35 @@ namespace sv { -#ifdef WITH_CUDA - class VeriDetectorCUDAImpl; -#endif -#ifdef WITH_INTEL - class VeriDetectorIntelImpl; -#endif +class VeriDetectorCUDAImpl; +class VeriDetectorIntelImpl; - class VeriDetector : public LandingMarkerDetectorBase - { - public: - VeriDetector(); - ~VeriDetector(); +class VeriDetector : public LandingMarkerDetectorBase +{ +public: + VeriDetector(); + ~VeriDetector(); - void detect(cv::Mat img_, const cv::Rect &bounding_box_, sv::Target &tgt); + void detect(cv::Mat img_, const cv::Rect &bounding_box_, sv::Target &tgt); - protected: - void _load(); - bool setupImpl(); - void roiCNN( - std::vector &input_rois_, - std::vector &output_labels_); - void getSubwindow(cv::Mat &dstCrop, cv::Mat &srcImg, int originalSz, int resizeSz); +protected: + void _load(); + bool setupImpl(); + void roiCNN( + std::vector &input_rois_, + std::vector &output_labels_); + void getSubwindow(cv::Mat &dstCrop, cv::Mat &srcImg, int originalSz, int resizeSz); - std::string vehicle_id; + std::string vehicle_id; - // Save the target bounding box for each frame. - std::vector targetSz = {0, 0}; // H and W of bounding box - std::vector targetPos = {0, 0}; // center point of bounding box (x, y) + // Save the target bounding box for each frame. + std::vector targetSz = {0, 0}; // H and W of bounding box + std::vector targetPos = {0, 0}; // center point of bounding box (x, y) -#ifdef WITH_CUDA - VeriDetectorCUDAImpl *_cuda_impl; -#endif - -#ifdef WITH_INTEL - VeriDetectorIntelImpl *_intel_impl; -#endif - }; + VeriDetectorCUDAImpl *_cuda_impl; + VeriDetectorIntelImpl *_intel_impl; +}; } #endif