From 8d7ad93edc2ed2a65ce9eb852dc635cae31736db Mon Sep 17 00:00:00 2001 From: "Liu, Kaixuan" Date: Mon, 28 Jul 2025 14:37:10 -0400 Subject: [PATCH] add intel xpu support Signed-off-by: Liu, Kaixuan --- face_alignment/detection/core.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/face_alignment/detection/core.py b/face_alignment/detection/core.py index 5d80397..2ef58f8 100644 --- a/face_alignment/detection/core.py +++ b/face_alignment/detection/core.py @@ -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):