如何使用51来探索自定义coco数据的实例分割?它有coco数据集的文档,但是我找不到定制coco数据集的任何资源。
发布于 2022-02-11 04:29:25
这可以通过使用COCODetectionDatasetImporter类和设置label_types=["detections","segmentations"]来查看掩码注释的图像来完成。
发布于 2022-03-21 15:55:14
您可以找到导入自定义COCODetectionDatasets 这里的文档。
简而言之,只要您的数据遵循预期的COCO格式:
{
"info": {...},
"licenses": [
{
"id": 1,
"name": "Attribution-NonCommercial-ShareAlike License",
"url": "http://creativecommons.org/licenses/by-nc-sa/2.0/",
},
...
],
"categories": [
...
{
"id": 2,
"name": "cat",
"supercategory": "animal",
"keypoints": ["nose", "head", ...],
"skeleton": [[12, 14], [14, 16], ...]
},
...
],
"images": [
{
"id": 1,
"license": 1,
"file_name": "<filename0>.<ext>",
"height": 480,
"width": 640,
"date_captured": null
},
...
],
"annotations": [
{
"id": 1,
"image_id": 1,
"category_id": 2,
"bbox": [260, 177, 231, 199],
"segmentation": [...],
"keypoints": [224, 226, 2, ...],
"num_keypoints": 10,
"score": 0.95,
"area": 45969,
"iscrowd": 0
},
...
]
}分段字段格式定义为这里。
然后,您可以使用以下Python代码将其加载到FiftyOne中:
import fiftyone as fo
name = "my-dataset"
dataset_dir = "/path/to/coco-detection-dataset"
# Create the dataset
dataset = fo.Dataset.from_dir(
dataset_dir=dataset_dir,
dataset_type=fo.types.COCODetectionDataset,
name=name,
)
# View summary info about the dataset
print(dataset)
# Print the first few samples in the dataset
print(dataset.head())https://stackoverflow.com/questions/71074610
复制相似问题