tensorboy / pytorch_Realtime_Multi-Person_Pose_Estimation

1.36k stars 410 forks source link

Very slow inference. #67

Open kvigulis opened 5 years ago

kvigulis commented 5 years ago

Hi,

What kind of fps do you get while testing? For me it takes about 5.2 seconds per frame on 1080 Ti, for video resolution of 1280x720. Are other people experiencing similar inference times? It just seems that a real-time algorithm should be a bit quicker..?

Thanks.

Lynya commented 5 years ago

same, 2.1 seconds per frame on one 1080ti, it is strange and I'm not sure what's wrong

r11alaa commented 5 years ago

Hi all, in the coco_eval.py file change the scale search range. the original is "scale_search = [0.5, 1., 1.5, 2, 2.5]" and you can change it to be something like scale_search = [1.]. beside that you can resize your testing images before use them. regards

Lynya commented 5 years ago

Thanks a lot for your help, and I found using "torch.cuda.synchronize()" to force synchronization also help to speed up.

GraphicsHunter commented 5 years ago

Hi @Lynya, in what file and line did you place torch.cuda.synchronize() and how much of a speed-up did you get placing that line?

Lynya commented 5 years ago

Hi @Lynya, in what file and line did you place torch.cuda.synchronize() and how much of a speed-up did you get placing that line?

Hi, I add torch.cuda.synchronize() below model.cuda() in the web_demo.py. With single 1080ti, the inference time is 2/3~1/2 of the previous. BTW, I think there are still something wrong in the pytorch code. The speed is too slow compared to the tensorflow version of openpose([https://github.com/ildoonet/tf-pose-estimation]).

ahuirecome commented 5 years ago

There must be something wrong.

PatrickBue commented 5 years ago

Did anyone find why inference is so slow?

maxkazmsft commented 5 years ago

Looks like the problem is on CPU in pose estimation code - lines 163-164 here are painfully slow (and inefficient, why is len inferred at each iteration of the loop?) https://github.com/tensorboy/pytorch_Realtime_Multi-Person_Pose_Estimation/blob/master/evaluate/coco_eval.py

ericzw commented 5 years ago

Looks like the problem is on CPU in pose estimation code - lines 163-164 here are painfully slow (and inefficient, why is len inferred at each iteration of the loop?) https://github.com/tensorboy/pytorch_Realtime_Multi-Person_Pose_Estimation/blob/master/evaluate/coco_eval.py

Hi, have you solved the speed problem in inference?

Naruto-Zhao commented 4 years ago

Who can tell me how to calculate the fps?