-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Feature] Add CustomDataset
#738
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #738 +/- ##
==========================================
+ Coverage 85.03% 86.58% +1.55%
==========================================
Files 123 125 +2
Lines 7604 7700 +96
Branches 1311 1327 +16
==========================================
+ Hits 6466 6667 +201
+ Misses 946 837 -109
- Partials 192 196 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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 update the dataset config of imagenet21k
- please update the Colab notebooks to use the
CustomDataset
.
@@ -131,3 +135,21 @@ class CIFAR100(CIFAR10): | |||
'key': 'fine_label_names', | |||
'md5': '7973b15100ade9c7d40fb424638fde48', | |||
} | |||
CLASSES = [ | |||
'apple', 'aquarium_fish', 'baby', 'bear', 'beaver', 'bed', 'bee', |
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.
the meta info of CLASSES is in our code, it is so long, especially in 'imagenet.py'. It may be better to create a metafile.bin that saves all the CLASSES info. In that way, the code will be purer and users may read our code easily.
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.
Right, I think so too, but move the categories info to another file may cause unexpected problem, especially for deployment.
The code of ImageNet
is short, which is only a CustomDataset
with preset attributes. I think we can keep it.
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.
LGTM.
* Add custom dataset and refactor ImageNet dataset * Add default CLASSES for CIFAR dataset * Add unit tests * Imporve according to comments
Motivation
Our dataset is a little not friendly. Users usually need to format their dataset as the format of
ImageNet
, but it's not intuitive.Modification
In this PR, I add a
CustomDataset
and add detailed docstring.The
CustomDataset
is almost the same astorchvision.datasets.ImageFolder
, but also supportsann_file
.Use cases
ann_file
:Checklist
Before PR:
After PR: