gist-ailab / uoais

Codes of paper "Unseen Object Amodal Instance Segmentation via Hierarchical Occlusion Modeling", ICRA 2022
Other
125 stars 27 forks source link

how to label my own data #14

Closed quanw8781 closed 1 year ago

quanw8781 commented 2 years ago

how to label my own data

YueBro commented 2 years ago

Do you mean to load the data into a format in order to run the training pipeline?

quanw8781 commented 2 years ago

Do you mean to load the data into a format in order to run the training pipeline?

Well,I mean how to use the labelme to label my data and then load the data into a format in order to run the training pipeline.Thank you.

YueBro commented 2 years ago

I think if you convert any dataset into the following format, it should work in training:

datasets: list = [
    {
        "file_name": str,
        "depth_file_name": str,
        "height": img_height,
        "width": img_width,
        "image_id": int,
        "annotations": [
            {
                "iscrowd": 0,
                "bbox": [x, y, w, h],
                "category_id": 0,
                "segmentation": {"size": [img_width, img_height], "count": rle_string},    # Created using pycocotools.mask.encode()
                "visible_mask": {"size": [img_width, img_height], "count": rle_string},    # Created using pycocotools.mask.encode()
                "occluded_mask": {"size": [img_width, img_height], "count": rle_string},    # Created using pycocotools.mask.encode()
                "occluded_rate": float,
                "bbox_mode": BoxMode.XYWH_ABS,        # from detectron2.structures import BoxMode
            }, ...
        ]
    }, ...
]

Use detectron2.data.DatasetCatalog.register() to register the function which outputs the format above.

I hope this could help :)

SeungBack commented 1 year ago

I believe the issue has been resolved, and I am closing this now. Thanks to @YueBro for addressing it.