COCO dataset in fiftyone labelling problem

1.1k Views Asked by At

Hi guys i am downloading specific part of coco with fiftyone, only "detections" label type. But when i upload the data and label folder to cloud dataset transforming to segmentation polygon labelling what can i do for that?

1

There are 1 best solutions below

0
On

When exporting a dataset in COCO format, the "detections" are written into the JSON file in the COCO format:

    "annotations": [
        {
            "id": 1,
            "image_id": 1,
            "category_id": 2,
            "bbox": [260, 177, 231, 199],
            "score": 0.95,
            "area": 45969,
            "iscrowd": 0
        },
        ...
    ]

You could convert your detections to segmentations in FiftyOne like this:

import fiftyone.utils.labels as foul

detections_field = "detections"
segmentations_field = "segmentations"

foul.objects_to_segmentations(
    dataset,
    detections_field,
    segmentations_field,
)

FiftyOne does not automatically convert detections to a segmentation polygon format when exporting. To what cloud provider are you uploading the dataset? It is likely on that end that the data is being converted.

It would be helpful if you could provide a script to replicate what you are seeing.