forked from Smorodov/Multitarget-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathYoloDarknetDetector.h
More file actions
34 lines (26 loc) · 865 Bytes
/
YoloDarknetDetector.h
File metadata and controls
34 lines (26 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once
#include "BaseDetector.h"
#define OPENCV
#include "darknet/include/yolo_v2_class.hpp"
#undef OPENCV
// You only look once (YOLO)-Detector (https://arxiv.org/abs/1612.08242) to detect objects
// Models can be downloaded here: https://pjreddie.com/darknet/yolo/
// Default network is 416x416
// Class names can be downloaded here: https://github.com/pjreddie/darknet/tree/master/data
///
/// \brief The YoloDarknetDetector class
///
class YoloDarknetDetector : public BaseDetector
{
public:
YoloDarknetDetector(cv::UMat& colorFrame);
~YoloDarknetDetector(void);
bool Init(const config_t& config);
void Detect(cv::UMat& colorFrame);
private:
std::unique_ptr<Detector> m_detector;
float m_confidenceThreshold = 0.5f;
float m_maxCropRatio = 3.0f;
std::vector<std::string> m_classNames;
std::set<std::string> m_classesWhiteList;
};