-
Notifications
You must be signed in to change notification settings - Fork 9.6k
add detail on doc explain how to make self defined class of custom dataset registed #7906
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
base: master
Are you sure you want to change the base?
Conversation
Please use English or English & Chinese for pull requests so that we could have broader discussion. |
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7906 +/- ##
==========================================
- Coverage 64.71% 64.67% -0.05%
==========================================
Files 351 351
Lines 28461 28461
Branches 4807 4807
==========================================
- Hits 18418 18406 -12
- Misses 9055 9067 +12
Partials 988 988
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
last step, recompile source code | ||
```shell | ||
pip install -r requirements/build.txt | ||
pip install -v -e . # or "python setup.py develop" |
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.
Recompiling is unnecessary. Because mmdet is usually installed with develop
mode. All modifications take effect directly.
@@ -276,7 +276,22 @@ class MyDataset(CustomDataset): | |||
|
|||
def get_ann_info(self, idx): | |||
return self.data_infos[idx]['ann'] | |||
``` | |||
Add MyDataset to `mmdet/datasets/__init__.py` |
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.
Then, we need to import MyDataset
in mmdet/datasets/__init__.py
.
from .my_datasets import MyDataset | ||
|
||
__all__ = [ | ||
# ...... | ||
'OpenImagesDataset', 'OpenImagesChallengeDataset', | ||
# add class name in the end | ||
'MyDataset' | ||
] |
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.
from .builder import DATASETS, PIPELINES, build_dataloader, build_dataset
from .cityscapes import CityscapesDataset
from .coco import CocoDataset
#......
from .my_datasets import MyDataset
__all__ = [
# ......
'OpenImagesDataset', 'OpenImagesChallengeDataset',
# add class name in the end
'MyDataset'
]
Hello, @yestimes Thanks very much for contributing to MMDetection. There are three things need to do before merging.
Regards, |
Hi @yestimes !We are grateful for your efforts in helping improve mmdetection open-source project during your personal time. |
Motivation
按照官方文档在
mmdet/datasets
增加了自定义数据集类,但是总是无法使用,报错该数据集类型不存在,因此增加了如何在自定义数据集类之后的两步,以解决我这样小白可能遇到的问题。第一次pull request,如有不规范之处,还请见谅
Modification
修改了:
docs/en/tutorials/customize_dataset.md
docs/zh_cn/tutorials/customize_dataset.md