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.
With OpenVINO 2021 (and likely sooner), there were some massive changes to the framework, and also some pretty awesome additions to the Open Model Zoo.
The new abstractions and additions to the Open Model Zoo samples allows this project to simply link in to those exposed classes when building this project. Also, the multi-threading and multiple camera handling is now done entirely by their framework, hopefully adding quite a boost in processing speed.
Namely, they expose a "pipeline" class that handles submissions of images to run through the neural network, along with some metadata. We can then create our own, new metadata class that adds in a camera index.
In this way, when the pipeline returns back a fully processed frame, it comes back with the camera index. So, we simply iterate through all cameras, passing in a frame from each into the pipeline (with the metadata of the camera index), and when they come back (even out of order), we know which ones were for which cameras.
This greatly simplifies the code.