Level up with python version

This commit is contained in:
proitlab committed 2026-07-06 02:51:03 +07:00
1 parent fc172117cc
commit 9aec3fbd78
16 files changed
+1949 -121

No files matched your search

+36 -11
View File
@@ -74,18 +74,32 @@ void AppConfig::load_from_env(const char* env_path) {
auto ss_s = get_env("SCORE_SIGMOID");
score_sigmoid = (ss_s == "true");
auto th_s = get_env("TRACK_HIGH_THRESH");
if (!th_s.empty()) track_high_thresh = std::stof(th_s);
auto tl_s = get_env("TRACK_LOW_THRESH");
if (!tl_s.empty()) track_low_thresh = std::stof(tl_s);
auto tm_s = get_env("TRACK_MATCH_THRESH");
if (!tm_s.empty()) track_match_thresh = std::stof(tm_s);
auto tb_s = get_env("TRACK_BUFFER");
if (!tb_s.empty()) track_buffer = std::stoi(tb_s);
auto tmh_s = get_env("TRACK_MIN_HITS");
if (!tmh_s.empty()) track_min_hits = std::stoi(tmh_s);
auto th0_s = get_env("TRACK_HIGH_THRESH_0");
if (!th0_s.empty()) track_high_thresh_0 = std::stof(th0_s);
auto tl0_s = get_env("TRACK_LOW_THRESH_0");
if (!tl0_s.empty()) track_low_thresh_0 = std::stof(tl0_s);
auto tm0_s = get_env("TRACK_MATCH_THRESH_0");
if (!tm0_s.empty()) track_match_thresh_0 = std::stof(tm0_s);
auto tb0_s = get_env("TRACK_BUFFER_0");
if (!tb0_s.empty()) track_buffer_0 = std::stoi(tb0_s);
auto tmh0_s = get_env("TRACK_MIN_HITS_0");
if (!tmh0_s.empty()) track_min_hits_0 = std::stoi(tmh0_s);
daily_cutoff_time = get_env("DAILY_CUTOFF_TIME", daily_cutoff_time);
auto th1_s = get_env("TRACK_HIGH_THRESH_1");
if (!th1_s.empty()) track_high_thresh_1 = std::stof(th1_s);
auto tl1_s = get_env("TRACK_LOW_THRESH_1");
if (!tl1_s.empty()) track_low_thresh_1 = std::stof(tl1_s);
auto tm1_s = get_env("TRACK_MATCH_THRESH_1");
if (!tm1_s.empty()) track_match_thresh_1 = std::stof(tm1_s);
auto tb1_s = get_env("TRACK_BUFFER_1");
if (!tb1_s.empty()) track_buffer_1 = std::stoi(tb1_s);
auto tmh1_s = get_env("TRACK_MIN_HITS_1");
if (!tmh1_s.empty()) track_min_hits_1 = std::stoi(tmh1_s);
auto rw_s = get_env("RATE_WINDOW_SEC");
if (!rw_s.empty()) rate_window_sec = std::stoi(rw_s);
daily_cutoff_time = get_env("DAILY_CUTOFF_TIME", get_env("CUTOFF_TIME", daily_cutoff_time));
auto bto_s = get_env("BATCH_TIMEOUT_SECONDS");
if (!bto_s.empty()) batch_timeout_seconds = std::stof(bto_s);
auto ibl_s = get_env("IGNORE_BATCH_LABEL_TIMEOUT_SECONDS");
@@ -125,4 +139,15 @@ void AppConfig::load_from_env(const char* env_path) {
if (!lsn_s.empty()) live_stream_every_n = std::stoi(lsn_s);
rtsp_ffmpeg_options = get_env("OPENCV_FFMPEG_CAPTURE_OPTIONS", rtsp_ffmpeg_options);
auto cff_s = get_env("CROSS_FLASH_FRAMES");
if (!cff_s.empty()) cross_flash_frames = std::stoi(cff_s);
auto pl_s = get_env("POPUP_LIFETIME");
if (!pl_s.empty()) popup_lifetime = std::stoi(pl_s);
auto lpf_s = get_env("LINE_PULSE_FRAMES");
if (!lpf_s.empty()) line_pulse_frames = std::stoi(lpf_s);
auto cpf_s = get_env("COUNT_PULSE_FRAMES");
if (!cpf_s.empty()) count_pulse_frames = std::stoi(cpf_s);
auto bpf_s = get_env("BATCH_PULSE_FRAMES");
if (!bpf_s.empty()) batch_pulse_frames = std::stoi(bpf_s);
}