forked from Smorodov/Multitarget-tracker
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSSDMobileNetDetector.h
More file actions
44 lines (33 loc) · 1.05 KB
/
SSDMobileNetDetector.h
File metadata and controls
44 lines (33 loc) · 1.05 KB
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
35
36
37
38
39
40
41
42
43
44
#pragma once
#include "BaseDetector.h"
#include <opencv2/dnn.hpp>
#include <opencv2/dnn/shape_utils.hpp>
// MobileNet Single-Shot Detector (https://arxiv.org/abs/1704.04861) to detect objects
// .caffemodel model's file is available here: https://github.com/chuanqi305/MobileNet-SSD
// Default network is 300x300 and 20-classes VOC
///
/// \brief The SSDMobileNetDetector class
///
class SSDMobileNetDetector : public BaseDetector
{
public:
SSDMobileNetDetector(cv::UMat& colorFrame);
~SSDMobileNetDetector(void);
bool Init(const config_t& config);
void Detect(cv::UMat& colorFrame);
bool CanGrayProcessing() const
{
return false;
}
private:
cv::dnn::Net m_net;
void DetectInCrop(cv::Mat colorFrame, const cv::Rect& crop, regions_t& tmpRegions);
static const int InWidth = 300;
static const int InHeight = 300;
float m_WHRatio = 1.f;
float m_inScaleFactor = 0.007843f;
float m_meanVal = 127.5;
float m_confidenceThreshold = 0.5f;
float m_maxCropRatio = 2.0f;
std::vector<std::string> m_classNames;
};