修复bug,过滤不允许的类别

This commit is contained in:
martin 2026-04-08 10:40:13 +08:00
parent fad554632e
commit be99472837

View File

@ -723,6 +723,10 @@ class MultiYoloTrtDetectorTrackId_TRT10_YOLO11:
elif isinstance(model_class_names, dict):
class_name = model_class_names.get(class_id, "unknown")
# 过滤不允许的类别
if allowed and class_name not in allowed:
continue
# 创建DetectionResult对象
detection = DetectionResult(
bbox=box,