Repository navigation
解决中文显示问题 - #4428
Merged
Merged
解决中文显示问题#4428
Conversation
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
approved these changes
Dec 22, 2025
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.
修改概述:
本次修改针对检测器模块(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;
运行效果
动图、视频、截图等
