facebookresearch / detectron2

Detectron2 is a platform for object detection, segmentation and other visual recognition tasks.
https://detectron2.readthedocs.io/en/latest/
Apache License 2.0
30.1k stars 7.42k forks source link

custom_dataset using train_net.py #1093

Closed Kevin-Delnoije closed 4 years ago

Kevin-Delnoije commented 4 years ago

Hey I succesfully added a custom dataset in a jupyter notebook using the steps below. (mostly following the balloon tutorial notebook)

Now i am trying to move the code out of a jupyter notebook into a similar training script as train_net.py the confusing part for me is where the coco/lvis/pascal are normally registered and what setup magic is hidden behind default_setup(cfg, args)

It is possible to use the same steps as in the notebook, but if possible I would like to modify the train_net.py as little as possible so i can enjoy the nice default settings :)

ppwwyyxx commented 4 years ago

You can register the dataset in train_net.py the same way as in the notebook - I'm not sure what exactly you're trying to ask.

default_setup is documented in the API docs: https://detectron2.readthedocs.io/modules/engine.html#detectron2.engine.defaults.default_setup

Kevin-Delnoije commented 4 years ago

I don't know how the coco dataset is registered in train_net.py and i would like to understand that

ppwwyyxx commented 4 years ago

It's automatically registered by default by detectron2 at https://github.com/facebookresearch/detectron2/blob/125e4ff9d2e628a2d9db77e787570093c1ecf522/detectron2/data/datasets/builtin.py#L217