Convert WeChatQRCode test model fixtures from Caffe to ONNX - #2078
Conversation
OpenCV 5.x's wechat_qrcode module (and WeChatQRCode's OpenCvSharp wrapper) only accepts single-file ONNX models now; the Caffe importer has been removed entirely. The Caffe-format fixtures checked into this repo (detect.prototxt/.caffemodel, sr.prototxt/.caffemodel) were therefore stale and every model-dependent WeChatQRCodeTest case was silently skipped. Replace them with detect.onnx/sr.onnx, converted from the same published weights (opencv/opencv_3rdparty:wechat_qrcode_20210119, Apache License 2.0; see NOTICE.md). All 7 model-dependent tests in WeChatQRCodeTest.cs now run and pass instead of being skipped. Refs #2075
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe WeChat QR code test assets replace the Caffe detection and super-resolution prototxt files with an ONNX super-resolution model and add NOTICE documentation covering model provenance, licensing, and conversion details. ChangesWeChat QR model assets
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@test/OpenCvSharp.Tests/_data/wechat_qrcode/NOTICE.md`:
- Around line 1-12: Update the prose paragraphs in NOTICE.md to use one source
line per paragraph, removing mid-sentence hard wraps while preserving the
existing wording, links, code spans, and paragraph separation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 50cbfc6a-0b36-43b5-8509-08fbe12bdd6e
📒 Files selected for processing (5)
test/OpenCvSharp.Tests/_data/wechat_qrcode/NOTICE.mdtest/OpenCvSharp.Tests/_data/wechat_qrcode/detect.onnxtest/OpenCvSharp.Tests/_data/wechat_qrcode/detect.prototxttest/OpenCvSharp.Tests/_data/wechat_qrcode/sr.onnxtest/OpenCvSharp.Tests/_data/wechat_qrcode/sr.prototxt
💤 Files with no reviewable changes (2)
- test/OpenCvSharp.Tests/_data/wechat_qrcode/detect.prototxt
- test/OpenCvSharp.Tests/_data/wechat_qrcode/sr.prototxt
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
The conversion tooling moved to its own repository (shimat/caffe-ssd-to-onnx) rather than living under tools/ here, since it's reusable for other Caffe-SSD models, not specific to OpenCvSharp.
Summary
wechat_qrcodemodule (and OpenCvSharp'sWeChatQRCodewrapper) only accepts single-file ONNX models now - the Caffe importer has been removed entirely (readNetFromONNX/readNeton a.caffemodelnow fail with "Caffe importer has been removed"). The Caffe-format fixtures checked into this repo (detect.prototxt/.caffemodel,sr.prototxt/.caffemodel) were stale leftovers from the 4.x era, so every model-dependent case inWeChatQRCodeTest.cswas silently skipped viaSkipIfModelFilesNotFound(), both locally and in CI.detect.onnx/sr.onnx, converted from the same published weights (opencv/opencv_3rdparty:wechat_qrcode_20210119, Apache License 2.0 - see the addedNOTICE.md). No architecture or weight changes, just a format conversion.opencv_extra's5.xbranch (not its default branch, which is why we missed it at first) does list an ONNX conversion of the same models viadownload_models.py, sourced from an unlicensed personal GitHub releases repo (omrope79/opencv-test-models). We verified it against our own conversion (equivalent detection output) but converted independently anyway, since our version carries clear attribution back to the original Apache-2.0 source and doesn't depend on an unlicensed third-party mirror.Testing
dotnet test --filter "FullyQualifiedName~WeChatQRCode": all 10 tests pass, 0 skipped (previously 7 of them were skipped for lack of model files).🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
Chores