mirror of
https://github.com/YaoFANGUK/video-subtitle-remover.git
synced 2026-05-08 10:57:29 +08:00
初步支持 macOS (Apple Silicon)
升级至PP-OCRv5 Tested with Python 3.13 感谢用户 "期望" 提供的macOS设备用于开发测试
This commit is contained in:
@@ -395,7 +395,7 @@ class SubtitleRemover:
|
||||
accelerator_name = self.hardware_accelerator.accelerator_name
|
||||
if accelerator_name == 'DirectML' and config.inpaintMode.value in [InpaintMode.STTN_AUTO, InpaintMode.STTN_DET]:
|
||||
model_device = 'DirectML'
|
||||
if self.hardware_accelerator.has_cuda():
|
||||
if self.hardware_accelerator.has_cuda() or self.hardware_accelerator.has_mps():
|
||||
model_device = accelerator_name
|
||||
self.append_output(tr['Main']['UseModel'].format(f"{model_friendly_name} ({model_device})"))
|
||||
|
||||
@@ -446,7 +446,7 @@ class SubtitleRemover:
|
||||
@cached_property
|
||||
def lama_inpaint(self):
|
||||
model_path = os.path.join(self.model_config.LAMA_MODEL_DIR, 'big-lama.pt')
|
||||
device = self.hardware_accelerator.device if self.hardware_accelerator.has_cuda() else torch.device("cpu")
|
||||
device = self.hardware_accelerator.device if self.hardware_accelerator.has_cuda() or self.hardware_accelerator.has_mps() else torch.device("cpu")
|
||||
return LamaInpaint(device, model_path)
|
||||
|
||||
@cached_property
|
||||
|
||||
Reference in New Issue
Block a user