New function [JSONSink] - Allowing to serialise Detections to a JSON file #819
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.
Description
This PR introduces the
JSONSinkclass to address structured logging of object detection data into JSON format, as requested in issue #748. The class supports logging of bounding boxes, class IDs, confidence scores, and frame numbers, enhancing post-processing data analysis and interpretability.The PR includes:
JSONSinkclass implementation.JSONSinkwith a video processing pipeline.Note: The
JSONSinkclass was placed directly in the utils folder in the file.py file due to its capability to handle various types of file operations integral to the project's core functionality. Open to suggestions if there's a more appropriate location within the project structure.Type of Change
JSONSinkclass for structured logging of detection data.Testing
The
JSONSinkclass was validated through a series of unit tests, covering:A demo script demonstrates the class's usage within a video processing workflow, annotating video frames and logging detections to a JSON file. Demo Here
Documentation Updates
JSONSinkclass documentation within the module, detailing its purpose, usage, and example usage.JSONSinkclass.