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

Allow registering pascal voc dataset with custom class names #1603

Closed
wants to merge 3 commits into from
Closed

Allow registering pascal voc dataset with custom class names #1603

wants to merge 3 commits into from

Conversation

pakornvs
Copy link
Contributor

Relate: #991

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 15, 2020
Copy link
Contributor

@ppwwyyxx ppwwyyxx left a comment

Choose a reason for hiding this comment

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

Please change the title to "Allow registering pascal voc dataset with custom class names".

This does not necessarily allow "custom pascal voc dataset" -- it seems everyone's "custom pascal voc dataset" is customized in different ways.

@@ -21,7 +21,7 @@
# fmt: on


def load_voc_instances(dirname: str, split: str):
def load_voc_instances(dirname: str, split: str, class_names: list):
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be List[str] with from typing import List.
Documentation is missing.

MetadataCatalog.get(name).set(
thing_classes=CLASS_NAMES, dirname=dirname, year=year, split=split
)
def register_pascal_voc(name, dirname, split, class_names=CLASS_NAMES, **kwargs):
Copy link
Contributor

@ppwwyyxx ppwwyyxx Jun 17, 2020

Choose a reason for hiding this comment

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

Please keep year since it's required for evaluation.

Don't use mutable default: https://docs.python-guide.org/writing/gotchas/#mutable-default-arguments . Best way is to change CLASS_NAMES to a tuple.

@pakornvs pakornvs changed the title Allow user to register custom pascal voc dataset Allow registering pascal voc dataset with custom class names Jun 18, 2020
@pakornvs pakornvs requested a review from ppwwyyxx June 18, 2020 16:30
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@ppwwyyxx has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@ppwwyyxx merged this pull request in e845b40.

@pakornvs pakornvs deleted the custom-pascal-voc branch June 19, 2020 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants