Repository navigation
Conversation
last_detection is the same object as a discarded detection, so skipping the age stamp left last_detection.age as None.
Author
|
Going to close this. Not planning to keep it rebased. |
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.
Always set detection.age in _conditionally_add_to_past_detections, including when the sample is skipped and when past_detections_length is 0.
Fixes #317.
Detection.age was only written when a match was stored in
TrackedObject.past_detections. hit() still assigns that same detection to
last_detection, so once the buffer was full (or past_detections_length
was 0) last_detection.age stayed None.
The reporter (nmichlo) asked that age be set even when the detection is
discarded, "because this affects the last_detection."
What I chose and the alternative
The keep path already overwrote age in _conditionally_add_to_past_detections,
which is the site the reporter pointed at.
Alternative: set age in hit() only, so ReID merge() would not rewrite ages
of detections it does not keep. Also considered asserting age is unset.
Did not add that assert: merge() re-adds detections that already have age.
Can move the stamp to hit() instead.
Test plan
the fix and passes with it (past_detections_length 0, 2, and 4)