Convert supervisely output to COCO keypoint data format (Only convert keypoint outputs)
1. Set the Class
- setting the title to person
- setting shape to keypoints
- drawing the keypoints templete or uploading a keypoint image
- set the node name : {"Head","neck","right shoulder", ...}
- set the edge name : {"1,2","2,3",...} --> the nodes that the edge is connected to : "from,to"
cf.I start the node with 1(not 0), but it doesn't matter what it start with. It's up to the developer.
2. Draw keypoints on the image
3. Download annotation and meta file(.json) from supervisely
4. Execute the code
#Anconda prompt
> python supervisely2coco.py meta_file_path annotation_dir_path save_dir_path
* meta_file_path: ~/meta.json
* annotation_dir_path: ~/ann
* save_dir_path: ~/, default = ./result.json
cf. On the left is 'sample_1_person.png', and on the right is 'smaple_2_person.png'.
Souce code Referenced: https://gist.github.com/caiofcm/0b93b0084669a1287633d9ebf32f3833