BPR icon indicating copy to clipboard operation
BPR copied to clipboard

Generating instance segmentation .json file

Open eregen opened this issue 3 years ago • 3 comments

I don't understand how to use mask rcnn on the COCO dataset to generate the coarse segmentation results. I don't see it described this way on the Mask R-CNN repo. What specific step do I take to create the 'mask_rcnn_r50.train.segm.json' dataset? Any clarification would be greatly appreciated!

eregen avatar Jul 14 '22 02:07 eregen

HI, we generated those json files using mmdetection. You can refer to the 6th example in https://mmdetection.readthedocs.io/en/stable/1_exist_data_model.html#examples.

chenhang98 avatar Jul 15 '22 06:07 chenhang98

I still have 2 questions. First, how do you get the mask_rcnn_r50.train.segm.json if mmdet only let's you use mask r-cnn on the validation set? What do you modify in the example to infer on the training set? I thought you couldn't infer on data the network was trained on.

Second, how do we use BPR with images that have no annotations like COCO test set? The inference script you have requires annotation, so what do we change just to get predictions?

eregen avatar Jul 25 '22 21:07 eregen

Hi, for question 1, you can do this by slightly modifying the configure file of mmdet, for example:

data = dict(
    imgs_per_gpu=1,
    workers_per_gpu=2,
    test=dict(
        type=dataset_type,
        ann_file=data_root +
        # 'annotations/instancesonly_filtered_gtFine_test.json',      # inference on test set
        # img_prefix=data_root + 'leftImg8bit/test/',
        # 'annotations/instancesonly_filtered_gtFine_val.json',       # inference on val set
        # img_prefix=data_root + 'leftImg8bit/val/',
        'annotations/instancesonly_filtered_gtFine_train.json',       # inference on train set
        img_prefix=data_root + 'leftImg8bit/train/',
        pipeline=test_pipeline))

For question 2, you can generate a dummy annotation file that does not contain the 'annotations' field. Our script needs this file for information such as image file list and sizes. You can refer to 'instancesonly_filtered_gtFine_test.json' in https://github.com/open-mmlab/mmdetection/blob/master/tools/dataset_converters/cityscapes.py as an example.

chenhang98 avatar Aug 05 '22 08:08 chenhang98

Dear author, hello: The link you provided cannot be opened. Could you please provide a reference link that can be opened?

yuzeWAN avatar Dec 21 '23 06:12 yuzeWAN