Repository navigation
Trace the object on a sheet that is small in the frame - #255
Merged
Merged
Conversation
The saliency crop discarded a bright region under 10% of the corrected image. That image covers the whole visible frame, so a sheet photographed from further away fell below the floor, the model ran on the full image and returned the sheet's outline. Traced regions under 5000 px were also dropped, which on such a sheet removes tools of several square centimetres. The trace route now passes the paper size and scale factor to the tracer. The sheet floors are measured against the sheet's own area, and the smallest kept region is 150 mm2 or 5000 px, whichever is fewer pixels. Callers that pass no scale keep the previous behaviour. Closes #253 Signed-off-by: Jason Madigan <jason@jasonmadigan.com>
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.
A sheet photographed from further away covers a few percent of the corrected image. Two floors in the tracer assumed it fills the frame:
The trace route now passes the paper size and scale factor to the tracer. The sheet floors are measured against the sheet's own area. The smallest kept region is 150 mm² or 5000 px, whichever is fewer pixels. Callers that pass no scale keep the previous behaviour.
Behaviour change
Nothing changes while an A4 sheet's long side spans more than about 85% of the corrected image. Below that, regions between 150 mm² and 5000 px are now kept, which can surface a small object or blemish that was previously dropped.
Verification
cd backend && venv/bin/python -m pytest: 878 passed.ruff check backend/: clean.pnpm testandmake test-e2e-accuracywere left to CI.Closes #253