Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions face_alignment/detection/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,17 @@ def __init__(self, device, verbose):
logger = logging.getLogger(__name__)
logger.warning("Detection running on CPU, this may be potentially slow.")

if 'cpu' not in device and 'cuda' not in device and 'mps' not in device:
if (
"cpu" not in device
and "cuda" not in device
and "mps" not in device
and "xpu" not in device
):
if verbose:
logger.error("Expected values for device are: {cpu, cuda, mps} but got: %s", device)
logger.error(
"Expected values for device are: {cpu, cuda, mps, xpu} but got: %s",
device,
)
raise ValueError

def detect_from_image(self, tensor_or_path):
Expand Down