seung0h
commited on
Commit
·
3ea7c47
1
Parent(s):
9ac89d3
mod cuda option
Browse files- pipeline.py +1 -1
pipeline.py
CHANGED
|
@@ -17,7 +17,7 @@ from diffusers import AutoPipelineForInpainting
|
|
| 17 |
|
| 18 |
class SmileGen:
|
| 19 |
def __init__(self, device='cuda'):
|
| 20 |
-
self.device = device
|
| 21 |
|
| 22 |
def face_detection(self, image):
|
| 23 |
face_det = YOLO(hf_hub_download(repo_id="arnabdhar/YOLOv8-Face-Detection", filename="model.pt")).to(self.device)
|
|
|
|
| 17 |
|
| 18 |
class SmileGen:
|
| 19 |
def __init__(self, device='cuda'):
|
| 20 |
+
self.device = device if torch.cuda.is_available() else 'cpu'
|
| 21 |
|
| 22 |
def face_detection(self, image):
|
| 23 |
face_det = YOLO(hf_hub_download(repo_id="arnabdhar/YOLOv8-Face-Detection", filename="model.pt")).to(self.device)
|