natanielruiz / deep-head-pose

:fire::fire: Deep Learning Head Pose Estimation using PyTorch.
Other
1.58k stars 368 forks source link

High CPU utilization #84

Open sunny0315 opened 5 years ago

sunny0315 commented 5 years ago

I run the model on P40 to make inferences,it will consume 50%+ CPU resources when start 4 processes. I found the reason for the problem is to process the pictures when executing 'transformations' operation. Are there some methods to optimize the problem?

transformations = transforms.Compose([transforms.Scale(224),transforms.CenterCrop(224), transforms.ToTensor(),transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])]) img = transformations(img)