Repository navigation
[transforms] Keep the shadow base corner when it is rounded onto the tip corner in create_shadow_mask - #2212
Merged
felixdittrich92 merged 1 commit intoNov 2, 2026
Conversation
…tip corner in create_shadow_mask
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2212 +/- ##
==========================================
- Coverage 97.78% 97.77% -0.02%
==========================================
Files 170 170
Lines 10993 10995 +2
==========================================
Hits 10750 10750
- Misses 243 245 +2
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:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
create_shadow_mask(used byRandomShadow) sometimes raised a bareValueErrorwith no message. After the contour is rotated and rounded to pixels, a corner of the shadow base and the tip corner next to it can land on the same pixel, andexpand_linethen gets a line of length 0: it has no direction, so no edge point matches and it falls through toraise ValueError.Running
create_shadow_maskwith seeds 0-4999 raised it once for a 64x64 image (seed 3074) and 15 times for 8x8, so a long training run withRandomShadoweventually stops on it.expand_linenow keeps the first point when both points coincide, and all 45,000 runs over 9 image shapes pass.Tests: a coinciding line in
test_expand_line, andcreate_shadow_maskwith the two failing random draws pinned throughmonkeypatch, liketest_create_shadow_mask_covers_every_direction. They fail on main