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 Wider Face format support #65

Merged
merged 5 commits into from
Dec 16, 2020
Merged

Add Wider Face format support #65

merged 5 commits into from
Dec 16, 2020

Conversation

yasakova-anastasia
Copy link

@yasakova-anastasia yasakova-anastasia commented Dec 14, 2020

Summary

Added support for Wider Face format

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) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT


class WiderExtractor(SourceExtractor):
def __init__(self, path):
assert osp.isfile(path), path
Copy link
Contributor

Choose a reason for hiding this comment

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

It is better to provide some meaningful error message.

Importer, SourceExtractor)


class WiderPath:
Copy link
Contributor

@zhiltsov-max zhiltsov-max Dec 14, 2020

Choose a reason for hiding this comment

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

I think Wider is not clear enough, and suggest using Widerface instead.

README.md Outdated
@@ -1,4 +1,4 @@
# Dataset Management Framework (Datumaro)
d# Dataset Management Framework (Datumaro)
Copy link
Contributor

Choose a reason for hiding this comment

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

Extra symbols.

item_id = image[:-(len(WiderPath.IMAGE_EXT) + 1)]

bbox_count = lines[image_id + 1]
bbox_lines = lines[image_id + 2:image_id + 2 + int(bbox_count)]
Copy link
Contributor

@zhiltsov-max zhiltsov-max Dec 14, 2020

Choose a reason for hiding this comment

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

Please, maintain the formatting:

  • spaces in slices and function args
  • ascending direction in comparisons (<, <=)

for item in subset:
wider_annotation += '%s\n' % (item.id + WiderPath.IMAGE_EXT)
if self._save_images:
self._save_image(item, osp.join(save_dir, subset_dir,
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, add .image existence check with .has_image.

Copy link
Author

Choose a reason for hiding this comment

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

Why add this check if it already exists in _save_image?

Copy link
Contributor

Choose a reason for hiding this comment

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

_save_image checks for image data, but it expects an image. It is possible that input data does not have image info at all, just annotations. A good question, though. Maybe, this check is worth adding there as well.

zhiltsov-max
zhiltsov-max previously approved these changes Dec 15, 2020
@zhiltsov-max zhiltsov-max merged commit 0e48bb8 into develop Dec 16, 2020
@zhiltsov-max zhiltsov-max deleted the ay/add-wider branch January 5, 2021 20:08
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