Skip to content

Fix coco stream parsing#1753

Merged
sovrasov merged 3 commits intoopen-edge-platform:developfrom
djdameln:fix-coco-stream-parsing
Apr 25, 2025
Merged

Fix coco stream parsing#1753
sovrasov merged 3 commits intoopen-edge-platform:developfrom
djdameln:fix-coco-stream-parsing

Conversation

@djdameln
Copy link
Copy Markdown
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