I’ve implemented MTCNN face detection and this is the part which feeds images from the camera to the network. The high CPU usage was bugging me (even though everything is on CUDA) and was playing around until I stumbled upon this. Everything else was kept the same except this function and surprise CPU usage dropped to 100%.