lkeab / BCNet

Deep Occlusion-Aware Instance Segmentation with Overlapping BiLayers [CVPR 2021]
https://arxiv.org/abs/2103.12340
MIT License
532 stars 73 forks source link

About data set conversion #8

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hey dear @lkeab Thanks for this work. I want to use BCNet, but I only have about 1000 RGB images and their ground truth images. There is no problem with training with object detection such as Faster R-CNN, but when I try to do it with BCNet or mask-rcnn, I get an error "Cannot find field 'gt_masks' in the given Instances". How can I register dataset with ground truth without json segmentation file? In other words, ground truth is sufficient with RGB images to do instance segmentation, or how can I do it.

Thanks a lot in advance.

lkeab commented 3 years ago

Hi, thanks for your question. I want to be clear about: 1) Is your dataset have gt mask annotation? 2) Do you want to do instance segmentation or just object detection?

This sentence " How can I register dataset with ground truth without json segmentation file? In other words, ground truth is sufficient with RGB images to do instance segmentation" is a little bit confusing for me.

ghost commented 3 years ago

Hey @lkeab Thanks for quick reply, First, I have medical images which have rgb images and corresponding ground truth and bounding boxes (xml files). I want object segmentation (semantic segmentation). So my question is: How can I register data set with ground truth without json segmentation file?, S you know, Detectron accept custom dataset registration via coco json and I dont have json segmentation file (polygon). Thus, I can not register my dataset. Do you have any sugesstion to train BCNet. Thanks in advance.

lkeab commented 3 years ago

Hi, For registering dataset, I think the comments in this file will help. If you meet the "Cannot find field 'gt_masks' in the given Instances, you can delete the corresponding code line for requiring this field. Also, you can refer to the code of some pure detection project based on detectron2 (such as this project for car keypoint detection or FCOS). BCNet requires GT mask annotation during training (maybe you can use saliency detection or some well pretrained model to generate pseudo mask label for training in your case.)

ghost commented 3 years ago

It steel needs json annotation, but I have ground truth mask. If you add a script etc. to register dataset with ground truth it will be perfect.

lkeab commented 3 years ago

Yes, there should be a script convert your gt mask to coco format. This code may help.

ghost commented 3 years ago

Thanks, I am working on it. The point I'm wondering is, can we do register dataset for detectron2 with just ground truth masks, without json annotation? Anyway, thanks again.