[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New function [JSONSink] - Allowing to serialise Detections to a JSON file #819

Merged

Conversation

AdonaiVera
Copy link
Contributor

Description

This PR introduces the JSONSink class 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:

  • JSONSink class implementation.
  • Comprehensive unit tests for the class.
  • A demo showcasing the integration of JSONSink with a video processing pipeline.

Note: The JSONSink class 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

  • New feature: Added JSONSink class for structured logging of detection data.

Testing

The JSONSink class was validated through a series of unit tests, covering:

  • Logging with various custom data scenarios.
  • Handling of scenarios with no detections.
  • Verification of JSON output format and data integrity.

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

  • Added JSONSink class documentation within the module, detailing its purpose, usage, and example usage.
  • Updated README to include a section on structured detection data logging, introducing the JSONSink class.

@SkalskiP
Copy link
Collaborator

Hi @AdonaiVera 👋🏻 ! I see you submitted both CSVSink and JSONSink PRs. I left comments under CSVSink and assume a large part will be applicable here as well.

I recommend working first together on one of them (CSVSink). Once we are done, you just apply the same changes to the other one. It will be faster this way.

@AdonaiVera AdonaiVera force-pushed the allowing_serialise_detections_json branch from c762c6d to a8e11ae Compare February 2, 2024 21:26
@AdonaiVera
Copy link
Contributor Author

Hi @SkalskiP
I have already implemented the changes and updated the PR. Additionally, I updated the demo.

Please let me know your thoughts on the changes and if you have any further suggestions 🥷

@onuralpszr onuralpszr self-requested a review February 29, 2024 22:55
@onuralpszr onuralpszr added api:detection api:Jsonsink Supervision JSONSink related updates enhancement New feature or request labels Feb 29, 2024
@onuralpszr onuralpszr linked an issue Feb 29, 2024 that may be closed by this pull request
@onuralpszr onuralpszr added this to the version: 0.19.0 milestone Feb 29, 2024
@onuralpszr onuralpszr force-pushed the allowing_serialise_detections_json branch from 3efe0d0 to 7cca51f Compare March 1, 2024 00:12
@onuralpszr onuralpszr force-pushed the allowing_serialise_detections_json branch from 7cca51f to d949631 Compare March 1, 2024 00:17
@onuralpszr
Copy link
Collaborator

@AdonaiVera thank you for your contributions, I see that changes based on CSVSink so it is fine. I merging in. I trimmed couple of commits that so make it cleaner.

@onuralpszr onuralpszr merged commit f55ef90 into roboflow:develop Mar 1, 2024
9 checks passed
@AdonaiVera
Copy link
Contributor Author

Hi @onuralpszr, amazing thank you mi amigo ! 💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api:detection api:Jsonsink Supervision JSONSink related updates enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[JSONSink] - allowing to serialise Detections to a JSON file
3 participants