-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.cpp
More file actions
125 lines (93 loc) · 3.36 KB
/
config.cpp
File metadata and controls
125 lines (93 loc) · 3.36 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#include "config.hpp"
Config::Config()
{
////////////////////////////////////////
////////////////////////////////////////
// LABELS AND COLORS SETTINGS //
////////////////////////////////////////
////////////////////////////////////////
// Text colors for labels
labelColor = cv::Scalar(250, 250, 250);
// Font size of labels
fontSize = 0.64;
// Label font
font = cv::FONT_HERSHEY_SIMPLEX;
// Box Thickness
boxThickness = 2;
// Label Thickness
labelThickness = 2;
////////////////////////////////////////
////////////////////////////////////////
// CAMERA SETTINGS //
////////////////////////////////////////
////////////////////////////////////////
// NOTE: COMMENT THESE AND CORRESPONDING LINES IN MAIN IF YOU'RE GONNA .....
// ..... IMPLEMENT THE CODE ON RASPBERRY PI (OR IT WILL MESS UP CAMERA OUTPUT)
// Output window width
outputWindowWidth = 1000;
// Output window height
outputWindowHeight = 600;
// True if getting video from file
captureFromVideo = false;
// True if getting video from file
videoAddress = "";
// True if getting video from camera
captureFromCamera = true;
// Camera device (default for webcam is 0)
cameraDevice = 0;
////////////////////////////////////////
////////////////////////////////////////
// ALGORITHMS SETTINGS //
////////////////////////////////////////
////////////////////////////////////////
// Model configuration address
modelConfiguration = "models/ssd_mobilenet_v3/model_configurations.pbtxt";
// Model weights address
modelWeights = "models/ssd_mobilenet_v3/frozen_graph.pb";
// Model input address
modelSize = 320;
// Specifies after how many frame processing iterations you want to call the model for prediction
detectionRate = 50;
////////////////////////////////////////
////////////////////////////////////////
// ADJUSTABLE THRESHOLDS //
////////////////////////////////////////
////////////////////////////////////////
// Controls the confidence threshold of the prediction model
confidenceThreshold = 0.5;
// Controls the tracker re-identification mechanism
intersectionThreshold = 0.5;
// Controls the tracker merging mechanism
trackerMergeThreshold = 0.7;
////////////////////////////////////////
////////////////////////////////////////
// DETECTION CLASSES SETTINGS //
////////////////////////////////////////
////////////////////////////////////////
// NOTE: DONT CHANGE INDEX-CLASS CORRESPONDANCES OR YOULL PREDICT CAT FOR AN AIRPLANE
// Person class detection index and color
classes.push_back("person");
indices.push_back(1);
colors.push_back(cv::Scalar(0, 211, 255));
// Bicycle class detection index and color
classes.push_back("bicycle");
indices.push_back(2);
colors.push_back(cv::Scalar(255, 0, 255));
// Car class detection index and color
classes.push_back("car");
indices.push_back(3);
colors.push_back(cv::Scalar(0, 0, 255));
// Motorcycle class detection index and color
classes.push_back("motorcycle");
indices.push_back(4);
colors.push_back(cv::Scalar(255, 0, 255));
// Bus class detection index and color
classes.push_back("bus");
indices.push_back(6);
colors.push_back(cv::Scalar(255, 211, 0));
// Truck class detection index and color
classes.push_back("truck");
indices.push_back(8);
colors.push_back(cv::Scalar(0, 0, 255));
// NOTE: YOU CAN ADD OTHER CLASSES OF COCO DATASET (UP TO 80 CLASSES)
}