扩大ROI检测区域并增大YOLO输入尺寸,实现多尺度检测以提高远处车辆的检出率。#5447
Merged
donghaiwang merged 3 commits intoOpenHUTB:mainfrom Apr 18, 2026
Merged
Conversation
donghaiwang
approved these changes
Apr 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修改概述:
扩大ROI检测区域并增大YOLO输入尺寸,实现多尺度检测以提高车辆检出率;同时恢复严谨的穿越方向判断逻辑。修改的详细描述
2.将检测置信度阈值从 0.4 降至 0.15,提高检测率,扩大ROI检测区域
3.ROI顶部裁剪:h // 3 → h // 6,ROI左右裁剪:w // 6 → w // 12,增大YOLO输入尺寸
4.输入尺寸从默认640增至1280,新增多尺度检测:当检测数过少时自动切换到1920
经过了什么样的测试?
2.Python版本:3.11.9 (虚拟环境 venv311)
依赖包:ultralytics、supervision、opencv-python
测试视频:CARLA仿真器录制的sample.mp4
运行效果
计数线位置:y=750
预期效果:相比修改前,远处小车检测率提升,分类统计(car/motorbike/bus/truck)正常工作
输出:带检测框、轨迹和计数的标注视频保存至 res/sample_res.mp4
动图、视频、截图等
85091b960f77bca9ddb4fa9fffec660c.mp4
检测框修改对比
