fix: 迷失之地 YOLO 推理前涂黑战斗头像 - #2488
Conversation
避免角色头像-3-1/3-2/3-3 被误检为目标,统一在 LostVoidDetector.run 入口处理。
📝 WalkthroughWalkthroughLostVoidDetector 在 YOLO 推理前复制图像并遮挡战斗头像区域,新增头像遮罩矩形配置及对应处理方法,检测参数继续透传。 ChangesLostVoid 头像遮罩
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| (104, 40, 274, 110), # 头像-3-1 | ||
| (559, 40, 662, 91), # 头像-3-2 | ||
| (741, 40, 844, 91), # 头像-3-3 |
There was a problem hiding this comment.
既然都硬编码了直接涂黑左上角一个大矩形吧
按 review 意见把 3-1/3-2/3-3 三个区域合并为最小外接矩形。
|
@ShadowLemoon 暗檬大大~ 按你的 review 意见改好了:现在是左上角单一最小外接矩形 麻烦有空帮看下,可以的话合并一下,谢谢! |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.py (1)
52-84: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win为头像遮罩增加回归测试。
建议验证:原图不会被修改、矩形区域像素全部变黑、矩形外区域保持不变,并确认
run()传给父类的是遮罩后的图像而非原图。当前仅有 debug 图验证,后续坐标或图像类型变更容易引入回归。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.py` around lines 52 - 84, 为 LostVoidDetector.mask_battle_avatars 增加回归测试,验证返回副本、原图不被修改、BATTLE_AVATAR_MASK_RECT 覆盖区域全部为黑色且外部像素保持不变;同时测试 run 调用 Yolov8Detector.run 时传入的是遮罩后的图像而非原图。
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.py`:
- Around line 52-84: 为 LostVoidDetector.mask_battle_avatars
增加回归测试,验证返回副本、原图不被修改、BATTLE_AVATAR_MASK_RECT 覆盖区域全部为黑色且外部像素保持不变;同时测试 run 调用
Yolov8Detector.run 时传入的是遮罩后的图像而非原图。
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 785db60b-5645-4605-a26a-03de052675ec
📒 Files selected for processing (1)
src/zzz_od/application/hollow_zero/lost_void/context/lost_void_detector.py
Summary
LostVoidDetector.run()入口,对战斗画面头像-3-1/3-2/3-3区域涂黑后再做 YOLO 推理Testing
_1783595904619跑过涂黑与 26n 推理,头像区域涂黑正常ruff check已通过修改文件Summary by CodeRabbit