Fix darknet_video.py to so it's not off by 1 frame #6717
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.
The issue:
Previously the output videofile had detections off by 1 frame from the video.
The reason:
The
darknet_image
is overwritten invideo_capture
every time it's being created because it sits in the same memory so effectively thedarknet_image_queue
is not working properlyChanges:
darknet_image
is created in every iteration ofvideo_capture
so every newdarknet_image
sits in different memorymax_size
of the queue. I believe the limitations were put there to avoid the issue above, but it only made it so the result was off by one frame. Now that that's not an issue there is no reason to havemax_size
for any of the queques