Repository navigation
feat(detections): store a native resolution crop per bbox - #749
Open
MateoLostanlen wants to merge 3 commits into
Open
MateoLostanlen wants to merge 3 commits into
MateoLostanlen wants to merge 3 commits into
Conversation
The engine can send, for each bbox, a region of the camera frame at its native resolution and the position of that region in the full frame. Both are stored on the detection and deleted with it or with its camera.
| from alembic import op | ||
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision: str = "b7d1e4a2c9f6" |
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision: str = "b7d1e4a2c9f6" | ||
| down_revision: Union[str, None] = "94a223eae6ac" |
| # revision identifiers, used by Alembic. | ||
| revision: str = "b7d1e4a2c9f6" | ||
| down_revision: Union[str, None] = "94a223eae6ac" | ||
| branch_labels: Union[str, Sequence[str], None] = None |
| revision: str = "b7d1e4a2c9f6" | ||
| down_revision: Union[str, None] = "94a223eae6ac" | ||
| branch_labels: Union[str, Sequence[str], None] = None | ||
| depends_on: Union[str, Sequence[str], None] = None |
| # order. Up to 6 decimals: 3 would be about 4 px on a 4K frame, too coarse to map labels to the crop. | ||
| WINDOW_FLOAT_PATTERN = r"(0?\.[0-9]{1,6}|0|1)" | ||
| WINDOW_PATTERN = rf"\({WINDOW_FLOAT_PATTERN},{WINDOW_FLOAT_PATTERN},{WINDOW_FLOAT_PATTERN},{WINDOW_FLOAT_PATTERN}\)" | ||
| WINDOWS_PATTERN = rf"^\[({WINDOW_PATTERN}(,{WINDOW_PATTERN})*)?\]$" |
| WINDOW_PATTERN = rf"\({WINDOW_FLOAT_PATTERN},{WINDOW_FLOAT_PATTERN},{WINDOW_FLOAT_PATTERN},{WINDOW_FLOAT_PATTERN}\)" | ||
| WINDOWS_PATTERN = rf"^\[({WINDOW_PATTERN}(,{WINDOW_PATTERN})*)?\]$" | ||
| # 37 chars per window, plus the separating commas and the brackets | ||
| MAX_WINDOWS_STR_LENGTH = settings.MAX_BOXES_PER_DETECTION * 38 + 1 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #749 +/- ##
==========================================
+ Coverage 91.83% 95.79% +3.95%
==========================================
Files 3 65 +62
Lines 147 3806 +3659
==========================================
+ Hits 135 3646 +3511
- Misses 12 160 +148
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:
|
The API now rejects more than 5 bboxes whatever their formatting, and a native crop over 1 MB. pyroclient refuses such a crop before sending it.
This branch has not been deployed
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.
POST /detectionsaccepts onenative_cropfile per bbox andnative_crop_windows, the position of each crop in the full frame. Both are stored on the detection (new nullable columns, with a migration) and deleted with the detection or its camera.cropfield is unchanged, so engines that are not updated keep working.create_detectiontakesnative_cropsandnative_crop_windows.