Skip to content
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

Could u please give the training steps on my own datasets? #7

Closed
noobgrow opened this issue Apr 11, 2019 · 4 comments
Closed

Could u please give the training steps on my own datasets? #7

noobgrow opened this issue Apr 11, 2019 · 4 comments

Comments

@noobgrow
Copy link

noobgrow commented Apr 11, 2019

Dear sir:
I'm really interested in your fantastic work,
Could u please give the training steps on my own datasets?
Thanks a lot!~

@dbolya
Copy link
Owner

dbolya commented Apr 11, 2019

I'll be adding custom dataset support soon. I'm currently travelling so I can't do it right now, but I'll follow up when I can.

@hwh-hit
Copy link

hwh-hit commented Apr 26, 2019

Need the training steps on my own datasets too.

@wlsonia
Copy link

wlsonia commented Apr 29, 2019

I also need the training steps on my own datasets.

@dbolya
Copy link
Owner

dbolya commented Apr 30, 2019

So uh that turned out to be a lot longer than "soon", but I finally added support for custom datasets (latest commit). I've updated the readme with directions, but I'll paste them here for convenience:

  • Create a COCO-style Object Detection JSON annotation file for your dataset. The specification for this can be found here. Note that we don't use some fields, so the following may be omitted:
    • info
    • liscense
    • Under image: license, flickr_url, coco_url, date_captured
    • categories (we use our own format for categories, see below)
  • Create a definition for your dataset under dataset_base in data/config.py (see the comments in dataset_base for an explanation of each field):
my_custom_dataset = dataset_base.copy({
    'name': 'My Dataset',

    'train_images': 'path_to_training_images',
    'train_info':   'path_to_training_annotation',

    'valid_images': 'path_to_validation_images',
    'valid_info':   'path_to_validation_annotation',

    'has_gt': True,
    'class_names': ('my_class_id_1', 'my_class_id_2', 'my_class_id_3', ...)
})
  • A couple things to note:
    • Class IDs in the annotation file should start at 1 and increase sequentially on the order of class_names. If this isn't the case for your annotation file (like in COCO), see the field label_map in dataset_base.
    • If you do not want to create a validation split, use the same image path and annotations file for validation. By default (see python train.py --help), train.py will output validation mAP for the first 5000 images in the dataset every 2 epochs.
  • Finally, in yolact_base_config in the same file, change the value for 'dataset' to 'my_custom_dataset' or whatever you named the config object above. Then you can use any of the training commands in the previous section.

Note that I haven't done a lot of testing with this, so I might have broken some things. Let me know if you have any issues with this and I'll get back to you within my stellar, industry-leading 19 day response window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants