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

add custom dataset example #187

Merged

Conversation

zengzhaoyang
Copy link
Collaborator

@zengzhaoyang zengzhaoyang commented Jan 11, 2023

Simple Tutorial

Training your own dataset with detrex models, all you need to do is to convert your dataset into coco format and register your dataset in config file as:

# coco_detr.py

from detectron2.data.datasets import register_coco_instances
register_coco_instances("my_dataset_train", {}, '/path/to/train.json', '/path/to/train/images')
register_coco_instances("my_dataset_test", {}, '/path/to/test.json', '/path/to/test/images')

Then modify the dataloader config:

dataloader.train = L(build_detection_train_loader)(
    dataset=L(get_detection_dataset_dicts)(names="my_dataset_train"),
    ...

dataloader.test = L(build_detection_test_loader)(
    dataset=L(get_detection_dataset_dicts)(names="my_dataset_test", filter_empty=False),
    ...

@rentainhe rentainhe merged commit 3170105 into IDEA-Research:main Jan 11, 2023
Lontoone pushed a commit to Lontoone/detrex that referenced this pull request Jan 8, 2024
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

Successfully merging this pull request may close these issues.

2 participants