feat: add logging to alignment script #1259
Open
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.
1.添加了日志记录功能:使用Python的logging模块记录处理过程中的信息、警告和错误;日志同时输出到文件和终端;替换了原始的print语句
2.添加了进度条:使用tqdm库显示处理进度,方便用户了解处理进度;
3.图像处理改进:使用PIL库代替scipy.misc进行图像缩放,避免deprecation警告;添加了更全面的错误处理
4.新增统计信息:记录检测到的总人脸数;计算并显示对齐成功率;更详细的处理结果统计
5.参数扩展:添加了min_face_size参数,允许用户自定义最小人脸检测尺寸
6.代码结构优化:将日志设置提取为单独的函数;更清晰的错误处理流程