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

SDK: Improve the PyTorch adapter layer #5455

Merged
merged 2 commits into from
Dec 16, 2022

Conversation

SpecLad
Copy link
Contributor

@SpecLad SpecLad commented Dec 13, 2022

  • Make the extractors return tensors instead of Python data structures.
  • Let the user specify custom label IDs.

See the commit messages for more details.

Motivation and context

This adds functionality that I found to be missing while making a demo script for an object detection scenario.

How has this been tested?

Unit tests and the aforementioned demo script.

Checklist

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.

…ve types

This is more consistent with torchvision models, and lets the
`ExtractBoundingBoxes` outputs to be used directly with the `torchmetrics`
package (or at least the `MeanAveragePrecision` class).
…mapping

The default numbering is generally unpredictable, so it's not especially
useful outside of basic use cases. Given that there's no way to specify
custom indexes for labels on the server side, make it possible on the client
side.

The input dictionary maps label _names_ to indexes, because names is what a
CVAT user would be familiar with. The output dictionary in the `Target`
class still maps label _IDs_, because that's what CVAT uses in the
annotation data models.
@SpecLad SpecLad marked this pull request as ready for review December 13, 2022 14:48
Copy link
Contributor

@nmanovic nmanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nmanovic nmanovic merged commit fa92ccb into cvat-ai:develop Dec 16, 2022
@SpecLad SpecLad deleted the pytorch-improvements branch December 28, 2022 09:37
mikhail-treskin pushed a commit to retailnext/cvat that referenced this pull request Jul 1, 2023
* Make the extractors return tensors instead of Python data structures.
* Let the user specify custom label IDs.
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.

2 participants