unofficial-implement-of-openpose icon indicating copy to clipboard operation
unofficial-implement-of-openpose copied to clipboard

How to improve performance?

Open ccl-private opened this issue 6 years ago • 10 comments

First, thank you for sharing. I tested your pre-trained model on my Linux(GTX 1080), but my fps was about 5. Do you have some ideas to may it real-time? Really appreciate.

ccl-private avatar Aug 09 '19 03:08 ccl-private

you can resize the input image to a small one at line 103

YangZeyu95 avatar Aug 09 '19 07:08 YangZeyu95

Thanks :) It worked! FPS reached 10 when I changed the size to 320*320. I also notice that there are two smaller network models in vgg.py file, named vgg_a and vgg_16. But when I made some adjustments in train.py and try to train on these models, it always tells me the size is not matched. How can I train on these smaller models?

ccl-private avatar Aug 12 '19 00:08 ccl-private

Screenshot from 2019-08-12 08-39-20 Here is where I adjusted in train.py, including two scope names to args.name.

ccl-private avatar Aug 12 '19 00:08 ccl-private

That because VGGs, with different layers, downsample the image to the different scales. You need to know which downsample scale is used in the backbone network you chose and edit the 'scale' in line 78.

YangZeyu95 avatar Aug 12 '19 01:08 YangZeyu95

I have some trouble with vgg_a and vgg_16 in vgg.py. How 'scale' inline 78 related to VGG downsample. First I think it was the max pool layer that related to the 'scale', so I edited the 'scale' to 10 for vgg_16. However, it reported the same error: Screenshot from 2019-08-13 10-08-38 I also set the 'scale' to 5,6, 8, and so on, the error report did not change even the dimension value.

ccl-private avatar Aug 13 '19 02:08 ccl-private

make sure you have changed the backbone network.

YangZeyu95 avatar Aug 13 '19 02:08 YangZeyu95

I have set it to None in line: 19. Screenshot from 2019-08-13 10-48-30 And here is where that report the error above: Screenshot from 2019-08-13 10-56-53

ccl-private avatar Aug 13 '19 02:08 ccl-private

you need to make sure that the tensor shape of ground truth and mode output have the same shape.

YangZeyu95 avatar Aug 14 '19 03:08 YangZeyu95

I am still suffering from vgg_16 and vgg_a. It seemed that only the vgg_19 can get the same output shape of the ground truth. Maybe I am in the wrong direction.

I really wish a smaller network, such as mobile-net. Will it be possible a mobile-net version in the future?

ccl-private avatar Aug 28 '19 09:08 ccl-private

yes, the shape of each vggs' output is fixed, while you can change the heatmap and paf shape when generating ground truth to match vgg's output shape. you can change that use 'scale' at line 78 in 'train.py'.

YangZeyu95 avatar Aug 30 '19 13:08 YangZeyu95