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

Improve YOLO parsing errors #687

Merged
merged 30 commits into from
Mar 28, 2022
Merged

Improve YOLO parsing errors #687

merged 30 commits into from
Mar 28, 2022

Conversation

zhiltsov-max
Copy link
Contributor

@zhiltsov-max zhiltsov-max commented Mar 22, 2022

Summary

Depends on #686

  • Added more informative YOLO parsing errors
  • Added more type annotations in extractor
  • Allowed leading spaces in the .data file
  • Added type docs for util.image.ImageMeta

How to test

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

@zhiltsov-max zhiltsov-max changed the title Improve YOLO parsing errors [Dependent] Improve YOLO parsing errors Mar 22, 2022
@zhiltsov-max zhiltsov-max changed the title [Dependent] Improve YOLO parsing errors Improve YOLO parsing errors Mar 28, 2022
Comment on lines +41 to +42
if item is not None:
yield item
Copy link

Choose a reason for hiding this comment

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

This enables questionable semantics: if any items are skipped in this way, then the number of items yielded will be different from the value returned by len(subset).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree about this, but it is not clear how to resolve the problem, and it has very limited ways to impact the situation, because it is only used until the imported dataset is cached. During caching/iteration, the actual count is computed. Actually, in VOC we have the same issue. Maybe, we could even consider it normal, because unless we loaded the data, it is the best we can report.

Copy link

Choose a reason for hiding this comment

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

IMO, the proper solution would involve removing __len__ from IExtractor.

tests/test_yolo_format.py Show resolved Hide resolved
@IRDonch IRDonch merged commit 111f49b into develop Mar 28, 2022
@IRDonch IRDonch deleted the zm/yolo-parsing-errors branch March 28, 2022 15:42
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