First time here? Check out the FAQ!
answered 2019-10-26 22:54:41 -0600
cv2.dnn.setPreferableBackend(cv2.dnn.DNN_BACKEND_CUDA)
cv2.dnn.setPreferableTarget(cv2.dnn.DNN_TARGET_CUDA)
You can also use cv2.dnn.DNN_TARGET_CUDA_FP16 if your device supports it.
cv2.dnn.DNN_TARGET_CUDA_FP16