Open
【11月贡献大赛-Bug修复】fix(image-processor-config-auditor): 拦截负 image_std 归一化标准差(Fixes #4171) #7338
W8FXN182FAdd on 2 hours ago
【11月贡献大赛-Bug修复】fix(image-processor-config-auditor): 拦截负 image_std 归一化标准差(Fixes #4171) #7338
Open
Merge blocked
2 hours ago Added label: ascend-cla/no
ascend-robot
2 hours ago Comments:
2 hours ago Comments:
Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
PR Approval Progress
⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| sig-model-agent | ❌ (0/2)(You can also ask: starmountain, 花新宇, cookieyyds, 陈少宏, 胡晓曼) | ❌ (0/1)(You can also ask: 王岩, 张玉橙, 陈少宏, 胡晓曼, 顾梦沁) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
W8FXN182F, thanks for your pull request. All authors of the commits have signed the CLA. 👍


W8FXN182F
2 hours ago Comments:
2 hours ago Comments:
/check-cla


ascend-robot
2 hours ago Comments:
2 hours ago Comments:
CLA检查未通过,详情可参考这里


W8FXN182F
2 hours ago Comments:
2 hours ago Comments:
/check-cla


2 hours ago Removed label: ascend-cla/no
2 hours ago Added label: ascend-cla/yes
ascend-robot
2 hours ago Comments:
2 hours ago Comments:
CLA检查已通过,详情可参考这里


一句话
preprocessor_config.json审计器只拦截image_std恰为 0 的情况,负标准差(如[-0.5, 0.5, 0.5])仍被判为 READY;本 PR 将负image_std作为独立 BLOCK finding 拦截,并保留原有零标准差规则。复现(命令 + 修复前输出)
import sys sys.path.insert(0, "skills/verification/ascend-image-processor-config-auditor/scripts") import audit_image_processor_config as auditor config = { "image_processor_type": "CLIPImageProcessor", "do_normalize": True, "image_mean": [0.5, 0.5, 0.5], "image_std": [-0.5, 0.5, 0.5], } print(auditor.audit(config, {"num_channels": 3}))修复前输出(决策 READY、无 finding):
对比:把
image_std中的-0.5换成0.0时原逻辑能返回 BLOCK,说明负值绕过了ZERO_NORMALIZATION_STD检查。负标准差会反转对应通道的归一化方向,与预处理契约不一致。方案
在
scripts/audit_image_processor_config.py的归一化向量校验处:ZERO_NORMALIZATION_STD(含 0 即 BLOCK);NEGATIVE_NORMALIZATION_STD(BLOCK),拦截image_std中任一负值。代码改动仅此 1 个脚本;另新增回归测试
tests/test_negative_std.py,并按赛制合规补齐readme.md(原目录仅含 SKILL.md,缺 readme.md)。证据(unittest 原始输出)
修复前基线(
tests/test_audit_image_processor_config.py):Ran 27 tests in 0.123s ... OK修复后:
tests/test_negative_std.py:Ran 4 tests in 0.066s ... OK(负值 BLOCK、正值向量 READY、零值仍 BLOCK、CLI 退出码 2)
tests/test_audit_image_processor_config.py:Ran 27 tests in 0.123s ... OK复现对象验证:
image_std->{'decision': 'BLOCK', 'findings': [{'level': 'BLOCK', 'code': 'NEGATIVE_NORMALIZATION_STD', ...}]}image_std->{'decision': 'READY', 'findings': []}说明:本修复为纯 Python 标准库确定性复现,无 NPU 环境,未声称真机验证。