Skip to content

Fix coco stream parsing #1753

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

Merged
merged 3 commits into from
Apr 25, 2025

Conversation

djdameln
Copy link
Contributor

Summary

This PR fixes an issue causing coco dataset parsing to fail in stream mode when the annotations json contains additional, unused keys. To achieve this, the PR adds a non-strict mode to the JsonPageMapper in the rust API, and uses it in the CocoPageMapper to allow and ignore unknown keys. With these changes, the behaviour of COCO parsing is now similar between stream mode and non-stream mode.

Changes:

  • Adds strict argument to JsonPageMapper
  • Enable strict mode for CocoPageMapper, while disabling it for other page mapper classes.
  • Adds skip_serde_json_value function to rust/src/utils.rs
  • Add unit test to confirm that unknown keys are ignored.

How to test

Checklist

  • I have added unit tests to cover my changes.​
  • I have added integration tests to cover my changes.​
  • I have added the description of my changes into CHANGELOG.​
  • I have updated the documentation accordingly

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below).
# Copyright (C) 2025 Intel Corporation
#
# SPDX-License-Identifier: MIT

@sovrasov sovrasov merged commit 3f4a9b5 into open-edge-platform:develop Apr 25, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants