84 lines
2.4 KiB
C++
84 lines
2.4 KiB
C++
#pragma once
|
|
#include <string>
|
|
#include <cstdint>
|
|
|
|
struct AppConfig {
|
|
std::string output_dir = "/opt/bytetrack-counter-cpp";
|
|
std::string db_path;
|
|
std::string state_file;
|
|
std::string source = "rtsp://user:pass@192.168.0.100:554/stream1";
|
|
std::string model_path = "/opt/models/yolo.rknn";
|
|
std::string camera_name = "CC1";
|
|
std::string object_label = "ayam-potong";
|
|
std::string class_ayam = "ayam";
|
|
std::string class_talenan = "talenan";
|
|
|
|
int line_x = -1;
|
|
float line_x_frac = 0.5f;
|
|
std::string cross_direction = "rtl";
|
|
|
|
int imgsz = 320;
|
|
bool half = false;
|
|
float conf = 0.3f;
|
|
int device = 0;
|
|
int core_mask = 1;
|
|
int num_classes = 2;
|
|
bool score_sigmoid = false;
|
|
int ayam_class_id = 0;
|
|
int talenan_class_id = 1;
|
|
|
|
float track_high_thresh_0 = 0.5f;
|
|
float track_low_thresh_0 = 0.1f;
|
|
float track_match_thresh_0 = 0.8f;
|
|
int track_buffer_0 = 30;
|
|
int track_min_hits_0 = 3;
|
|
|
|
float track_high_thresh_1 = 0.5f;
|
|
float track_low_thresh_1 = 0.1f;
|
|
float track_match_thresh_1 = 0.6f;
|
|
int track_buffer_1 = 30;
|
|
int track_min_hits_1 = 3;
|
|
|
|
int rate_window_sec = 60;
|
|
|
|
std::string daily_cutoff_time = "20:00";
|
|
bool reset_counters_at_cutoff = true;
|
|
float batch_timeout_seconds = 300.0f;
|
|
float ignore_batch_label_timeout = 30.0f;
|
|
int min_object_per_batch = 60;
|
|
int min_duration_per_batch = 60;
|
|
|
|
bool export_csv = true;
|
|
std::string cross_csv;
|
|
|
|
bool motion_detection_enabled = false;
|
|
float motion_threshold = 5.0f;
|
|
int warmup_frames = 30;
|
|
int reconnect_delay_sec = 3;
|
|
int max_reconnect_attempts = 0;
|
|
int flush_every_n_frames = 100;
|
|
int tracked_prune_sec = 300;
|
|
bool record_video = false;
|
|
int video_segment_sec = 3600;
|
|
int output_fps = 15;
|
|
float record_delay_seconds = 10.0f;
|
|
std::string record_shm_dir = "/dev/shm/bytetrack-counter";
|
|
|
|
bool live_stream_enabled = false;
|
|
std::string live_stream_frame_path = "/dev/shm/bytetrack-counter/live_frame.jpg";
|
|
int live_stream_quality = 75;
|
|
int live_stream_every_n = 2;
|
|
|
|
std::string rtsp_ffmpeg_options = "rtsp_transport;tcp|fflags;nobuffer|flags;low_delay";
|
|
|
|
int cross_flash_frames = 12;
|
|
int popup_lifetime = 20;
|
|
int line_pulse_frames = 12;
|
|
int count_pulse_frames = 15;
|
|
int batch_pulse_frames = 20;
|
|
|
|
void load_from_env(const char* env_path = nullptr);
|
|
};
|
|
|
|
extern AppConfig g_config;
|