修改检测框的尺寸;修改YOLO检测的阈值;修改后备箱的检测阈值要求

This commit is contained in:
2026-03-05 12:59:22 +08:00
parent 1ed8597c17
commit e84b22cd0a

View File

@@ -28,13 +28,22 @@ DETECT_MODEL_PATH = 'YOLO_Weight/Kadian.onnx'
# [0.3411458333333333, 0.9861111111111112]
#])
# ROI_RELATIVE=np.array([
# [0.12,0.0],
# [0.3,0.0],
# [0.5,0.2],
# [1.0, 0.95],
# [1.0,1.0],
# [0.42,1.0]
# ])
ROI_RELATIVE=np.array([
[0.12,0.0],
[0.3,0.0],
[0.5,0.2],
[1.0, 0.95],
[1.0,1.0],
[0.42,1.0]
[0.15,0.15],
[0.37,0.15],
[0.55,0.2],
[0.9,0.85],
[0.35,0.85]
])
@@ -56,14 +65,14 @@ class KadianDetector:
# 模型加载
self.detector = YOLOv8_ONNX(
DETECT_MODEL_PATH,
conf_threshold=0.25,
iou_threshold=0.45,
conf_threshold=0.6,
iou_threshold=0.65,
input_size=PERSON_CAR_INPUT_SIZE
)
# 跟踪器配置
class TrackerArgs:
track_thresh = 0.3 # 必须大于等于yolo的conf_threshold
track_thresh = 0.61 # 必须大于等于yolo的conf_threshold
track_buffer = 40
match_thresh = 0.85
mot20 = True
@@ -79,7 +88,7 @@ class KadianDetector:
# ===================== 超参数设置 (仅保留车/后备箱相关) =====================
# 后备箱检查判定阈值
self.TIME_THRESHOLD_TRUNK_OPEN = 0.1
self.TIME_THRESHOLD_TRUNK_OPEN = 0.3
# 车辆最小停留时间阈值 (小于此时间视为无人检查/直接通过)
self.TIME_THRESHOLD_CAR_MIN_DURATION = 3.0
# Car 丢帧/ID维持缓冲
@@ -88,8 +97,8 @@ class KadianDetector:
# police丢失阈值
self.TIME_TOLERANCE_POLICE = 3.0
# police状态判定阈值 (累计秒数)
self.TIME_THRESHOLD_NOBODY = 5.0
self.TIME_THRESHOLD_ONLY_ONE = 5.0
self.TIME_THRESHOLD_NOBODY = 10.0
self.TIME_THRESHOLD_ONLY_ONE = 10.0
# --- 计算对应的帧数阈值 ---
self.frame_thresh_trunk_valid = int(self.TIME_THRESHOLD_TRUNK_OPEN * self.fps)