diff --git a/sixdrepnet/demo.py b/sixdrepnet/demo.py index 16b6a84..1d6f448 100644 --- a/sixdrepnet/demo.py +++ b/sixdrepnet/demo.py @@ -94,7 +94,7 @@ def parse_args(): while True: ret, frame = cap.read() - faces = detector(frame) + faces = detector(frame, cv=True) # set cv to True for bgr input, the default value of cv is False for box, landmarks, score in faces: @@ -114,8 +114,7 @@ def parse_args(): y_max = y_max+int(0.2*bbox_width) img = frame[y_min:y_max, x_min:x_max] - img = Image.fromarray(img) - img = img.convert('RGB') + img = Image.fromarray(img[...,::-1]) img = transformations(img) img = torch.Tensor(img[None, :]).to(device)