mirror of
https://github.com/YaoFANGUK/video-subtitle-remover.git
synced 2026-05-22 06:13:24 +08:00
Revert "由于PySimpleGUI作者故意移除免费的旧版本,改用PySimpleGUI-4-foss"
This commit is contained in:
@@ -7,20 +7,12 @@ import logging
|
||||
import platform
|
||||
import stat
|
||||
from fsplit.filesplit import Filesplit
|
||||
import onnxruntime as ort
|
||||
|
||||
# 项目版本号
|
||||
VERSION = "1.1.1"
|
||||
import paddle
|
||||
# ×××××××××××××××××××× [不要改] start ××××××××××××××××××××
|
||||
paddle.disable_signal_handler()
|
||||
logging.disable(logging.DEBUG) # 关闭DEBUG日志的打印
|
||||
logging.disable(logging.WARNING) # 关闭WARNING日志的打印
|
||||
try:
|
||||
import torch_directml
|
||||
device = torch_directml.device(torch_directml.default_device())
|
||||
USE_DML = True
|
||||
except:
|
||||
USE_DML = False
|
||||
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
||||
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
||||
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
LAMA_MODEL_PATH = os.path.join(BASE_DIR, 'models', 'big-lama')
|
||||
STTN_MODEL_PATH = os.path.join(BASE_DIR, 'models', 'sttn', 'infer_model.pth')
|
||||
@@ -58,27 +50,6 @@ if 'ffmpeg.exe' not in os.listdir(os.path.join(BASE_DIR, '', 'ffmpeg', 'win_x64'
|
||||
# 将ffmpeg添加可执行权限
|
||||
os.chmod(FFMPEG_PATH, stat.S_IRWXU + stat.S_IRWXG + stat.S_IRWXO)
|
||||
os.environ['KMP_DUPLICATE_LIB_OK'] = 'True'
|
||||
|
||||
# 是否使用ONNX(DirectML/AMD/Intel)
|
||||
ONNX_PROVIDERS = []
|
||||
available_providers = ort.get_available_providers()
|
||||
for provider in available_providers:
|
||||
if provider in [
|
||||
"CPUExecutionProvider"
|
||||
]:
|
||||
continue
|
||||
if provider not in [
|
||||
"DmlExecutionProvider", # DirectML,适用于 Windows GPU
|
||||
"ROCMExecutionProvider", # AMD ROCm
|
||||
"MIGraphXExecutionProvider", # AMD MIGraphX
|
||||
"VitisAIExecutionProvider", # AMD VitisAI,适用于 RyzenAI & Windows, 实测和DirectML性能似乎差不多
|
||||
"OpenVINOExecutionProvider", # Intel GPU
|
||||
"MetalExecutionProvider", # Apple macOS
|
||||
"CoreMLExecutionProvider", # Apple macOS
|
||||
"CUDAExecutionProvider", # Nvidia GPU
|
||||
]:
|
||||
continue
|
||||
ONNX_PROVIDERS.append(provider)
|
||||
# ×××××××××××××××××××× [不要改] end ××××××××××××××××××××
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user