pytorch-openpose icon indicating copy to clipboard operation
pytorch-openpose copied to clipboard

Is the performance too bad?

Open HW140701 opened this issue 3 years ago • 9 comments

Is the performance too bad? It takes 1 - 2 seconds to predict a image on GTX 1070 8G. Is there a plan to optimize performance and increase the speed of predicit?

HW140701 avatar Mar 30 '21 08:03 HW140701

well, I will update this repo with parallel processing and a new hand detection model. Waiting for the time I am free.

Hzzone avatar Apr 05 '21 14:04 Hzzone

well, I will update this repo with parallel processing and a new hand detection model. Waiting for the time I am free.

Thanks ! Expect

HW140701 avatar Apr 06 '21 00:04 HW140701

@Hzzone Can you please tell me which kind of optimizations did you used? When are you able to update the repo? Thanks for you hard work!

RisithPerera avatar Apr 06 '21 18:04 RisithPerera

I mean that, the major consumption is the hand detection model which I have to use the pose to estimate. It would be better if I change it by training a mobile net hand detection model, and process the images with multi-thread.

Hzzone avatar Apr 07 '21 04:04 Hzzone

@Hzzone In the body.py there are lots of calculations after using the model. These calculations take lots of time.

data = torch.from_numpy(im).float()
if torch.cuda.is_available():
    data = data.cuda()

with torch.no_grad():
    Mconv7_stage6_L1, Mconv7_stage6_L2 = self.model(data)

Do you have any idea to do these calculations on GPU? In my application, I crop each person in the frame using YOLO and send each person to this model. Can you give me any hint on how to speed up this little more.

RisithPerera avatar Apr 07 '21 04:04 RisithPerera

@Hzzone In the body.py there are lots of calculations after using the model. These calculations take lots of time.

data = torch.from_numpy(im).float()
if torch.cuda.is_available():
    data = data.cuda()

with torch.no_grad():
    Mconv7_stage6_L1, Mconv7_stage6_L2 = self.model(data)

Do you have any idea to do these calculations on GPU? In my application, I crop each person in the frame using YOLO and send each person to this model. Can you give me any hint on how to speed up this little more.

Alphapose maybe faster ? It gets 20 FPS on GTX 1080Ti.

HW140701 avatar Apr 07 '21 06:04 HW140701

@HW140701 Is there a PyTorch implementation of Alphapose?

RisithPerera avatar Apr 07 '21 06:04 RisithPerera

@HW140701 Is there a PyTorch implementation of Alphapose?

maybe you can see https://github.com/MVIG-SJTU/AlphaPose

HW140701 avatar Apr 07 '21 06:04 HW140701

@Hzzone In the body.py there are lots of calculations after using the model. These calculations take lots of time.

data = torch.from_numpy(im).float()
if torch.cuda.is_available():
    data = data.cuda()

with torch.no_grad():
    Mconv7_stage6_L1, Mconv7_stage6_L2 = self.model(data)

Do you have any idea to do these calculations on GPU? In my application, I crop each person in the frame using YOLO and send each person to this model. Can you give me any hint on how to speed up this little more.

Hello, has your problem been solved?

notsong avatar Aug 02 '21 07:08 notsong