mirror of
https://github.com/serengil/deepface.git
synced 2025-06-08 04:25:21 +00:00
Conditional use of GPU on FastMtCnn
This commit is contained in:
parent
3d8733812b
commit
2b7c0a708e
@ -68,7 +68,9 @@ class FastMtCnnClient(Detector):
|
|||||||
"Please install using 'pip install facenet-pytorch' "
|
"Please install using 'pip install facenet-pytorch' "
|
||||||
) from e
|
) from e
|
||||||
|
|
||||||
face_detector = fast_mtcnn(device="cuda:0")
|
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
|
||||||
|
face_detector = fast_mtcnn(device=device)
|
||||||
|
|
||||||
return face_detector
|
return face_detector
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user