Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## users/damccorm/py313-inference-2-huggingface #41646 +/- ##
===============================================================================
Coverage ? 58.04%
Complexity ? 2844
===============================================================================
Files ? 1210
Lines ? 173284
Branches ? 2329
===============================================================================
Hits ? 100586
Misses ? 69988
Partials ? 2710
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
stop reviewer notifications |
There was a problem hiding this comment.
📋 Review Summary
This PR updates the PyTorch MaskRCNN COCO integration tests in pytorch_inference_it_test.py to tolerate minor bilinear resize rounding differences introduced in Pillow 13.0.0. Instead of enforcing strict string equality across the entire detection list, it checks for an exact match on the top 5 predictions and at least 0.8 multiset IoU across all detected labels.
🔍 General Feedback
- The approach is clean, well-scoped, and preserves compatibility with shared GCS golden files across different Python and Pillow versions.
- Consider guarding against a potential
ZeroDivisionErrorin_assert_labels_matchif bothexpectedandpredictedlabel lists are ever empty (i.e.,union == 0), thoughself.assertEqual(expected[:top_k], predicted[:top_k])would already hold in that case.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
MaskRCNN returns all detections above score 0.05 sorted by confidence, so +/-1 pixel bilinear resize rounding differences introduced in Pillow 13.0.0 reorder nearly-tied detections and toggle borderline detections near 0.05. Compare parsed label lists using exact top-5 match plus >= 0.8 multiset IoU so tests remain resilient across Pillow/PyTorch versions without mutating shared GCS golden files.
e90083d to
ac0682c
Compare
|
Stopping reviewer notifications for this pull request: requested by reviewer. If you'd like to restart, comment |
Part of #41652 (stack: https://github.com/apache/beam/stack/41650).
Stack 3/6 — Makes the two COCO MaskRCNN integration tests in
pytorch_inference_it_test.pyresilient to minor image-resizing rounding differences across Pillow/PyTorch versions:box_score_thresh=0.05sorted by score. Pillow13.0.0(used by Beam's Python 3.11–3.14 environments) produces a ±1/255 bilinear resize difference on two COCO val2017 images (000000006818.jpgand000000331352.jpg), which reorders nearly-tied detections and toggles borderline detections near0.05._assert_labels_matchto compare parsed detection label lists using an exact top-5 match plus>= 0.8multiset IoU, keeping the assertion meaningful across Pillow 10–13 without mutating the shared GCS golden files used by older release branches.(Note: the 15 missing COCO
val2017JPEG inputs referenced bygs://apache-beam-ml/testing/inputs/it_coco_validation_inputs.txthave also been restored togs://apache-beam-ml/datasets/coco/raw-data/val2017/.)Verification
direct:py313:torchInferenceTest(5/5 passed) locally and in PostCommit Python (3.13) run 45406881889.