Daniil-Osokin / lightweight-human-pose-estimation.pytorch

Fast and accurate human pose estimation in PyTorch. Contains implementation of "Real-time 2D Multi-Person Pose Estimation on CPU: Lightweight OpenPose" paper.
Apache License 2.0
2.05k stars 474 forks source link

segmentations': [ ] #233

Closed alicera closed 2 years ago

alicera commented 2 years ago

https://github.com/Daniil-Osokin/lightweight-human-pose-estimation.pytorch/blob/1590929b601535def07ead5522f05e5096c1b6ac/scripts/prepare_train_labels.py#L44

I generate the coco dataset and some images have the " 'segmentations': [ ] " So I write a code to deal with it. How about the code?

            if annotations[1] == []:
                annotations[1] =[{'counts': [annotation['bbox'][0], annotation['bbox'][1],
                annotation['bbox'][0] + annotation['bbox'][1], annotation['bbox'][1], 
                annotation['bbox'][0] + annotation['bbox'][2], annotation['bbox'][1]+ annotation['bbox'][3],
                annotation['bbox'][0], annotation['bbox'][1]+ annotation['bbox'][3]],           
                'size': [annotation['bbox'][3], annotation['bbox'][2]]}] 
Daniil-Osokin commented 2 years ago

Please, check #231.