数据标注格式
本页介绍 TAO 支持的计算机视觉应用的数据集格式。
图像分类需要一个图像目录,其结构如下,其中每个类都有自己的目录,目录名为类名。train/val/test
的命名约定可以不同,因为每个集合的路径都在 spec 文件中单独指定。有关更多信息,请参阅分类的规范文件部分。
|--dataset_root:
|--train
|--audi:
|--1.jpg
|--2.jpg
|--bmw:
|--01.jpg
|--02.jpg
|--val
|--audi:
|--3.jpg
|--4.jpg
|--bmw:
|--03.jpg
|--04.jpg
|--test
|--audi:
|--5.jpg
|--6.jpg
|--bmw:
|--05.jpg
|--06.jpg
光学检测需要数据集根目录中的图像目录和 CSV 文件。图像目录包含黄金图像(无缺陷的参考图像)和测试图像,用于与黄金图像进行比较,以进行 PCB 缺陷分类。
|--dataset_root:
|--images
|--input:
|--C1.jpg
|--C2.jpg
|--golden:
|--C1.jpg
|--C2.jpg
|--input1:
|--C1.jpg
|--C3.jpg
|--golden1:
|--C1.jpg
|--C3.jpg
|--labels
|-- train.csv
|-- validation.csv
以下是结构描述
images
目录包含以下内容input
:包含要与黄金图像进行比较的输入图像。golden
:包含黄金参考图像。
labels
目录包含用于 SiameseOI 模型与相应类标签进行成对图像输入的 CSV 文件,如下面的标签文件部分所述。
标签文件
SiameseOI/VisualChangeNet-Classification 标签文件是一个 CSV 文件,包含以下字段
|
|
|
|
---|---|---|---|
/path/to/input/image/directory |
/path/to/golden/image/directory |
对象所属的类 | /component/name |
input_path
:包含输入比较图像的目录路径。golden_path
:包含相应黄金参考图像的目录路径。label
:成对图像的标签(对于无缺陷组件,使用 PASS,对于有缺陷组件,使用任何其他特定缺陷类型标签)。object_name
:要比较的组件的名称。对象名称对于输入和黄金图像是相同的,并且表示不带文件扩展名的图像名称。对于每个
object_name
,TAO 支持为 SiameseOI/VisualChangeNet-Classification 模型中要比较的每个输入和黄金图像组合多个 LED 强度、相机角度或不同的传感器输入。有关更多详细信息,请参阅下面的输入映射部分。
这是一个示例标签文件,对应于光学检测格式部分中描述的示例目录结构
|
|
|
|
---|---|---|---|
/dataset_root/images/input/ | /dataset_root/images/golden/ | PASS | C1 |
/dataset_root/images/input/ | /dataset_root/images/golden/ | PASS | C2 |
/dataset_root/images/input1/ | /dataset_root/images/golden1/ | MISSING | C1 |
/dataset_root/images/input1/ | /dataset_root/images/golden1/ | PASS | C3 |
在标签文件中,确保将无缺陷样本始终如一地标记为 PASS
,而有缺陷样本可以分配任何特定的缺陷类型标签。该模型旨在将所有缺陷统一处理,并进行二元缺陷分类训练。
输入映射
为了在 Siamese 网络中进行比较,SiameseOI 和 VisualChangeNet-Classification 模型支持为 object_name
下指定的每个组件组合几种照明条件 (1…N),用于输入和黄金图像。支持以下 concat_type
模式
linear
:线性连接 (1 x N)grid
:网格连接 (M x N)
SiameseOI/VisualChangeNet-Classification 数据加载器将实验 spec 中 input_map
下指定的每个照明条件的名称附加到 CSV 文件中使用 object_name
指定的每个组件。这对于输入和黄金图像都是如此。以下是数据集实验 spec 更改的示例,用于将四种输入照明条件组合为每个 object_name
内组件的 1x4 线性网格。数据加载器将 input_map
下指定的 4 种照明条件中的每一种附加到每个 object_name
以获得完整的图像路径。然后将这些合并为输入和黄金图像的 1x4 网格。
dataset:
num_input: 4
concat_type: linear
input_map:
LowAngleLight: 0
SolderLight: 1
UniformLight: 2
WhiteLight: 3
数据集还支持每个 object_name
下指定的每个组件的单个照明条件,作为 SiameseOI/VisualChangeNet-Classification 模型的输入。在这种情况下,SiameseOI/VisualChangeNet-Classification 数据加载器不会向 object_name
附加任何内容。以下是单个照明条件的数据集实验 spec 更改示例,其中 object_name
表示图像名称
dataset:
num_inputs: 1
input_map: null
VisualChangeNet-Segmentation 需要数据集根目录中的图像目录和掩码文件。图像目录由黄金图像目录(更改前图像)和测试图像目录(更改后图像)组成,用于与像素级变化掩码的变化掩码图像进行比较。
|--dataset_root:
|--A
|--image1.jpg
|--image2.jpg
|--B
|--image1.jpg
|--image2.jpg
|--label
|--image1.jpg
|--image2.jpg
|--list
|-- train.txt
|-- val.txt
|-- test.txt
|-- predict.txt
以下是结构描述
dataset_root
目录包含以下内容A
:包含更改后的测试图像。B
:包含更改前的黄金参考图像。label
:包含地面实况分割变化掩码。list
:包含每个数据集分割的 .txt 文件,如下面的列表文件部分所述。
列表文件
VisualChangeNet-Segmentation 数据加载器需要 label
目录包含每个数据集分割 [train、validation、test、inference] 的 .txt
文件。VisualChangeNet-Segmentation 标签文件是一个简单的 .txt
文件,其中包含特定分割的所有文件名。
|
---|
file_name.png |
image_names
:图像的名称。对于测试图像及其对应的参考图像和掩码图像,请使用相同的图像名称。
这是一个示例标签文件,对应于变化检测(分割)格式部分中描述的示例目录结构。
|
---|
image1.png |
image3.png |
image2.png |
为了正确映射它们,每个测试图像(在目录 A
内)必须具有同名的参考图像(在目录 B
内)和分割变化图(在目录 label
内),以供数据加载器使用。
CenterPose 需要数据集根目录中的图像目录和 JSON 文件。CenterPose 是一种类别级对象姿态估计方法,它在一个对象类别上进行训练和评估。
训练目录由图像及其相关的 JSON 文件组成,它们使用相同的文件名。测试/评估目录也由图像及其相关的 JSON 文件组成,这些文件使用地面实况来计算准确率。推理目录只能包含没有 JSON 文件的推理图像。校准信息需要在 .yaml 文件中提供。
|--dataset_root_category:
|--train
|--image1.jpg
|--image1.json
|--image2.jpg
|--image2.json
|--test/val
|--image1.jpg
|--image1.json
|--image2.jpg
|--image2.json
|--inference
|--image1.jpg
|--image2.jpg
以下是结构描述
dataset_root_category
目录包含特定类别的以下文件夹train
:包含训练图像和 JSON 文件。test/val
:包含测试/验证图像和 JSON 文件。inference
:包含推理图像。
列表文件
CenterPose 数据加载器需要每个数据集分割 [train、validation、test] 的 .json
文件,这些文件提供校准信息和地面实况。
这是一个数据集分割 [train、validation、test] 的示例目录结构。
|
---|
file_name.png |
file_name.json |
image_names
:图像和 JSON 文件的名称。图像名称必须与其对应的地面实况 JSON 图像相同。
对于推理数据集分割,CenterPose 数据加载器仅需要推理图像,并且内在矩阵从配置 .yaml
文件加载。
以下是数据集分割 [inference] 的示例目录结构
|
---|
image1.png |
image2.png |
为了正确计算准确率,请确保提供并验证了校准信息。
图像分类需要一个图像目录,其结构如下,其中每个类都有自己的目录,目录名为类名。train/val/test
的命名约定可以不同,因为每个集合的路径都在 spec 文件中单独指定。有关更多信息,请参阅分类 PyT 的规范文件部分。在以下示例中,train、evaluate 和 test 的相应路径在 data_prefix
中
|--data_root:
|--train
|--audi:
|--1.jpg
|--2.jpg
|--bmw:
|--01.jpg
|--02.jpg
|--val
|--audi:
|--3.jpg
|--4.jpg
|--bmw:
|--03.jpg
|--04.jpg
|--test
|--audi:
|--5.jpg
|--6.jpg
|--bmw:
|--05.jpg
|--06.jpg
可选地,如果图像不在上述结构中,则可以提供额外的注释文件。对于像这样的图像结构
train/
├── folder_1
│ ├── xxx.png
│ ├── xxy.png
│ └── ...
├── 123.png
├── nsdf3.png
└── ...
注释文件记录所有样本路径和相应的类别索引。第一列是相对于文件夹(在本例中为“train”)的图像路径,第二列是类别索引
folder_1/xxx.png 0
folder_1/xxy.png 1
123.png 1
nsdf3.png 2
有关更多详细信息,请参阅MMPretrain 数据集结构文档。
使用 KITTI 格式需要按以下结构组织数据
.
|--dataset root
|-- images
|-- 000000.jpg
|-- 000001.jpg
.
.
|-- xxxxxx.jpg
|-- labels
|-- 000000.txt
|-- 000001.txt
.
.
|-- xxxxxx.txt
|-- kitti_seq_to_map.json
以下是结构描述
images 目录包含要训练的图像。
labels 目录包含对应图像的标签。此文件的详细信息包含在标签文件部分中。
注意图像和标签在扩展名前具有相同的文件 ID。图像到标签的对应关系通过此文件名维护。
kitti_seq_to_map.json
文件包含图像目录中帧的序列到帧 ID 的映射。这是一个可选文件,如果需要将数据按序列方式拆分为 N 折,则此文件很有用。如果数据要拆分为随机 80:20 train:val 分割,则可以忽略此文件。
对于 DetectNet_v2,train
工具不支持在多个分辨率的图像上进行训练,也不支持在训练期间调整图像大小。所有图像都必须离线调整为最终训练大小,并且相应的边界框必须相应地缩放。在线调整大小适用于其他检测模型架构。
标签文件
KITTI 格式标签文件是一个文本文件,每行包含一个对象。每行有多个字段。以下是这些字段的描述
元素数量 |
参数名称 |
描述 |
类型 |
范围 |
示例 |
---|---|---|---|---|---|
1 | 类名 | 对象所属的类。 | 字符串 | N/A | Person, car, Road_Sign |
1 | 截断 | 对象超出图像边界的程度。 | 浮点数 | 0.0, 0.1 | 0.0 |
1 | 遮挡 | 遮挡状态 [ 0 = 完全可见,1 = 部分可见,2 = 大部分遮挡,3 = 未知 ]。 | 整数 | [0,3] | 2 |
1 | Alpha | 对象的观察角度 | 浮点数 | [-pi, pi] | 0.146 |
4 | 边界框坐标:[xmin, ymin, xmax, ymax] | 对象在图像中的位置 | 浮点数(基于 0 的索引) | [0 到图像宽度],[0 到图像高度], [左上角, 图像宽度], [右下角, 图像高度] | 100 120 180 160 |
3 | 3-D 尺寸 | 对象的高度、宽度、长度(以米为单位) | 浮点数 | N/A | 1.65, 1.67, 3.64 |
3 | 位置 | 3-D 对象在相机坐标系中的位置 x、y、z(以米为单位) | 浮点数 | N/A | -0.65,1.71, 46.7 |
1 | Rotation_y | 围绕相机坐标系 Y 轴的旋转 ry | 浮点数 | [-pi, pi] | -1.59 |
每个对象的元素总数之和为 15。这是一个示例文本文件
car 0.00 0 -1.58 587.01 173.33 614.12 200.12 1.65 1.67 3.64 -0.65 1.71 46.70 -1.59
cyclist 0.00 0 -2.46 665.45 160.00 717.93 217.99 1.72 0.47 1.65 2.45 1.35 22.10 -2.35
pedestrian 0.00 2 0.21 423.17 173.67 433.17 224.03 1.60 0.38 0.30 -5.87 1.63 23.11 -0.03
这表示图像中有 3 个对象,参数如上所述。对于检测,Toolkit 仅需要填充类名和 bbox 坐标字段。这是因为 TAO 训练管道仅支持类和 bbox 坐标的训练。其余字段可以设置为 0。这是一个自定义标注数据集的示例文件
car 0.00 0 0.00 587.01 173.33 614.12 200.12 0.00 0.00 0.00 0.00 0.00 0.00 0.00
cyclist 0.00 0 0.00 665.45 160.00 717.93 217.99 0.00 0.00 0.00 0.00 0.00 0.00 0.00
pedestrian 0.00 0 0.00 423.17 173.67 433.17 224.03 0.00 0.00 0.00 0.00 0.00 0.00 0.00
序列映射文件
这是一个可选的 JSON 文件,用于捕获 images
目录中的帧与从中提取这些帧的视频序列名称之间的映射。在对数据集进行 N 折分割时,需要此信息。这样,来自一个序列的帧不会在其他折中重复,并且其中一个折可以用于验证。这是一个 JSON 字典文件的示例。
{
"video_sequence_name": [list of strings(frame idx)]
}
这是一个 kitti_seq_to_frames.json
文件的示例,其中包含具有六个序列的示例数据集
{
"2011_09_28_drive_0165_sync": ["003193", "003185", "002857", "001864", "003838",
"007320", "003476", "007308", "000337", "004165", "006573"],
"2011_09_28_drive_0191_sync": ["005724", "002529", "004136", "005746"],
"2011_09_28_drive_0179_sync": ["005107", "002485", "006089", "000695"],
"2011_09_26_drive_0079_sync": ["005421", "000673", "002064", "000783", "003068"],
"2011_09_28_drive_0035_sync": ["005540", "002424", "004949", "004996", "003969"],
"2011_09_28_drive_0117_sync": ["007150", "003797", "002554", "001509"]
}
自 TAO 3.0-22.05 起,所有对象检测模型都支持 COCO 格式。使用 COCO 格式需要按以下结构组织数据
annotation{
"id": int,
"image_id": int,
"category_id": int,
"bbox": [x,y,width,height],
"area": float,
"iscrowd": 0 or 1,
}
image{
"id": int,
"width": int,
"height": int,
"file_name": str,
"license": int,
"flickr_url": str,
"coco_url": str,
"date_captured": datetime,
}
categories[{
"id": int,
"name": str,
"supercategory": str,
}]
下面显示了一个示例 COCO 注释文件
"annotations": [{"area": 702.1057499999998,"iscrowd": 0,"image_id": 289343,"bbox": [473.07,395.93,38.65,28.67],"category_id": 18,"id": 1768}],
"images": [{"license": 1,"file_name": "000000407646.jpg","coco_url": "http://images.cocodataset.org/val2017/000000407646.jpg","height": 400,"width": 500,"date_captured": "2013-11-23 03:58:53","flickr_url": "http://farm4.staticflickr.com/3110/2855627782_17b93a684e_z.jpg","id": 407646}],
"categories": [{"supercategory": "person","id": 1,"name": "person"},{"supercategory": "vehicle","id": 2,"name": "bicycle"},{"supercategory": "vehicle","id": 3,"name": "car"},{"supercategory": "vehicle","id": 4,"name": "motorcycle"}]
有关 COCO 格式的描述,请参阅COCO 网站。
从 1 开始 categories
中的 id
。
ODVG 文件为 JSONL 格式,每行一个 JSON 对象。ODVG 支持对象检测/分割任务或视觉 grounding 任务。
对于对象检测/分割任务,使用 detection
字段编码 instances
,这是一个字典列表,由 :code:`bbox、label
、category
和 mask
组成。通常需要额外的标签映射文件来将 category
映射到相应网络中的类 ID。
{"file_name": "000000391895.jpg",
"height": 360,
"width": 640,
"detection":
{"instances":
[
{"bbox": [359.17, 146.17, 471.62, 359.74],
"label": 3,
"category": "motorcycle",
"mask": [[376.97, 176.91, 398.81, 176.91, 401.24, 312.82, 370.49, 303.92, 391.53, 299.87, 391.73, 184.19]]},
{"bbox": [339.88, 22.16, 493.76, 322.89],
"label": 0,
"category": "person",
"mask": [[352.55, 146.82, 15, 376.15, 164.22, 377.2, 160.35, 378.61, 151.9, 377.55,]]}
]}
}
下面显示了一个标签映射文件的示例
{"0": "person", "1": "bicycle", "2": "car", "3": "motorcycle"}
对于视觉 grounding 任务,使用 grounding`
字段编码 caption
和 regions
。caption
是图像的全局标题。regions
是字典列表,由 phrase
和 bbox
组成
{"file_name": "000000000072.jpg",
"height": 640,
"width": 427,
"grounding":
{"caption": "giraffe on left and RIGHT GIRAFFE",
"regions": [{"bbox": [50.45, 72.07, 283.96, 640.0], "phrase": "giraffe"},
{"bbox": [136.63, 129.44, 425.71, 628.49], "phrase": "giraffe"}]
}}
使用 COCO 格式需要按以下结构组织数据
annotation{
"id": int,
"image_id": int,
"category_id": int,
"segmentation": RLE or [polygon],
"area": float,
"bbox": [x,y,width,height],
"iscrowd": 0 or 1,
}
image{
"id": int,
"width": int,
"height": int,
"file_name": str,
"license": int,
"flickr_url": str,
"coco_url": str,
"date_captured": datetime,
}
categories[{
"id": int,
"name": str,
"supercategory": str,
}]
下面显示了一个示例 COCO 注释文件
"annotations": [{"segmentation": [[510.66,423.01,511.72,420.03,510.45,416.0,510.34,413.02,510.77,410.26,510.77,407.5,510.34,405.16,511.51,402.83,511.41,400.49,510.24,398.16,509.39,397.31,504.61,399.22,502.17,399.64,500.89,401.66,500.47,402.08,499.09,401.87,495.79,401.98,490.59,401.77,488.79,401.77,485.39,398.58,483.9,397.31,481.56,396.35,478.48,395.93,476.68,396.03,475.4,396.77,473.92,398.79,473.28,399.96,473.49,401.87,474.56,403.47,473.07,405.59,473.39,407.71,476.68,409.41,479.23,409.73,481.56,410.69,480.4,411.85,481.35,414.93,479.86,418.65,477.32,420.03,476.04,422.58,479.02,422.58,480.29,423.01,483.79,419.93,486.66,416.21,490.06,415.57,492.18,416.85,491.65,420.24,492.82,422.9,493.56,424.39,496.43,424.6,498.02,423.01,498.13,421.31,497.07,420.03,497.07,415.15,496.33,414.51,501.1,411.96,502.06,411.32,503.02,415.04,503.33,418.12,501.1,420.24,498.98,421.63,500.47,424.39,505.03,423.32,506.2,421.31,507.69,419.5,506.31,423.32,510.03,423.01,510.45,423.01]],"area": 702.1057499999998,"iscrowd": 0,"image_id": 289343,"bbox": [473.07,395.93,38.65,28.67],"category_id": 18,"id": 1768}],
"images": [{"license": 1,"file_name": "000000407646.jpg","coco_url": "http://images.cocodataset.org/val2017/000000407646.jpg","height": 400,"width": 500,"date_captured": "2013-11-23 03:58:53","flickr_url": "http://farm4.staticflickr.com/3110/2855627782_17b93a684e_z.jpg","id": 407646}],
"categories": [{"supercategory": "person","id": 1,"name": "person"},{"supercategory": "vehicle","id": 2,"name": "bicycle"},{"supercategory": "vehicle","id": 3,"name": "car"},{"supercategory": "vehicle","id": 4,"name": "motorcycle"}]
有关 COCO 格式的描述,请参阅COCO 网站。
从 1 开始 categories
中的 id
。
本节介绍 UNet 和 SegFormer 支持的用于加载图像和掩码的数据集格式。
如果您的掩码以 COCO 格式保存,请参阅 :ref: sample_usage_of_the_dataset_converter_tool_unet<Dataset Converter> 以将 COCO 格式转换为 UNet 掩码图像格式。
语义分割掩码格式
本节介绍不同类型的 input_image_type
或 input_type
的掩码图像格式。有关配置 UNet 的 input_image_type
的更多信息,请参阅dataset_config_unet。有关配置 SegFormer 的 input_type
的更多信息,请参阅dataset_config_segformer。
彩色/RGB 输入图像类型
对于彩色/RGB 输入图像,每个掩码图像都是单通道或三通道图像,其大小与输入图像相等。掩码中的每个像素都必须具有一个整数值,该值表示分割类 label_id
,如dataset_config_unet和dataset_config_segformer中提供的映射所示。确保掩码图像中像素的值在dataset_config和dataset_config_segformer中提供的 label_id
值范围内。
有关参考示例,请参阅Cityscapes Dataset中的 _labelIds.png
图像格式。
灰度输入图像类型
对于灰度输入图像,掩码是单通道图像,大小与输入图像相等。每个像素的值为 255 或 0,分别对应于dataset_config和dataset_config_segformer中的 label_id
1 或 0。有关参考,请参阅 ngcresources 中提供的 ISBI 数据集 Jupyter Notebook 示例。
图像和掩码加载格式
SegFormer
对于 SegFormer,图像和掩码文件夹的路径可以直接在dataset_config_segformer中提供。确保图像和相应的掩码名称相同。图像和掩码扩展名不必相同。
UNet
UNet 的结构化图像和掩码文件夹
图像和掩码的数据文件夹结构必须为 UNet 采用以下格式
/Dataset_01
/images
/train
0000.png
0001.png
...
...
N.png
/val
0000.png
0001.png
...
...
N.png
/test
0000.png
0001.png
...
...
N.png
/masks
/train
0000.png
0001.png
...
...
N.png
/val
0000.png
0001.png
...
...
N.png
有关在实验 spec 中配置这些图像和掩码文件夹路径的更多详细信息,请参阅基于文件夹的数据集配置部分。
每个图像和标签在扩展名前具有相同的文件 ID。图像到标签的对应关系通过此文件名维护。上述目录结构中的
test
文件夹是可选的;任何文件夹都可以用于推理。
UNet 的图像和掩码文本文件
图像文本文件必须包含所有图像的完整绝对 UNIX 路径。掩码文本文件必须包含对应掩码文件的完整绝对 UNIX 路径。
示例图像文本文件 images_source1.txt
的内容如下
/home/user/workspace/exports/images_final/00001.jpg
/home/user/workspace/exports/images_final/00002.jpg
下面显示了示例对应的掩码文本文件 labels_source1.txt
的内容。它包含相应的掩码名称
/home/user/workspace/exports/masks_final/00001.png
/home/user/workspace/exports/masks_final/00002.png
文本文件方法还允许您指定多个序列。
在 spec 文件中提供这些文本文件路径。
有关在数据集配置中使用文本文件配置多个数据源的更多详细信息,请参阅基于文本文件的数据集配置部分。
图像的大小不需要等于模型输入维度。图像在内部调整为模型输入维度。
手势识别模型应该在训练数据集之外的用户身上表现良好。因此,模型训练在划分为训练、验证和测试数据集时需要用户隔离。为了实现这一点,每个受试者都需要一个唯一的标识符 user_id。此外,为每个受试者记录多个视频。
按以下格式组织数据集
.
|-- original dataset root
|-- uid_1
|-- session_1
|-- 000000.png
|-- 000001.png
.
.
|-- xxxxxx.png
|-- session_2
|-- 000000.png
|-- 000001.png
.
.
|-- xxxxxx.png
|-- uid_2
|-- session_1
|-- 000000.png
|-- 000001.png
.
.
|-- xxxxxx.png
|-- session_2
|-- 000000.png
|-- 000001.png
.
.
|-- xxxxxx.png
|-- uid_3
|-- session_1
|-- 000000.png
|-- 000001.png
.
.
|-- xxxxxx.png
对于每个集合,准备一个元数据文件,该文件捕获可用于数据集采样的字段。
{
"set": "data",
"users": {
"uid_1": {
"location": "outdoor",
"illumination": "good",
"class_fps": {
"session_1": 30,
"session_2": 30
}
},
"uid_2": {
"location": "indoor",
"illumination": "good",
"class_fps": {
"session_1": 10,
"session_2": 15
}
},
"uid_3": {
"location": "indoor",
"illumination": "poor",
"class_fps": {
"session_1": 10
}
}
}
}
标签格式
每个图像对应于一个受试者执行的手势。图像需要一个对应的标签 JSON,其中包含感兴趣的手的边界框和手势标签。这些遵循 Label Studio 格式。图像的示例标签是
{
"completions": [
{
"result": [
{
"type": "rectanglelabels",
"original_width": 320,
"original_height": 240,
"value": {
"x": 58.1,
"y": 18.3,
"width": 18.8,
"height": 49.5
}
},
{
"type": "choices",
"value": {
"choices": [
"Thumbs-up"
]
}
}
]
}
],
"task_path": "/workspace/tao-experiments/gesturenet/data/uid_1/session_1/image_0001.png"
}
task_path
:指定图像的完整路径。completions
:这是一个块,其中包含 results 下的标签。
边界框和手势类是具有以下 type 的单独条目。
rectanglelabels
:指定对应于手部边界框的标签。
参数名称 |
描述 |
类型 |
范围 |
---|---|---|---|
类型 | 标签的类型 | 字符串 | rectanglelabels |
original_width | 被标记图像的宽度(以像素为单位) | 整数 | [1, inf) |
original_height | 被标记图像的高度(以像素为单位) | 整数 | [1, inf) |
value[“x”] | 手部边界框左上角的 x 坐标(占图像宽度的百分比) | 浮点数 | [0, 100] |
value[“y”] | 手部边界框左上角的 y 坐标(占图像高度的百分比) | 浮点数 | [0, 100] |
value[“width”] | 手部边界框的宽度(占图像宽度的百分比) | 浮点数 | [0, 100] |
value[“height”] | 手部边界框的高度(占图像高度的百分比) | 浮点数 | [0, 100] |
choices
:指定对应于手势类的标签。
参数名称 |
描述 |
类型 |
范围 |
---|---|---|---|
类型 | 标签的类型 | 字符串 | choices |
value[“choices”] | 属性列表。对于 GestureNet 应用,这将是带有手势类名称的单个条目 | 字符串列表 | 有效的手势类 |
dataset_convert
工具需要提取和实验配置 spec 文件输入。配置文件的详细信息和示例用法包含在手势识别页面上。
HeartRateNet 需要以下格式的图像目录。然后,图像和地面实况标签将转换为 TFRecords 以进行训练。
Subject_001/
ground_truth.csv
image_timestamps.csv
images/
0000.bmp
0001.bmp
.
.
N.bmp
.
.
Subject_M/
ground_truth.csv
image_timestamps.csv
images/
0000.bmp
0001.bmp
.
.
Y.bmp
EmotionNet、FPENet 和 GazeNet 使用 NVIDIA 数据工厂团队标记的相同 JSON 数据格式。这些应用需要此 JSON 数据格式用于训练和评估。对于 EmotionNet、FPENet 和 GazeNet,此数据将转换为 TFRecords 以进行训练。TFRecords 有助于更快地迭代数据。有关 JSON 数据格式描述,请参阅相应部分。
使用 JSON 标签数据格式需要按以下结构在 JSON 文件中组织数据
.
{
"filename": "data/001_01_02_200_06.png",
"class": "image",
"annotations": [
{
"class": "FaceBbox",
"tool-version": "1.0",
"Occlusion": 0,
"face_outer_bboxx": 269.0082935424086,
"face_outer_bboxy": 44.33839032556304,
"face_outer_bboxwidth": 182.97858097042064,
"face_outer_bboxheight": 276.28773076003836,
"face_tight_bboxx": 269.211755426433,
"face_tight_bboxy": 147.9049289218409,
"face_tight_bboxwidth": 182.58110482105968,
"face_tight_bboxheight": 172.5088694283426
},
{
"class": "FiducialPoints",
"tool-version": "1.0",
"P1x": 304.8502837500011,
"P1y": 217.10946645000078,
"P2x": 311.0173699500011,
"P2y": 237.15249660000086,
.
.
"P26occluded": true,
"P46occluded": true,
.
.
"P68x": 419.5885050000024,
"P68y": 267.6976650000015,
.
.
"P104x": 429.6,
"P104y": 189.5,
},
{
"class": "eyes"
"tool-version": "1.0",
"l_eyex": 389.1221901922325,
"l_eyey": 197.94528259092206,
"r_eyex": 633.489814294182,
"r_eyey": 10.52527209626886,
"l_status": "open",
"r_status": "occluded",
}
]
}
以下是结构描述
filename
字段:指定要训练的图像的路径。class
字段:各个部分的标签类别。annotation
字段:注释块。
注释中支持三种块类型,包括 FaceBbox、FiducialPoints 和 eyes。
FaceBox
块:这是一个描述人脸边界框标注信息的块。
参数名称 |
描述 |
类型 |
范围 |
示例 |
---|---|---|---|---|
类 | 注释块的类 | 字符串 | N/A | FaceBbox |
tool-version |
此块的标注工具版本 | 浮点数 | N/A | 1.0 |
遮挡 |
遮挡状态 [ 0 = 未遮挡,1 = 遮挡 ] | 整数 | 0 或 1 | 0 |
face_outer_bboxx |
外部人脸边界框左上角的 x 坐标 | 浮点数 | [0, image_width] | 269.05 |
face_outer_bboxy |
外部人脸边界框左上角的 y 坐标 | 浮点数 | [0, image_height] | 44.33 |
face_outer_bboxwidth |
外部人脸边界框的宽度 | 浮点数 | [0, image_width] | 182.97 |
face_outer_bboxheight |
外部人脸边界框的高度 | 浮点数 | [0, image_height] | 276.28 |
face_tight_bboxx |
紧密人脸边界框左上角的 x 坐标 | 浮点数 | [0, image_width] | 269.21 |
face_tight_bboxy |
外部人脸边界框左上角的 y 坐标 | 浮点数 | [0, image_height] | 147.90 |
face_tight_bboxwidth |
外部人脸边界框的宽度 | 浮点数 | [0, image_width] | 182.58 |
face_tight_bboxheight |
外部人脸边界框的高度 | 浮点数 | [0, image_height] | 172.50 |
FiducialPoint
块:这是一个描述特征点标注信息的块。
参数名称 |
描述 |
类型 |
范围 |
示例 |
---|---|---|---|---|
类 | 注释块的类 | 字符串 | N/A | FaceBbox |
tool-version |
此块的标注工具版本 | 浮点数 | N/A | 1.0 |
遮挡 |
遮挡状态 [ 0 = 未遮挡,1 = 遮挡 ] | 整数 | 0 或 1 | 0 |
Pix |
第 i 个地标点的 x 坐标 | 浮点数 | [0, image_width] | 304.85 |
Piy |
第 i 个地标点的 y 坐标 | 浮点数 | [0, image_height] | 217.10 |
Pioccluded |
外部人脸边界框的宽度 | 字符串 | N/A | true |
eyes
块:这是一个描述眼睛标注信息的块。此块不是必需的。
参数名称 |
描述 |
类型 |
范围 |
示例 |
---|---|---|---|---|
类 | 注释块的类 | 字符串 | N/A | FaceBbox |
tool-version |
此块的标注工具版本 | 浮点数 | N/A | 1.0 |
l_eyex |
左眼中心的 x 坐标 | 浮点数 | [0, image_width] | 389.12 |
l_eyey |
左眼中心的 y 坐标 | 浮点数 | [0, image_height] | 197.94 |
r_eyex |
右眼中心的 x 坐标 | 浮点数 | [0, image_width] | 633.48 |
r_eyey |
右眼中心的 y 坐标 | 浮点数 | [0, image_height] | 182.97 |
l_status |
左眼的状态 | 字符串 | open/close/barely open/half open/occluded | open |
r_status |
右眼的状态 | 字符串 | open/close/barely open/half open/occluded | occluded |
这是一个 JSON 文件的示例,其中包含具有两个图像帧的示例数据集
[
{
"filename": "data/001_01_02_200_06.png",
"class": "image",
"annotations": [
{
"face_outer_bboxy": 44.33839032556304,
"face_outer_bboxx": 269.0082935424086,
"face_tight_bboxx": 269.211755426433,
"face_tight_bboxy": 147.9049289218409,
"tool-version": "1.0",
"face_tight_bboxwidth": 182.58110482105968,
"face_tight_bboxheight": 172.5088694283426,
"face_outer_bboxwidth": 182.97858097042064,
"Occlusionx": 0,
"class": "FaceBbox",
"face_outer_bboxheight": 276.28773076003836
},
{
"P91x": 395.3500000000004,
"P91y": 196.6500000000002,
"P74occluded": true,
"P28x": 436.44144340908053,
"P28y": 174.67157210032852,
"P52y": 252.53100000000143,
"P52x": 428.9925000000024,
"P32y": 236.48449500000103,
"P32x": 416.6063550000018,
"P44x": 427.65443026467267,
"P44y": 186.9615161604129,
"P99x": 425.75,
"P36occluded": true,
"P75x": 428.85,
"P75y": 190.95000000000002,
"P20x": 389.46879000000166,
"P20y": 178.13376000000076,
"P8y": 313.8318038340011,
"P8x": 407.70466707150143,
"P81y": 192.2500000000002,
"P94x": 427.70000000000005,
"P81x": 393.5500000000004,
"P12y": 268.179948238501,
"P12x": 408.69280247400155,
"P65y": 260.04348000000147,
"P65x": 429.0319800000024,
"P84x": 396.8500000000004,
"P84y": 194.4500000000002,
"P93occluded": true,
"P46occluded": true,
"P43y": 193.31428917697824,
"P43x": 421.12354211680173,
"P14occluded": true,
"P92y": 187.5,
"P54occluded": true,
"P53x": 433.50450000000245,
"P53y": 251.9670000000014,
"P45occluded": true,
"P33x": 426.3480450000019,
"P33y": 238.67140500000104,
"P60x": 413.82301500000233,
"P100occluded": true,
"P60y": 272.07148500000153,
"P23y": 174.7903155211989,
"P23x": 428.12940394815394,
"P90y": 194.9000000000002,
"P13x": 399.2067026100015,
"P13y": 257.903340052501,
"P7x": 388.1395861020014,
"P7y": 304.93858521150105,
"P61y": 262.1309850000015,
"P104x": 429.6,
"P104y": 189.5,
"P83y": 193.2500000000002,
"P83x": 395.0000000000004,
"P61x": 404.5783500000023,
"P50y": 254.6756100000014,
"P50x": 414.2206350000023,
"P100x": 424.8,
"P100y": 191.3,
"P34y": 240.46069500000107,
"P34x": 435.9903300000019,
"P18y": 188.2730700000008,
"P18x": 366.50623500000154,
"P25occluded": true,
"P102occluded": true,
"P46x": 436.0852131464696,
"P46y": 191.82999641609848,
"P58y": 275.0536350000016,
"P58x": 429.2307900000024,
"P77x": 306.5418228495726,
"P77y": 258.61884245799524,
"P97occluded": true,
"P99y": 192.9,
"P10y": 293.87146870350114,
"P10x": 434.97720418050164,
"P48occluded": true,
"P26x": 436.0258414360342,
"P26y": 171.99984513074497,
"version": "v1",
"P27occluded": true,
"P86x": 397.8000000000004,
"P86y": 198.45000000000022,
"P73occluded": true,
"P98occluded": true,
"P2y": 237.15249660000086,
"P90x": 393.3500000000004,
"P29y": 203.3826300000009,
"P29x": 433.6046100000019,
"P101y": 188.85000000000002,
"P101x": 425.65000000000003,
"P51x": 423.6641100000023,
"P51y": 252.5881050000014,
"P35x": 436.78557000000194,
"P35y": 239.26783500000104,
"P66x": 433.70401500000247,
"P66y": 268.0952850000015,
"P19x": 378.4348350000016,
"P19y": 181.61293500000076,
"P98y": 193.45000000000002,
"P98x": 427.85,
"P45y": 187.0802595812833,
"P45x": 433.2353710455805,
"P21y": 176.44387500000076,
"P21x": 398.1170250000017,
"P59x": 422.1730350000024,
"P59y": 274.25839500000154,
"P9x": 431.0246625705015,
"P9y": 312.25078719000106,
"P17occluded": true,
"P11x": 422.7243251895016,
"P11y": 281.81621679300105,
"P70y": 195.95000000000002,
"P79occluded": true,
"P95occluded": true,
"P70x": 395.20000000000005,
"P1x": 304.8502837500011,
"P13occluded": true,
"P85y": 196.6500000000002,
"P85x": 398.1000000000004,
"P69y": 196.95000000000002,
"P24x": 433.0572559142747,
"P36y": 236.88211500000105,
"P36x": 427.5409050000019,
"P94occluded": true,
"P104occluded": true,
"P47occluded": true,
"P40x": 401.35650000000186,
"P40y": 197.40000000000092,
"P71x": 396.40000000000003,
"P71y": 196.8,
"P65occluded": true,
"P26occluded": true,
"P56y": 273.06553500000155,
"P56x": 433.0081800000024,
"P16occluded": true,
"P89y": 196.2500000000002,
"P89x": 392.4500000000004,
"P48x": 428.54500592120047,
"P48y": 195.45167075264504,
"P16y": 216.4016531475008,
"P16x": 360.47179483200136,
"P15occluded": true,
"P24y": 170.63429579073562,
"P78x": 276.3975906000002,
"class": "FiducialPoints",
"P74y": 190.10000000000002,
"P4y": 270.1562190435009,
"P4x": 329.2467161130011,
"P96y": 191.10000000000002,
"P74x": 427.85,
"P103y": 195.00000000000003,
"P103x": 396.4500000000001,
"P80x": 330.41417158035716,
"P80y": 178.5832276794402,
"P37x": 381.05250000000177,
"P37y": 200.64300000000094,
"P47y": 195.09544049003392,
"P47x": 433.47285788732125,
"P64x": 432.80937000000245,
"P64y": 255.47085000000143,
"P76y": 191.60000000000002,
"P57y": 271.77327000000156,
"P99occluded": true,
"P43occluded": true,
"P88x": 392.8500000000004,
"P88y": 198.45000000000022,
"P17x": 335.9660368500013,
"P17y": 206.7179262030008,
"P96x": 431.05,
"P67y": 268.3935000000015,
"P27y": 173.42476618118954,
"P27x": 436.38207169864535,
"P87y": 199.45000000000022,
"P87x": 395.1000000000004,
"P3x": 316.76397300000116,
"P67x": 426.8450700000024,
"P96occluded": true,
"P12occluded": true,
"P97x": 430.35,
"P97y": 193.05,
"P101occluded": true,
"P55occluded": true,
"P93x": 429.05,
"P93y": 195.4,
"P42x": 388.6665000000018,
"P42y": 200.64300000000094,
"P79y": 238.89320075909347,
"P54y": 252.24900000000142,
"P54x": 431.5305000000024,
"P73x": 427.05,
"P73y": 191,
"P68y": 267.6976650000015,
"P30y": 214.61539500000094,
"P30x": 440.86117500000194,
"P14y": 243.47656317600092,
"P14x": 384.18704449200146,
"P63y": 254.87442000000144,
"P76occluded": true,
"P22x": 406.8646650000017,
"P22y": 176.94090000000077,
"P28occluded": true,
"P6y": 296.24299366950106,
"P6x": 367.5863697300013,
"P92x": 428.85,
"P38y": 193.3815000000009,
"P38x": 388.5255000000018,
"P94y": 188.5,
"P72y": 197.70000000000002,
"P72x": 395.65000000000003,
"P78y": 210.5218971000002,
"P63x": 427.8391200000024,
"P35occluded": true,
"P82x": 393.8000000000004,
"P82y": 200.95000000000022,
"P11occluded": true,
"tool-version": "1.0",
"P41y": 200.99550000000093,
"P41x": 396.5625000000018,
"P56occluded": true,
"P55x": 425.0508679558401,
"P55y": 259.9172483306748,
"P31x": 449.410005000002,
"P31y": 225.351135000001,
"P1y": 217.10946645000078,
"P75occluded": true,
"P62x": 420.38374500000236,
"P62y": 256.06728000000146,
"P15x": 373.5151821450014,
"P15y": 228.45690505800087,
"P49y": 261.4140000000014,
"P49x": 400.0875000000022,
"P25y": 170.87178263247637,
"P25x": 435.25400920037674,
"P2x": 311.0173699500011,
"P80occluded": true,
"P3y": 251.86940685000093,
"P39x": 397.33800000000184,
"P39y": 192.1830000000009,
"P69x": 394.6,
"P5x": 347.3103508088991,
"P5y": 287.4697160411496,
"P95x": 430,
"P95y": 189.25,
"P79x": 368.8999131564783,
"P57x": 434.7974700000025,
"P102x": 428.1,
"P102y": 190.85000000000002,
"P76x": 428.25
},
{
"l_eyex": 389.1221901922325,
"l_eyey": 197.94528259092206,
"tool-version": "1.0",
"l_status": "open",
"r_status": "occluded",
"r_eyex": 633.489814294182,
"r_eyey": 10.52527209626886,
"class": "eyes"
}
]
},
{
"filename": "data/001_03_01_130_05.png",
"class": "image",
"annotations": [
{
"face_outer_bboxy": 36.21548211860577,
"face_outer_bboxx": 259.54428851667467,
"face_tight_bboxx": 265.58020220310897,
"face_tight_bboxy": 116.19133846386018,
"tool-version": "1.0",
"face_tight_bboxwidth": 191.64025954428882,
"face_tight_bboxheight": 192.64624515869457,
"face_outer_bboxwidth": 198.68215884512887,
"Occlusionx": 0,
"class": "FaceBbox",
"face_outer_bboxheight": 273.62808711835464
},
{
"P91x": 283.35,
"P91y": 179.55,
"P28x": 304.14947850000084,
"P28y": 176.3226009000005,
"P5occluded": true,
"P52y": 244.28250000000094,
"P52x": 305.0535000000012,
"P32y": 220.38088500000066,
"P32x": 289.76557500000087,
"P44x": 334.8750000000012,
"P44y": 168.63600000000062,
"P99x": 340.20000000000005,
"P99y": 174.75,
"P75x": 343.90000000000003,
"P75y": 171.70000000000002,
"P20x": 269.9839800000006,
"P20y": 158.94859500000035,
"P8y": 299.437842994699,
"P8x": 301.7845345542186,
"P94x": 342.70000000000005,
"P12y": 272.68555921617576,
"P12x": 389.08146056834715,
"P65y": 249.500000000001,
"P65x": 321.9500000000013,
"P84x": 285.8,
"P84y": 175.5,
"P43y": 176.03850000000065,
"P43x": 329.9400000000012,
"P68x": 302.05,
"P68y": 252.55,
"P92y": 165.70000000000002,
"P92x": 343.40000000000003,
"P53x": 311.11650000000117,
"P53y": 241.18050000000093,
"P33x": 295.53106500000086,
"P33y": 224.95351500000066,
"P60x": 297.5100000000011,
"P60y": 258.382500000001,
"P23y": 149.55274915302633,
"P23x": 325.5457633496816,
"P90y": 177.15,
"P13x": 406.681647264744,
"P13y": 256.7280566114426,
"P7x": 292.6324374720922,
"P90x": 280.25,
"P58x": 309.7065000000012,
"P61y": 253.51800000000097,
"P104x": 346.0500000000002,
"P104y": 171.35000000000008,
"P83y": 174.70000000000002,
"P83x": 282.15000000000003,
"P61x": 296.31150000000116,
"P50y": 249.21750000000097,
"P50x": 294.19650000000115,
"P100x": 339.45000000000005,
"P100y": 171.75,
"P34y": 224.85411000000067,
"P34x": 300.8989350000009,
"P18y": 170.97660000000036,
"P18x": 268.59231000000057,
"P46x": 357.7170000000013,
"P46y": 172.86600000000064,
"P58y": 258.664500000001,
"P4occluded": true,
"P77x": 300.22496910000007,
"P77y": 221.17413690000006,
"tool-version": "1.0",
"P10y": 298.73383552684317,
"P10x": 341.67829106605154,
"P26x": 361.5470170921228,
"P26y": 148.3723801778643,
"version": "v1",
"P86x": 286.6,
"P86y": 181.9,
"P2y": 204.16216567820388,
"P2x": 300.6111887744588,
"P29y": 189.63790065000055,
"P29x": 301.90690170000084,
"P101y": 168.8,
"P101x": 340.40000000000003,
"P51x": 298.49700000000115,
"P51y": 243.57750000000092,
"P35x": 310.83943500000095,
"P35y": 223.36303500000068,
"P66x": 313.85,
"P66y": 251.05,
"P19x": 267.8964750000006,
"P19y": 165.11170500000037,
"P98y": 176.55,
"P98x": 342.85,
"P45y": 165.8865000000006,
"P45x": 347.2125000000013,
"P21y": 156.26466000000033,
"P21x": 276.4453050000006,
"P59x": 303.2910000000012,
"P59y": 258.664500000001,
"P9x": 316.33402222324,
"P9y": 303.89655695778623,
"P17occluded": true,
"P11x": 366.0838832850552,
"P11y": 286.0617011054374,
"P70y": 178.35000000000002,
"P70x": 283.15000000000003,
"P1x": 307.6512634530176,
"P1y": 189.14333969727852,
"P85y": 178.60000000000002,
"P85x": 287.5,
"P69y": 179.3,
"P69x": 282.65000000000003,
"P36y": 219.78445500000066,
"P36x": 326.446020000001,
"P77occluded": true,
"P81y": 173.25,
"P81x": 281.95,
"P40x": 298.00350000000105,
"P40y": 178.85850000000062,
"P71x": 283.95,
"P71y": 178.9,
"P56y": 254.505000000001,
"P56x": 323.24250000000126,
"P7y": 284.1843478578217,
"P89y": 179.85000000000002,
"P89x": 279.90000000000003,
"P48x": 338.96400000000125,
"P48y": 177.51900000000066,
"P16y": 205.1008423020117,
"P16x": 420.9964657778135,
"P24x": 338.1757113839151,
"P24y": 146.9559374076699,
"class": "FiducialPoints",
"P74y": 170.85000000000002,
"P4y": 234.6691559519585,
"P4x": 290.9897533804285,
"P96y": 172,
"P74x": 342.95000000000005,
"P3occluded": true,
"P78occluded": true,
"P103y": 179.4,
"P103x": 285.55,
"P80x": 444.78450000000055,
"P80y": 173.78250000000023,
"P37x": 275.44350000000094,
"P37y": 182.80650000000063,
"P47y": 176.95500000000064,
"P47x": 350.5965000000013,
"P64x": 313.45000000000124,
"P64y": 249.95000000000098,
"P76y": 172.65,
"P57y": 257.113500000001,
"P6occluded": true,
"P88x": 281.1,
"P88y": 182.60000000000002,
"P17x": 420.2924583099576,
"P17y": 187.96999391751874,
"P96x": 347.70000000000005,
"P67y": 252.45000000000002,
"P27y": 153.68404056609333,
"P27x": 370.04567371328926,
"P87y": 183.5,
"P87x": 283.95,
"P3x": 295.44846734351574,
"P67x": 307.95000000000005,
"P2occluded": true,
"P97x": 346.25,
"P97y": 175.35000000000002,
"P93x": 344.35,
"P93y": 177.8,
"P42x": 280.30800000000096,
"P42y": 185.34450000000064,
"P54y": 243.78900000000093,
"P54x": 321.0570000000012,
"P73x": 342.5,
"P73y": 171.95000000000002,
"P30y": 201.83191200000059,
"P30x": 298.26271440000085,
"P14y": 239.83187738290155,
"P14x": 416.77242097067824,
"P63y": 251.20000000000098,
"P63x": 307.7500000000012,
"P22x": 284.2983000000006,
"P22y": 157.95454500000034,
"P1occluded": true,
"P6y": 270.10419850070423,
"P6x": 289.34706928876477,
"P38y": 176.17950000000062,
"P38x": 277.06500000000096,
"P94y": 166.65,
"P72y": 180.35000000000002,
"P72x": 283.65000000000003,
"P78y": 176.32260090000005,
"P78x": 318.5860666500001,
"P82x": 285.6,
"P82y": 185.35000000000002,
"P32occluded": true,
"P41y": 183.37050000000062,
"P41x": 290.460000000001,
"P55x": 334.9455000000013,
"P55y": 251.89650000000097,
"P31x": 295.59965445000086,
"P31y": 213.04479600000062,
"P79y": 232.39037411700184,
"P62x": 301.6000000000012,
"P62y": 251.30000000000098,
"P15x": 420.05778915400566,
"P15y": 222.93569815436055,
"P49y": 256.690500000001,
"P49x": 291.65850000000114,
"P25y": 145.8936053300241,
"P25x": 350.45154872559993,
"P3y": 218.94632250317727,
"P39x": 286.30050000000097,
"P39y": 173.50050000000059,
"P5x": 288.8777309768609,
"P5y": 253.44268842811516,
"P95x": 346.6,
"P95y": 168.25,
"P79x": 431.0439612134159,
"P57x": 315.4875000000012,
"P102x": 343.1,
"P102y": 172,
"P76x": 343.20000000000005
},
{
"l_eyex": 289.90000000000003,
"l_eyey": 179.60000000000002,
"tool-version": "1.0",
"l_status": "open",
"r_status": "open",
"r_eyex": 337.4000000000001,
"r_eyey": 173.35000000000005,
"class": "eyes"
}
]
}
使用 COCO 格式需要按以下结构组织数据
|-- dataset root
|-- train2017
|-- 000000001000.jpg
|-- 000000001001.jpg
.
.
|-- xxxxxxxxxxxx.jpg
|-- val2017
|-- 000000002000.jpg
|-- 000000002001.jpg
.
.
|-- xxxxxxxxxxxx.jpg
|-- annotations
|-- person_keypoints_train2017.json
|-- person_keypoints_val2017.json
您可以选择为训练和测试图像设置嵌套目录结构,只要您有一个数据集根目录,并且文件名在注释的 images->filename
字段中进行了相应调整即可。
标签文件
本节概述了 BodyPoseNet 的数据必须采用的 COCO 注释数据集格式。虽然 COCO 注释具有更多字段,但此处仅提及 BodyPoseNet 需要的属性。您可以完全使用与 COCO 相同的格式。对整体数据集结构使用以下结构(在 .json
文件中)
"images": [
{
"file_name": "000000001000.jpg",
"height": 480,
"width": 640,
"id": 1000
},
{
"file_name": "000000580197.jpg",
"height": 480,
"width": 640,
"id": 580197
},
...
],
"annotations": [
{
"segmentation": [[162.46,152.13,150.73,...173.92,156.23]],
"num_keypoints": 17,
"area": 8720.28915,
"iscrowd": 0,
"keypoints": [162,174,2,...,149,352,2],
"image_id": 1000,
"bbox": [115.16,152.13,83.23,228.41],
"category_id": 1,
"id": 1234574
},
...
],
"categories": [
{
"supercategory": "person",
"id": 1,
"name": "person",
"keypoints": [
"nose","left_eye","right_eye","left_ear","right_ear",
"left_shoulder","right_shoulder","left_elbow","right_elbow",
"left_wrist","right_wrist","left_hip","right_hip",
"left_knee","right_knee","left_ankle","right_ankle"
],
"skeleton": [
[16,14],[14,12],[17,15],[15,13],[12,13],[6,12],[7,13],[6,7],
[6,8],[7,9],[8,10],[9,11],[2,3],[1,2],[1,3],[2,4],[3,5],[4,6],[5,7]
]
}
]
images
部分包含数据集中图像的完整列表以及一些元数据。
图像 ID 在其他图像中需要是唯一的。
参数名称 |
描述 |
类型 |
范围 |
---|---|---|---|
file_name |
图像的路径 | 字符串 | N/A |
height |
图像的高度 | 整数 | N/A |
width |
图像的宽度 | 浮点数 | N/A |
id |
图像的唯一 ID | 整数 | N/A |
annotations
部分包含图像的标签。每个实体是一个注释,每个图像可以有多个注释。
参数名称 |
描述 |
类型 |
范围 |
---|---|---|---|
segmentation |
多边形列表,其中包含给定人员/组的顶点列表。 | 列表 | N/A |
num_keypoints |
已标记的关键点的数量 | 整数 | [0, total_keypoints] |
area |
分割/bbox 的面积 | 浮点数 | N/A |
iscrowd |
如果为 1,则表示注释掩码用于多人 | 整数 | [0, 1] |
keypoints |
关键点列表,格式如下:[x1, y1, v1, x2, y2, v2 ...] ,其中 x 和 y 是像素位置,v 是可见性/遮挡标志。 |
列表 | N/A |
bbox |
对象/人的 bbox | 列表 | N/A |
image_id |
关联图像的唯一 ID | 整数 | N/A |
category_id |
对象类别(对于人始终为 1 ) |
整数 | 1 |
id |
注释的唯一 ID | 整数 | N/A |
COCO 数据集遵循以下遮挡标志标注格式:
[visible: 2, occluded: 1, not_labeled: 0]
。categories
部分包含数据集中遵循的关键点约定。
参数名称 |
描述 |
类型 |
范围 |
---|---|---|---|
supercategory |
超类别 | 字符串 | person |
id |
类别的 ID | 整数 | 1 |
name |
类别的名称 | 字符串 | person |
keypoints |
标签中使用的关键点名称和排序约定 | 列表 | N/A |
skeleton |
骨架边缘列表,格式如下:[[j1, j2], [j2, j3] ...] ,其中 j 是关键点/关节索引。 |
列表 | N/A |
有关更多详细信息,请参阅 COCO 关键点注释文件和COCO 关键点检测任务。
使用 Market-1501 格式需要按以下结构组织数据
|-- dataset root
|-- bounding_box_train
|-- 0002_c1s1_000451_03.jpg
|-- 0002_c1s1_000551_01.jpg
.
.
|-- 1500_c6s3_086567_01.jpg
|-- bounding_box_test
|-- 0000_c1s1_000151_01.jpg
|-- 0000_c1s1_000376_03.jpg
.
.
|-- 1501_c6s4_001902_01.jpg
|-- query
|-- 0001_c1s1_001051_00.jpg
|-- 0001_c2s1_000301_00.jpg
.
.
|-- 1501_c6s4_001877_00.jpg
数据集的根目录包含用于训练、测试和查询的子目录。每个子目录都有不同身份的裁剪图像。例如,图像 0001_c1s1_01_00.jpg
来自相机 c1 的第一个序列 s1。01 表示序列 c1s1
中的第一帧。0001
是分配给对象的唯一 ID。第三个 _
之后的内容将被忽略。不需要标签文件。
有关更多详细信息,请参阅Market-1501 Dataset。