1 parent
9aec3fbd78
commit
5483837769
16 files changed
+121
-1949
No files matched your search
+7
-15
@@ -105,12 +105,12 @@ int main(int argc, char* argv[]) {
|
||||
g_config.imgsz, g_config.conf, 0.45f,
|
||||
g_config.num_classes, 0, g_config.score_sigmoid);
|
||||
|
||||
ByteTracker ayam_tracker(g_config.track_high_thresh_0, g_config.track_low_thresh_0,
|
||||
g_config.track_match_thresh_0, g_config.track_buffer_0,
|
||||
g_config.track_min_hits_0);
|
||||
ByteTracker talenan_tracker(g_config.track_high_thresh_1, g_config.track_low_thresh_1,
|
||||
g_config.track_match_thresh_1, g_config.track_buffer_1,
|
||||
g_config.track_min_hits_1);
|
||||
ByteTracker ayam_tracker(g_config.track_high_thresh, g_config.track_low_thresh,
|
||||
g_config.track_match_thresh, g_config.track_buffer,
|
||||
g_config.track_min_hits);
|
||||
ByteTracker talenan_tracker(g_config.track_high_thresh, g_config.track_low_thresh,
|
||||
g_config.track_match_thresh, g_config.track_buffer,
|
||||
g_config.track_min_hits);
|
||||
|
||||
std::unordered_set<int> ayam_line_crossed;
|
||||
std::unordered_set<int> talenan_line_crossed;
|
||||
@@ -122,7 +122,6 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
auto session_start = std::chrono::steady_clock::now();
|
||||
int frame_idx = 0;
|
||||
std::deque<std::chrono::steady_clock::time_point> crossing_times;
|
||||
|
||||
cv::VideoCapture cap = open_capture(g_config.source);
|
||||
bool is_live = g_config.source.substr(0, 7) == "rtsp://" ||
|
||||
@@ -318,7 +317,6 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
ayam_crossed_frame = true;
|
||||
if (started_new) batch_started_frame = true;
|
||||
crossing_times.push_back(mono);
|
||||
ayam_cross_flash[tid] = g_config.cross_flash_frames;
|
||||
popups.push_back({
|
||||
static_cast<int>(cx) - 12,
|
||||
@@ -382,13 +380,7 @@ int main(int argc, char* argv[]) {
|
||||
int batch_count = store.current_batch_count();
|
||||
int display_total = store.display_total();
|
||||
double elapsed = static_cast<double>(elapsed_sec);
|
||||
while (!crossing_times.empty() &&
|
||||
std::chrono::duration_cast<std::chrono::seconds>(
|
||||
mono - crossing_times.front()).count() > g_config.rate_window_sec) {
|
||||
crossing_times.pop_front();
|
||||
}
|
||||
double rate = crossing_times.empty() ? 0.0
|
||||
: (static_cast<double>(crossing_times.size()) / g_config.rate_window_sec * 60.0);
|
||||
double rate = elapsed > 0 ? (display_total / elapsed * 60.0) : 0.0;
|
||||
|
||||
draw_elegant_counting_line(frame, line_x, h, line_pulse);
|
||||
draw_hero_count(frame, line_x, h, batch_count, count_pulse);
|
||||
|
||||
Reference in new issue
Block a user