MCPcopy Create free account
hub / github.com/davisking/dlib / make_random_tracking_data_for_training

Function make_random_tracking_data_for_training

dlib/test/learning_to_track.cpp:131–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129
130 template <typename detection>
131 std::vector<std::vector<labeled_detection<detection> > > make_random_tracking_data_for_training()
132 {
133 typedef std::vector<labeled_detection<detection> > detections_at_single_time_step;
134 typedef std::vector<detections_at_single_time_step> track_history;
135
136 track_history data;
137
138 // At each time step we get a set of detections from the objects in the world.
139 // Simulate 100 time steps worth of data where there are 3 objects present.
140 const int num_time_steps = 100;
141 for (int i = 0; i < num_time_steps; ++i)
142 {
143 detections_at_single_time_step dets(3);
144 // sample a detection from object 0
145 dets[0].det = sample_detection_from_sensor<detection>(0);
146 dets[0].label = 0;
147
148 // sample a detection from object 1
149 dets[1].det = sample_detection_from_sensor<detection>(1);
150 dets[1].label = 1;
151
152 // sample a detection from object 2
153 dets[2].det = sample_detection_from_sensor<detection>(2);
154 dets[2].label = 2;
155
156 randomize_samples(dets, rnd);
157 data.push_back(dets);
158 }
159
160 // Now let's imagine object 1 and 2 are gone but a new object, object 3 has arrived.
161 for (int i = 0; i < num_time_steps; ++i)
162 {
163 detections_at_single_time_step dets(2);
164 // sample a detection from object 0
165 dets[0].det = sample_detection_from_sensor<detection>(0);
166 dets[0].label = 0;
167
168 // sample a detection from object 3
169 dets[1].det = sample_detection_from_sensor<detection>(3);
170 dets[1].label = 3;
171
172 randomize_samples(dets, rnd);
173 data.push_back(dets);
174 }
175
176 return data;
177 }
178
179// ----------------------------------------------------------------------------------------
180

Callers

nothing calls this directly

Calls 2

randomize_samplesFunction · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected