Skip to content

解决中文显示问题 - #4428

Merged
donghaiwang merged 5 commits into
OpenHUTB:mainfrom
heeyusike:main
Dec 22, 2025
Merged

donghaiwang merged 5 commits into
OpenHUTB:mainfrom
heeyusike:main

Conversation

@heeyusike

Copy link
Copy Markdown
Contributor

修改概述:
本次修改针对检测器模块(core/detector.py)与辅助函数(core/process.py)进行优化,解决了中文标签乱码、freetype依赖报错问题,同时提升了帧率显示的稳定性与视频保存的健壮性,无需安装额外依赖库即可正常运行。

修改的详细描述

1.调整core/process.py的draw_annotations函数:改用 “拼音 + 中文注释” 形式显示识别标签(如 “Ren(人)”),避开 OpenCV 默认不支持中文的限制,同时移除freetype相关依赖,无需安装扩展库;
2.优化core/detector.py的帧率计算逻辑:将单帧帧率改为 “最近 10 帧滑动平均”,避免帧率显示大幅波动;

经过了什么样的测试?

1.操作系统:Windows 10、Windows 11;
2.Python 版本:Python 3.11.9;

运行效果

动图、视频、截图等
2c3d85296c30abf8afafe1f122d93fcd

Refactor configuration management to support environment variables and improve readability.
Refactor main program for accident video detection with performance improvements, flexible configurations, and enhanced logging. Added support for recognizing people and vehicles.
Refactor processing functions for accident video recognition, adding distance calculation and box center retrieval.
Enhance accident detection with video saving and FPS display.
@donghaiwang
donghaiwang merged commit 3f80f22 into OpenHUTB:main Dec 22, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants