1 #ifndef CscDetectorEngineYoloV4_h
2 #define CscDetectorEngineYoloV4_h
23 map<DetectableObjectClassId, const DetectableObjectClass> detectedObjectClasses,
const fs::path modelConfigurationPath,
const fs::path modelWeightsPath,
bool drawPredictionOnImage,
const string &name);
29 this->detectedRectanglesColor = detectedRectanglesColor;
38 this->tilingEnabled = tilingEnabled;
43 this->minConfidenceThreshold = minConfidenceThreshold;
51 this->cropImage = cropImage;
58 float minConfidenceThreshold = 0.7;
59 bool cropImage =
false;
62 const double SCALE_FACTOR = 1 / 255.0;
64 int netInputWidth = 0;
65 int netInputHeight = 0;
69 bool tilingEnabled =
false;
70 const bool drawPredictionOnImage;
71 const map<DetectableObjectClassId, const DetectableObjectClass> detectedObjectClasses;
73 cv::Scalar detectedRectanglesColor = cv::Scalar(255, 178, 50);
75 std::unique_ptr<CscLogger> logger;
77 void readNetInputSizeFromCfg(fs::path cfgFilePath);
79 const fs::path modelConfigurationPath;
80 const fs::path modelWeightsPath;
97 Tile(
const Mat &image,
const cv::Point &offset,
const cv::Point &position);
102 cv::Point &getOffset() {
105 cv::Point &getPosition() {
113 class TileResultsCollector {
115 vector<DetectableObjectClassId> classIds;
116 vector<float> confidences;
117 vector<cv::Rect> rectangles;
120 void processTile(
ptr<Tile> tile, TileResultsCollector &resultsCollector);
122 vector<ptr<Tile>> splitInTiles(
const Mat &image);