mmdetection icon indicating copy to clipboard operation
mmdetection copied to clipboard

How to use multiple ann_file in coco_instance?

Open ccomkhj opened this issue 1 year ago • 6 comments

train_dataloader = dict(
    batch_size=2,
    num_workers=2,
    persistent_workers=True,
    sampler=dict(type='DefaultSampler', shuffle=True),
    batch_sampler=dict(type='AspectRatioBatchSampler'),
    dataset=dict(
        type=dataset_type,
        data_root=data_root,
        ann_file=[
            data_root + "/mmdet/train/train_20230327.json",
            data_root + "/mmdet/train/train_20230213.json",
            data_root + "/mmdet/train/train.json",
        ]
        data_prefix=dict(img=data_root + "/mmdet/train/images/"),
        filter_cfg=dict(filter_empty_gt=True, min_size=32),
        pipeline=train_pipeline,
        backend_args=backend_args))

At the new version of mm-series, list of coco json files are not supported. What's the appropriate config?

ccomkhj avatar Jun 17 '23 13:06 ccomkhj

@ccomkhj did you solve this ?

I believe this line is the source of the issue, which assumes the ann_file and data_prefix['img'] are two str, instead of list.

KleinYuan avatar Jun 29 '23 01:06 KleinYuan

@KleinYuan I couldn't solve this issue. Currently I merge coco file everytime, but I really hope that there's update to deal with multiple coco files.

ccomkhj avatar Jun 29 '23 18:06 ccomkhj

train_dataloader = dict(
    batch_size=2,
    num_workers=2,
    persistent_workers=True,
    sampler=dict(type='DefaultSampler', shuffle=True),
    batch_sampler=dict(type='AspectRatioBatchSampler'),
    dataset=dict(
        type=dataset_type,
        data_root=data_root,
        ann_file=[
            data_root + "/mmdet/train/train_20230327.json",
            data_root + "/mmdet/train/train_20230213.json",
            data_root + "/mmdet/train/train.json",
        ]
        data_prefix=dict(img=data_root + "/mmdet/train/images/"),
        filter_cfg=dict(filter_empty_gt=True, min_size=32),
        pipeline=train_pipeline,
        backend_args=backend_args))

At the new version of mm-series, list of coco json files are not supported. What's the appropriate config?

Hi, may I ask that, dose version mmdet==2.26.0 support multipul coco anno files?

NorthSummer avatar Jul 11 '23 04:07 NorthSummer

train_dataloader = dict(
    batch_size=2,
    num_workers=2,
    persistent_workers=True,
    sampler=dict(type='DefaultSampler', shuffle=True),
    batch_sampler=dict(type='AspectRatioBatchSampler'),
    dataset=dict(
        type=dataset_type,
        data_root=data_root,
        ann_file=[
            data_root + "/mmdet/train/train_20230327.json",
            data_root + "/mmdet/train/train_20230213.json",
            data_root + "/mmdet/train/train.json",
        ]
        data_prefix=dict(img=data_root + "/mmdet/train/images/"),
        filter_cfg=dict(filter_empty_gt=True, min_size=32),
        pipeline=train_pipeline,
        backend_args=backend_args))

At the new version of mm-series, list of coco json files are not supported. What's the appropriate config?

Hi, may I ask that, dose version mmdet==2.26.0 support multipul coco anno files?

Yes, it does.

KleinYuan avatar Jul 11 '23 15:07 KleinYuan

Greetings! Is there any update on this issue?

jeohalves avatar Apr 19 '24 14:04 jeohalves

Greetings! Is there any update on this issue?

I created another solution to merge coco sustainably. https://github.com/ccomkhj/cvops

ccomkhj avatar Apr 20 '24 19:04 ccomkhj