Pytorch0.4.1_Openpose icon indicating copy to clipboard operation
Pytorch0.4.1_Openpose copied to clipboard

About the running time

Open lianuo opened this issue 6 years ago • 9 comments

@TreB1eN Thank you for your works, it is easy to test the openpose method in pytorch.

I have a question about the running speed.

I use this model to test a video with 10 person in each frame.it seems too slow (7 second per frame) compare with the paper they reported in the fig 12 as follow: speed

could you give me some information I could have faster speed for inference.

I am using the precise mode.

Thank you~

lianuo avatar Jan 03 '19 09:01 lianuo

firstly, could you try not to use the precise mode? Because in precise mode the inference will be running multiple times, each time on a different input scale. Also, the inference time are also dependent on your GPU efficiency. On my 1080Ti one inference time is less than 0.5 seconds, as I remembered. Right now my resource are computing on other tasks, If I got time, I may give you a precise figure

TreB1eN avatar Jan 03 '19 16:01 TreB1eN

@TreB1eN Thank you for reply, I test the time spend ,and found most of time spend on 1 compute_peaks_from_heatmaps 2 compute_connections

I fix the scale to 2 ,remove 0.5 1 1.5

when i resize my image resolution from 1920/1080->576/324 the time of 1 is down 1.8598 -> 0.1488 s and 2 down to 3.3724->1.7937 s

do you think we can improve the code to be faster?

lianuo avatar Jan 04 '19 03:01 lianuo

really ? What I recall the step2 is pretty fast, I may need a while for me to test it again in my computer

TreB1eN avatar Jan 04 '19 03:01 TreB1eN

@TreB1eN I think it is sensitive to the person or key points number in the frames.in my image there are 10 or more persons.so it is very slow.

lianuo avatar Jan 04 '19 05:01 lianuo

看了下代码,heatmap和PAF之后的处理这一部分是在CPU里面实现的,而openpose源码是在cuda下面跑的,大概跟这个有些关系吧。

lianuo avatar Jan 22 '19 01:01 lianuo

模型加速是真的很难,不过有个lightweight openpose

TreB1eN avatar Mar 02 '19 22:03 TreB1eN

@TreB1eN 谢谢你提供的这个,我看他也开源了,测了一下,发现有相同的问题,就是计算极大值和关键点连接是最耗时的部分。计算方法和你这个方法也很接近。

lianuo avatar Mar 06 '19 03:03 lianuo

@lianuo 如果想加速,还是要用c实现,或者Gpu

TreB1eN avatar Mar 06 '19 04:03 TreB1eN

谢谢你提供的这个,请问你的handnet模型是在哪里找的?是自己训练的吗?用的什么数据?

yy2yy avatar Mar 26 '20 07:03 yy2yy