AIZOOTech / FaceMaskDetection

开源人脸口罩检测模型和数据 Detect faces and determine whether people are wearing mask.
https://demo.aizoo.com/face-mask-detection.html
MIT License
2.08k stars 619 forks source link

python opencv_dnn_infer.py 是默认使用cpu还是gpu,想切换gpu要怎么办? #102

Open fumingren opened 3 years ago

xinnie-the-pooh commented 3 years ago

默认CPU

fumingren commented 3 years ago

能换gpu吗

xinnie-the-pooh commented 3 years ago

这个得用对应版本cuda框架 但是程序貌似没有引用 (仅限于模型执行过程)

fumingren commented 3 years ago

好的谢谢哈

fumingren commented 3 years ago

可通过换下面代码解决换gpu问题 Net = cv2.dnn.readNetFromCaffe(args.proto, args.model) Net.setPreferableBackend(cv2.dnn.DNN_BACKEND_CUDA) Net.setPreferableTarget(cv2.dnn.DNN_TARGET_CUDA)