Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ from torch_mtcnn import show_bboxes
|
|
16 |
# pipeline = pipeline(task="image-classification", model="njgroene/fairface")
|
17 |
def pipeline(img):
|
18 |
bounding_boxes, landmarks = detect_faces(img)
|
19 |
-
|
20 |
img_cropped = img.crop(bb)
|
21 |
|
22 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
|
|
16 |
# pipeline = pipeline(task="image-classification", model="njgroene/fairface")
|
17 |
def pipeline(img):
|
18 |
bounding_boxes, landmarks = detect_faces(img)
|
19 |
+
bb = [bounding_boxes[0,0], bounding_boxes[0,1], bounding_boxes[0,2], bounding_boxes[0,3]]
|
20 |
img_cropped = img.crop(bb)
|
21 |
|
22 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|