数据集解压后,目录结构:
├── ds#
│ ├── ann
│ └── img
└── meta.json
注:"#" 取[1, 13]。
数据集的下载方法,请参考:Supervisely 人像分割数据集
如果只是想知道如何读取数据库,如何得到mask,请参考:Supervisely 人像分割数据集格式转换
文件和目录描述:
supervisely 中以 Project 为单位,每个 Project 中有若干 dataset。
supervisely 详细格式信息参考:https://docs.supervise.ly/data-organization/import-export/supervisely-format
{
"classes": [
{
"title": "person_poly",
"shape": "polygon",
"color": "#18FF00",
"geometry_config": {}
},
{
"title": "person_bmp",
"shape": "bitmap",
"color": "#FF0099",
"geometry_config": {}
},
{
"title": "neutral",
"shape": "polygon",
"color": "#D2210A",
"geometry_config": {}
}
],
"tags": [
{
"name": "not-marked-people",
"value_type": "none",
"color": "#DF1189"
},
{
"name": "multipart-person",
"value_type": "none",
"color": "#131EEC"
}
]
}
字段描述:
shape 标注示例:
对于每个图像,都有一个带有注释的json文件。
{
"description": "boy",
"name": "brothers-family-siblings-boys-50692",
"tags": [],
"size": {
"height": 800,
"width": 1200
},
"objects": […]
}
字段描述:
对象列表的元素用于描述一个对象,对象的几何形状类型有:
{
"description": "",
"geometryType": "bitmap",
"labelerLogin": "supervisely",
"tags": [],
"classTitle": "person_bmp",
"bitmap": {
"data": "…",
"origin": [
93,
309
]
}
}
字段描述:
你可以使用下面的方法将 bitmap data 数据转换成 numpy
def base64_2_mask(s):
z = zlib.decompress(base64.b64decode(s))
n = np.fromstring(z, np.uint8)
mask = cv2.imdecode(n, cv2.IMREAD_UNCHANGED)[:, :, 3].astype(bool)
return mask
{
"description": "",
"geometryType": "polygon",
"labelerLogin": "supervisely",
"tags": [],
"classTitle": "person_poly",
"points": {
"exterior": [
[
1293,
1026
],
[
1294,
1029
],
…,
[
1293,
1026
]
],
"interior": []
}
}
字段描述: