-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Conversation
There was a problem hiding this 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): |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
Relate: #991