vijendra1125/Custom-Mask-RCNN-Using-Tensorfow-Object-Detection-API

I have issue in generating tf record for multiple mask of same class in a image

adeebakausar opened this issue · 6 comments

I have the dataset which have multiple mask of one class in a image,how i modified the create_mask_rcnn_tf_record.py in this scenario: but actually create_mask_rcnn_tf_record.py save the one mask of same class per image like
path=dataset1/label.pbtxt image1 bounding box for MotorBike 484.0 639.0 181.0 303.0

my mask example is here
image1

please help me to generate the tf record form mask in case of multiple boundary box problem.

Hi,

The given approach in _create_mask_rcnn_tf_record.py to find out bounding box around objects in mask image works as follow:
It checks for min and max index of pixel with the value of class mask color along width and height of mask image. Next, it find the location of bounding box using min and max found in last step.
Pros: it removes the dependency on additional annotation for bounding box, just mask annotation is enough.
Cons: It cant handle multiple object of same class in the given image.
Solution: annotate bounding boxes speartely using some too like labelImg and then modify create_mask_rcnn_tf_record.py to take bounding box from generated xml files (from labelImg )instead of trying to find out from mask image.

Can you help me by uploading the "Modified" file .

i have csv files for train and test data, Can i use it to create tf record for mask_rcnn_inception_v2_coco .please explain it how i can use it.
Train csv file:
Tesy csv file

I have updated the repository to handle multiple objects of the same class while generating the tfrecord file. I hope it will be helpful. go through README for detail.