我是用labelme标注的动物数据集生成多个身体关键点json文件,然後我想转换成coco格式并合并成一個类似animal_keypoints_train.json文件(类似下面的配置信息)
{"image_id": 1448, "bbox": [234, 11, 344, 248], "keypoints": [[298, 45, 1], [274, 49, 1], [300, 59, 1], [294, 29, 1], [259, 32, 1], [293, 150, 1], [256, 156, 1], [330, 166, 1], [307, 173, 1], [296, 207, 1], [267, 206, 1], [325, 212, 1], [0, 0, 0], [292, 239, 1], [261, 239, 1], [320, 232, 1], [292, 234, 1], [274, 106, 1], [0, 0, 0], [0, 0, 0]], "num_keypoints": 20, "category_id": 1}, {"image_id": 1449, "bbox": [140, 26, 500, 333], "keypoints": [[257, 130, 1], [167, 113, 1], [177, 176, 1], [338, 113, 1], [173, 76, 1], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [262, 242, 1], [376, 168, 1], [0, 0, 0]], "num_keypoints": 20, "category_id": 1}, {"image_id": 1450, "bbox": [79, 1, 435, 334], "keypoints": [[336, 144, 1], [208, 124, 1], [298, 183, 1], [357, 101, 1], [147, 71, 1], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [249, 318, 1], [0, 0, 0], [0, 0, 0]], "num_keypoints": 20, "category_id": 2}, {"image_id": 1451, "bbox": [110, 158, 299, 267], "keypoints": [[0, 0, 0], [279, 210, 1], [286, 220, 1], [266, 169, 1], [266, 187, 1], [0, 0, 0], [235, 253, 1], [173, 198, 1], [116, 242, 1], [0, 0, 0], [273, 246, 1], [0, 0, 0], [0, 0, 0], [0, 0, 0], [291, 246, 1], [0, 0, 0], [0, 0, 0], [250, 226, 1], [213, 214, 1], [128, 195, 1]], "num_keypoints": 20, "category_id": 2},
{"supercategory": "animal", "id": 4, "name": "horse", "keypoints": ["left_eye", "right_eye", "nose", "left_ear", "right_ear", "left_front_elbow", "right_front_elbow", "left_back_elbow", "right_back_elbow", "left_front_knee", "right_front_knee", "left_back_knee", "right_back_knee", "left_front_paw", "right_front_paw", "left_back_paw", "right_back_paw", "throat", "withers", "tailbase"], "skeleton": [[0, 1], [0, 2], [1, 2], [0, 3], [1, 4], [2, 17], [18, 19], [5, 9], [6, 10], [7, 11], [8, 12], [9, 13], [10, 14], [11, 15], [12, 16]]},