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

Add label check on import #2935

Merged
merged 5 commits into from
Mar 19, 2021
Merged

Add label check on import #2935

merged 5 commits into from
Mar 19, 2021

Conversation

zhiltsov-max
Copy link
Contributor

@zhiltsov-max zhiltsov-max commented Mar 10, 2021

Motivation and context

  • Added more informative error output for annotation import errors (image name, annotation index, annotation type)
  • Added a check for empty label

How has this been tested?

Manually

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.
  • I have updated the license header for each file (see an example below)
# Copyright (C) 2021 Intel Corporation
#
# SPDX-License-Identifier: MIT

@coveralls
Copy link

coveralls commented Mar 10, 2021

Coverage Status

Coverage increased (+0.02%) to 72.235% when pulling 8d81cd1 on zm/add-no-label-import-check into 9f7d181 on develop.

for idx, ann in enumerate(item.annotations):
try:
if hasattr(ann, 'label') and ann.label is None:
raise CvatImportError("annotation has no label")
Copy link
Contributor

Choose a reason for hiding this comment

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

If it isn't the only way to raise the exception inside try/except block, probably you want to remove try/except in the case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It isn't, but the idea is to provide an informative wrapper for better investigation experience.

@nmanovic nmanovic merged commit 2c5188f into develop Mar 19, 2021
@nmanovic nmanovic deleted the zm/add-no-label-import-check branch March 19, 2021 10:56
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