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
31 this->detectedRectanglesColor = detectedRectanglesColor;
40 this->tilingEnabled = tilingEnabled;
45 this->minConfidenceThreshold = minConfidenceThreshold;
53 this->cropImage = cropImage;
60 float minConfidenceThreshold = 0.7;
61 bool cropImage =
false;
64 const double SCALE_FACTOR = 1 / 255.0;
66 int netInputWidth = 0;
67 int netInputHeight = 0;
71 bool tilingEnabled =
false;
72 const bool drawPredictionOnImage;
73 const map<DetectableObjectClassId, const DetectableObjectClass> detectedObjectClasses;
75 cv::Scalar detectedRectanglesColor = cv::Scalar(255, 178, 50);
77 std::unique_ptr<CscLogger> logger;
79 void readNetInputSizeFromCfg(fs::path cfgFilePath);
81 const fs::path modelConfigurationPath;
82 const fs::path modelWeightsPath;
99 Tile(
const Mat & image,
const cv::Point & offset,
const cv::Point & position): image(image), offset(offset), position(position) {
104 cv::Point & getOffset() {
107 cv::Point & getPosition() {
115 class TileResultsCollector {
117 vector<DetectableObjectClassId> classIds;
118 vector<float> confidences;
119 vector<cv::Rect> rectangles;
122 void processTile(
ptr<Tile> tile, TileResultsCollector & resultsCollector);
124 vector<ptr<Tile>> splitInTiles(
const Mat &image);