rf-detr icon indicating copy to clipboard operation
rf-detr copied to clipboard

COCO custom path

Open BartvanMarrewijk opened this issue 3 months ago • 1 comments

Search before asking

  • [x] I have searched the RF-DETR issues and found no similar feature requests.

Description

Currently the path of COCO is hardcoded. This does make sense for training original coco dataset. Many users are working on custom coco datasets. The code currently force you to use following paths:

    PATHS = {
        "train": (root / "train2017", root / "annotations" / f'{mode}_train2017.json'),
        "val": (root /  "val2017", root / "annotations" / f'{mode}_val2017.json'),
        "test": (root / "test2017", root / "annotations" / f'image_info_test-dev2017.json'),
    }

To my opinion this does not make sense for people training on custom COCO datasets because it means everyone will include _train2017 in the json. Suggestion:

Add a custom coco dataset or make current coco loader flexible by for example addings the PATHS dict in args. with the example below (in coco.py) everyone can use coco regardless the name of json files or subfolders.

    PATHS = args.path
    img_folder, ann_file = PATHS[image_set.split("_")[0]]
    img_folder = root / img_folder
    ann_file = root / ann_file

Use case

No response

Additional

No response

Are you willing to submit a PR?

  • [ ] Yes I'd like to help by submitting a PR!

BartvanMarrewijk avatar Aug 12 '25 07:08 BartvanMarrewijk

@SkalskiP amy thoughts ?

isaacrob-roboflow avatar Aug 12 '25 15:08 isaacrob-roboflow