chenhang98 / BPR

code for `Look Closer to Segment Better: Boundary Patch Refinement for Instance Segmentation`
Apache License 2.0
173 stars 23 forks source link

How to test with our own datas? #10

Closed xinzi2018 closed 2 years ago

xinzi2018 commented 3 years ago

If I want to use my own coarse-mask datasets for testing, do I need to use "https://github.com/open-mmlab/mmdetection/tree/master/configs/cityscapes" to generate maskrcnn_val/maskrcnn_test first?

xinzi2018 commented 3 years ago

image

chenhang98 commented 3 years ago

Yes. Note that our method is post-processing, so you first need to have segmentation results of an arbitrary instance segmentation model. You can use Mask R-CNN, or any other model.

xinzi2018 commented 3 years ago

The picture I showed above is the parsing I got, but I don’t know how to use your code to run it smoothly, because you have entered many other file paths in your tools/inference.sh test file, such as GT_JSON=datasets/cityscapes/annotations/instancesonly_filtered_gtFine_val.json \

///////////////////////////////////////////////////////////////////////////////////// IOU_THRESH=0.55 \ IMG_DIR=/raid/home/dailingna/datasets/cityscapes/leftImg8bit/val/ \ GT_JSON=/raid/home/dailingna/datasets/cityscapes/annotations/instancesonly_filtered_gtFine_val.json \ BPR_ROOT=. \ GPUS=4 \ sh tools/inference.sh configs/bpr/hrnet48_256.py checkpoints/hrnet48_256-cbf4922c.pth maskrcnn_val maskrcnn_val_refined3

I ran this command successfully.

chenhang98 commented 3 years ago

It is recommended that you first process the dataset into the cityscapes format. The instancesonly_filtered_gtFine_val.json in cityscapes is used to provide image and category information.

chenhang98 commented 3 years ago

By the way, our pre-trained model may not be suitable for processing other datasets.

lixuekai2001 commented 2 years ago

Yes. Note that our method is post-processing, so you first need to have segmentation results of an arbitrary instance segmentation model. You can use Mask R-CNN, or any other model.

I see your model is pytorch based. But my instance segmentation is generated from Matterport Mask RCNN which is tensorflow/keras version. Do they work together?

chenhang98 commented 2 years ago

Yes, as long as the result format is consistent. See https://github.com/tinyalpha/BPR#prepare-patches-dataset-optional for details.

lixuekai2001 commented 2 years ago

By the way, our pre-trained model may not be suitable for processing other datasets. How can we train our own datasets?

chenhang98 commented 2 years ago

@lixuekai2001 You can convert the dataset to the cityscape format, and then follow https://github.com/tinyalpha/BPR#training

keynecky commented 2 years ago

@lixuekai2001 You can convert the dataset to the cityscape format, and then follow https://github.com/tinyalpha/BPR#training

If I want to use inference_coco.sh to inference on my own coarse masks, do I need to replace the IMG_DIR and GT_JSON with my own datasets? Or keep these args unchanged?

chenhang98 commented 2 years ago

@keynecky Yes, you need to replace them with your own ones.

Ocean-ZHY commented 2 years ago

How did you convert to maskval, I don’t know how to convert, and the naming rules for conversion, can you tell me? thanks