-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Can not show custom data correctly. #4727
Comments
Hi @feiyuhuahuo, thank you for your feedback.
dataset_type = 'CocoDataset'
classes = ('balloon', )
Thank you! |
About the |
Writing a mmdetection/mmdet/datasets/coco.py Line 58 in af95704
|
Your understanding is incorrect. This parameter will be modified during the initialization in CustomDataset |
mmdetection/tools/misc/browse_dataset.py Line 67 in af95704
I've taken a look at this line. The classes is in the whole config, but is missed in cfg.data.train . Did I make something wrong? |
Can you provide the complete config file content? |
The whole config.
|
Hi, Your config settings are incorrect. The correct config is as follows train=dict(
type=dataset_type,
classes=classes, #==========
ann_file=data_root + 'annotations/haiboguan_train.json',
img_prefix=data_root + 'train/',
pipeline=train_pipeline),
val=dict(
type=dataset_type,
classes=classes, #==========
ann_file=data_root + 'annotations/haiboguan_val.json',
img_prefix=data_root + 'val/',
pipeline=test_pipeline),
test=dict(
type=dataset_type,
classes=classes, #==========
ann_file=data_root + 'annotations/haiboguan_val.json',
img_prefix=data_root + 'val/',
pipeline=test_pipeline)) |
Thanks, it works. |
My mmdetection version is 2.10.0. Following this guidance(https://github.com/open-mmlab/mmdetection/blob/master/docs/2_new_data_model.md), I prepared my custom dataset as a coco-style json. But I found the code can not read my data correctly. Because the
CLASSES
is fixed,mmdetection/mmdet/datasets/coco.py
Line 32 in af95704
so adding a custom class variable in the config file is useless.
All my images were filtered because of the incorrect classes.
Besides, I did not found the
class
variable in the default config.I finally fixed this error by writing a custom
Dataset
. I tried to show my data by:python tools/misc/browse_dataset.py [config]
, but the showed image was broken:I guess this is because my image is PNG file. But PNG format is important. In industry environment, images are usually in this format because of its lossless property. I haven't fixed this yet. Hope you can help me, thanks.
Additionally, I have a personal suggestion. Maybe it's better to open this
min_size
in config file. Or in some small object detection task, target maybe filtered.mmdetection/mmdet/datasets/coco.py
Line 98 in af95704
The text was updated successfully, but these errors were encountered: