liruilong940607 / Pose2Seg

Code for the paper "Pose2Seg: Detection Free Human Instance Segmentation" @ CVPR2019.
http://www.liruilong.cn/projects/pose2seg/index.html
MIT License
531 stars 136 forks source link

How can I generate coco format keypoints json file? #13

Closed MarSaKi closed 5 years ago

MarSaKi commented 5 years ago

I used pos-ae get 17 keypoints of one person. But how can I generate the coco format json file using the 17 keypoints . Like this , {"keypoints": [176.7578125, 111.5390625, 0.9444317817687988, 182.6171875, 105.6796875, 0.9576615691184998, 170.8984375, 105.6796875, 0.9330981969833374, 192.3828125, 111.5390625, 0.9314539432525635, 166.9921875, 111.5390625, 0.6315260529518127, 0, 0, 0, 155.2734375, 140.8359375, 0.8885959982872009, 217.7734375, 177.9453125, 0.9087645411491394, 151.3671875, 179.8984375, 0.8826849460601807, 219.7265625, 207.2421875, 0.8257762789726257, 145.5078125, 215.0546875, 0.6683874130249023, 194.3359375, 218.9609375, 0.7143456935882568, 161.1328125, 217.0078125, 0.7429389357566833, 192.3828125, 285.3671875, 0.7802388072013855, 159.1796875, 279.5078125, 0.7996304035186768, 190.4296875, 330.2890625, 0.831089973449707, 159.1796875, 336.1484375, 0.8201078176498413], "score": 0.7800430655479431, "image_path": "test1.png"}

wine3603 commented 5 years ago

I have the same problem. I got 18 keypoints using Openpose and output to coco_json format using openpose write_coco_json flag, and modify it to the coco keypoint json file follow coco dataset introductions. I edited the test.py to use my own images and the openpose json file, but it got the error:

   assert type(dataset)==dict, 'annotation file format {} not supported'.format(type(dataset))
AssertionError: annotation file format <class 'list'> not supported

I want to use Pose2Seg to test 1 single image, do I need to provide the Bbox in the json file? How to generate the workful coco style json file for a single test image? Can anyone provide an example of a simple json format for testing a single image ?

liruilong940607 commented 5 years ago

Please refer our dataset api on how to generate a usable coco-format json file: https://github.com/liruilong940607/OCHumanApi/blob/master/ochumanApi/ochuman.py

And if you do not need evaluation (only need inference), you can leave those fields blank: 'area', 'iscrowd', 'segmentation', 'bbox', because we don't use them for inference.

Also, I need to mention that if you use pose-ae to generate pose, their are some tricks in their codes to introduce redundant keypoint for better performance. You need to get rid of those tricks for useable keypoint results: e.g. L.198 and L.128 in their test.py

manansaxena commented 5 years ago

I have the same problem. I got 18 keypoints using Openpose and output to coco_json format using openpose write_coco_json flag, and modify it to the coco keypoint json file follow coco dataset introductions. I edited the test.py to use my own images and the openpose json file, but it got the error:

   assert type(dataset)==dict, 'annotation file format {} not supported'.format(type(dataset))
AssertionError: annotation file format <class 'list'> not supported

I want to use Pose2Seg to test 1 single image, do I need to provide the Bbox in the json file? How to generate the workful coco style json file for a single test image? Can anyone provide an example of a simple json format for testing a single image ?

Hey, Were you able to solve this problem of converting openpose keypoints to coco format ?

wine3603 commented 5 years ago

I have the same problem. I got 18 keypoints using Openpose and output to coco_json format using openpose write_coco_json flag, and modify it to the coco keypoint json file follow coco dataset introductions. I edited the test.py to use my own images and the openpose json file, but it got the error:

   assert type(dataset)==dict, 'annotation file format {} not supported'.format(type(dataset))
AssertionError: annotation file format <class 'list'> not supported

I want to use Pose2Seg to test 1 single image, do I need to provide the Bbox in the json file? How to generate the workful coco style json file for a single test image? Can anyone provide an example of a simple json format for testing a single image ?

Hey, Were you able to solve this problem of converting openpose keypoints to coco format ?

not yet, still I am struggling.......

ZORAN666 commented 4 years ago

I have the same problem. I got 18 keypoints using Openpose and output to coco_json format using openpose write_coco_json flag, and modify it to the coco keypoint json file follow coco dataset introductions. I edited the test.py to use my own images and the openpose json file, but it got the error:

   assert type(dataset)==dict, 'annotation file format {} not supported'.format(type(dataset))
AssertionError: annotation file format <class 'list'> not supported

I want to use Pose2Seg to test 1 single image, do I need to provide the Bbox in the json file? How to generate the workful coco style json file for a single test image? Can anyone provide an example of a simple json format for testing a single image ?

Hey, Were you able to solve this problem of converting openpose keypoints to coco format ?

not yet, still I am struggling.......

Did you solve that?

wine3603 commented 4 years ago

@ZORAN666 no, I gave up, turned to another crowds segmentation method.

manansaxena commented 4 years ago

@wine3603 Which one are you using now ? Because this isn't working for me and I have spent ample amount of time in trying to make it work