gf_ai_box/ini/host_stream.ini
miketsai 936e547dc3 feat(detect): add debounce for alert/collision and tune default thresholds
- stdc_post_process.c: add consecutive frame counters for left/right alert
  (5 frames) and collision_risk (3 frames) to suppress single-frame noise
- raise alert threshold defaults to 0.20 across all classes; tree_alert
  raised to 0.30 (trees are common background, prone to false positives)
- grass_roi default raised from 0.75 to 0.80
- remove per-frame verbose log from stdc_post_process.c (consolidated
  into app_header_init.c)
- app_header_init.c: add STDC-VIO / STDC-COL / STDC-ALT tuning logs
  showing actual%/threshold% side-by-side for field calibration
- ini/host_stream.ini, kp_firmware.c: sync fallback defaults to match
2026-07-29 17:04:31 +08:00

133 lines
8.1 KiB
INI
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[sensor]
sensor_cfg = "./Resource/VIC/0/imx662_1920x1080_ch0.cfg"
fusion_cfg = "./Resource/VIC/1/imx662_1920x1080_ch1.cfg"
autoscene_config = "./Resource/AutoScene/autoscene_conf.cfg"
fec_calibrate_path = "./ini/fec_calibrate.ini"
fec_conf_path = "./ini/fec_conf.ini"
fec_mode = 4 # 0: Original, 1: 1 Region, 2: 180 all direction, 3: 180 one Direction, 4: 180 two direction, 5: PT Mode
initial_fec_app_type = 0 # 0: ceiling, 1: table, 2: wall
eis_enable = 1
[nnm]
ModelPath = "nef/STDC03302026_models_630.nef"
ModelId = 32769 # KNERON_YOLOV5S_COCO80_640_640_3 (YOLO v5s)
JobId = 200 # KDP2_INF_ID_APP_YOLO
InferenceStream = 1 # Inference stream index (use stream1: 640x640)
Threshold = 0.5 # for yolo only(JobId = 11)
Fps = 25 # Image input fps for NPU inference
GetImageBufMode = 0 # 0: block mode 1: non-block mode
RoiEnable = 0 # Enable ROI for nnm detect
RoiX = 0 # ROI start x
RoiY = 0 # ROI start y
DrawBoxEnable = 1 # draw object bounding box on stream0 (also enables STDC seg overlay)
SegOverlayEnable = 0 # 0: outline only, 1: also paint per-class colour overlay (requires DrawBoxEnable=1)
OnlyPerson = 1 # only draw person bounding box when DrawBoxEnable
#(so far for yolo only, JobId = 11)
DrawOnResize = 0; # If InferenceStream is 0. This setting needs to be enabled. The box will be drawn on all resize streams.
verbose_log = 1 # 0: quiet (warnings only, ~30B/s), 1: per-frame class ratios every 20 frames (~1KB/s). Toggle from web UI.
NnmSource = 0 # 0: run host_stream independently, 1: run with streamer
ssm_name = "vsrc_ssm_ifp_0" # If NnmSource is 1. This setting needs to be set. The name is automaticlly create by streamer.
[voc]
voc_enable = 1 #enable Video Output Component
VocWidth = 1920 #video output width
VocHeight = 1080 #video output height
PixFmt = NV12 # HDMI input format for VOC: NV12 / NV21 / YM12
[streamer]
StreamCount = 2 #Stream amount
MemType = 0 #Encode buffer type, 0(SRB mode)/1(SCM mode)
#stream0 is the main stream which has the same resolution as the sensor.
[stream0]
Codec = 0 #VMF_VENC_CODEC_TYPE_H264
Width = 1920 #The image width of stream0
Height = 1080 #The image height of stream0
FPS = 25 #The frame rate of stream0
QP = 25 #The base value of the quantization parameter. Its range is from 0 to 51.
Bitrate = 2000000 #The average bitrate of the encoded stream. Its range is from 30,000 to 700,000,000 bps.
PIQ = 0 #PIQ setting. Reduce the difference of QP between intra and inter frame. Default: 0 (disable).
GOP = 50 #Group of pictures. It specifies the number of frames between two intra frames. The maximum GOP value is 600.
Virt_I_Interval = 0 #Virtual intra frame interval. 0:disable, range: 1 ~ (gop-1)
KeepFrameRatio = 0 # This option is valid only on resized stream.
EncodeBufferSize = 6291456 # 6M: 6*1024*1024 = 6291456
EncodeBufferAmount = 3 # (SRB only)
[stream1]
Codec = 0 #VMF_VENC_CODEC_TYPE_H264
Width = 724 #The image width of stream1 (STDC model training resolution)
Height = 362 #The image height of stream1 (STDC model training resolution)
FPS = 25 #The frame rate of stream0
QP = 25 #The base value of the quantization parameter. Its range is from 0 to 51.
Bitrate = 2000000 #The average bitrate of the encoded stream. Its range is from 30,000 to 700,000,000 bps.
PIQ = 0 #PIQ setting. Reduce the difference of QP between intra and inter frame. Default: 0 (disable).
GOP = 50 #Group of pictures. It specifies the number of frames between two intra frames. The maximum GOP value is 600.
Virt_I_Interval = 0 #Virtual intra frame interval. 0:disable, range: 1 ~ (gop-1)
KeepFrameRatio = 0 # This option is valid only on resized stream.
EncodeBufferSize = 2097152 # 2M: 2*1024*1024 = 2097152
EncodeBufferAmount = 3 # (SRB only)
[stream2]
Codec = 0 #VMF_VENC_CODEC_TYPE_H264
Width = 640 #The image width of stream0
Height = 480 #The image height of stream0
FPS = 25 #The frame rate of stream0
QP = 25 #The base value of the quantization parameter. Its range is from 0 to 51.
Bitrate = 2000000 #The average bitrate of the encoded stream. Its range is from 30,000 to 700,000,000 bps.
PIQ = 0 #PIQ setting. Reduce the difference of QP between intra and inter frame. Default: 0 (disable).
GOP = 50 #Group of pictures. It specifies the number of frames between two intra frames. The maximum GOP value is 600.
Virt_I_Interval = 0 #Virtual intra frame interval. 0:disable, range: 1 ~ (gop-1)
KeepFrameRatio = 0 # This option is valid only on resized stream.
EncodeBufferSize = 2097152 # 2M: 2*1024*1024 = 2097152
EncodeBufferAmount = 3 # (SRB only)
[capture]
# Legacy single-JPEG capture (kept for reference, not used by event_recorder)
enable = 0
http_url = http://192.168.0.114:8081/api/upload
cooldown_ms = 1000
[event]
# Violation event recorder ??two-channel: JSON (BT/iPad) + tar.gz (Allxon OOB)
enable = 1
bt_uart_dev = /dev/ttyS1 # Channel A: UART device for DX-BT24 BLE module ??iPad
bt_at_probe = 0 # 0: skip AT commands (normal); 1: one-time baud upgrade (factory/reset only)
aresx_version = 1.0.0 # Reported in status_check notify (ares_x_version)
bt_name = BT-24 # Reported in status_check notify (bluetooth_peripheral_name)
; device_id: Raw KL630 Kn chip number (e.g., 0xCE7B562C).
; Leave empty to auto-detect on first boot; value is written back automatically.
; BLE broadcast name (event:bt_name) is derived as AresX-{lower 16-bit hex}.
device_id =
upload_url = http://192.168.0.99/api/golf-golface.cgi # Channel B: tar.gz upload (OOB/cloud path)
upload_dev = 1 # 1: append &dev=1 to upload URL (dev); 0: production
sd_path = /tmp/sdcard/events # SD card event archive path
sd_max_mb = 7168 # 7 GB ??delete oldest when exceeded
upload_delay_ms = 0 # 0: upload immediately after tar.gz built (tar is built after event ends, no extra delay needed)
[can]
# CAN bus via MCP2515 SPI controller on J16 connector
# J16 pin order: CS -> DO -> CLK -> RESERVED(DI)
enable = 1 # 1: enable CAN bus output; 0: disabled
spidev = /dev/spidev1.0 # SPI device path for MCP2515
speed_kbps = 250 # CAN bus speed: 125 / 250 / 500 / 1000 kbps
can_id = 0x100 # 11-bit standard frame ID for outbound event frames
speed_normal = 240 # CAN speed command: normal driving
speed_alert = 35 # CAN speed command: slow/alert (person or obstacle detected)
speed_stop = 10 # CAN speed command: stop/emergency
[detect]
# Detection thresholds as integer promille (value × 1000).
# BLE SET example: SET THR_GRASS_ROI 750 → 0.750
thr_grass_roi = 800 # grass ratio in forward ROI → violation
thr_person_col = 200 # person ratio in center ROI → collision
thr_car_col = 200 # car ratio → collision
thr_tree_col = 200 # tree ratio → collision
thr_bunker_col = 200 # bunker ratio → collision
thr_pond_col = 200 # pond ratio → collision
thr_person_alt = 200 # person ratio in side ROI → alert
thr_car_alt = 200 # car ratio → alert
thr_tree_alt = 300 # tree ratio → alert (higher: trees are common background)
thr_bunker_alt = 200 # bunker ratio → alert
thr_pond_alt = 200 # pond ratio → alert