ryouchinsa / Rectlabel-support

RectLabel is an offline image annotation tool for object detection and segmentation.
https://rectlabel.com
515 stars 73 forks source link

Is there a way to convert a custom dataset with 8 keypoints? #229

Closed blackCmd closed 1 year ago

blackCmd commented 1 year ago

I have created a custom dataset with 8 keypoints using CVAT. I tried to convert it to a YOLOv8-pose format dataset using JsonToYolo, but it only generates empty files.

Could you please tell me how to create a dataset with 8 keypoints? Thank you.

This is my json file. { "licenses": [ { "name": "", "id": 0, "url": "" } ], "info": { "contributor": "", "date_created": "", "description": "", "url": "", "version": "", "year": "" }, "categories": [ { "id": 1, "name": "dump_rect", "supercategory": "", "keypoints": [], "skeleton": [] }, { "id": 2, "name": "dump", "supercategory": "", "keypoints": [ "1", "2", "3", "4", "5", "6", "7", "8" ], "skeleton": [ [ 3, 4 ], [ 2, 1 ], [ 6, 5 ], [ 3, 7 ], [ 5, 1 ], [ 4, 2 ], [ 5, 7 ], [ 2, 6 ], [ 4, 8 ], [ 8, 6 ], [ 1, 3 ], [ 7, 8 ] ] } ], "images": [ { "id": 1, "width": 1920, "height": 1080, "file_name": "82-1cmaera_280cm.png", "license": 0, "flickr_url": "", "coco_url": "", "date_captured": 0 } ], "annotations": [ { "id": 1, "image_id": 1, "category_id": 2, "segmentation": [], "area": 84310.30090000003, "bbox": [ 992.35, 541.17, 380.17, 221.77 ], "iscrowd": 0, "attributes": { "occluded": false }, "keypoints": [ 1305.31, 625.04, 2, 1370.06, 598.57, 2, 1312.17, 762.94, 2, 1372.52, 731.13, 2, 992.35, 572.36, 2, 1082.01, 541.17, 2, 994.67, 683.67, 2, 1086.64, 640.07, 2 ], "num_keypoints": 8 } ] }

ryouchinsa commented 1 year ago

Thanks for writing the issue.

Using our updated general_json2yolo.py script, we could convert the COCO keypoints format to the YOLOv8 pose format.

This code originates from Ultralytics JSON2YOLO repository. https://github.com/ultralytics/JSON2YOLO/issues/45

スクリーンショット 2023-06-20 18 12 33

blackCmd commented 1 year ago

@ryouchinsa

Oh, wow! As you instructed, I successfully created the directory and the conversion was done properly. image

Awesome~! Have a great day. : )

ryouchinsa commented 1 year ago

Thanks for your feedback. If you have any other questions, please let us know.