NeuroDonu commited on
Commit
ef502b6
·
verified ·
1 Parent(s): a069be8

Update visomaster/visomaster_install.py

Browse files
Files changed (1) hide show
  1. visomaster/visomaster_install.py +31 -11
visomaster/visomaster_install.py CHANGED
@@ -23,7 +23,7 @@ updater_bat = os.path.join(base_dir, "updater.bat")
23
  start_bat = os.path.join(base_dir, "start_nvidia.bat")
24
  ffmpeg_path = os.path.join(visomaster_dir, "dependencies", "ffmpeg.exe")
25
  pip_cmd = [python, "-m", "pip", "install", "uv"]
26
- uv_cmd = [python, "-m", "uv", "pip", "install", "-r"]
27
  models_path = os.path.join(visomaster_dir, "model_assets")
28
  models_name = os.path.join(models_path, "visomaster_models.7z")
29
  cuda_bin_path = os.path.join(base_dir, "CUDA", "bin")
@@ -51,21 +51,41 @@ def clone_git_repo(repo_url, clone_dir):
51
  return
52
  subprocess.run([git, "clone", repo_url, clone_dir], check=True)
53
 
54
- def modify_requirements_file(file_path):
55
- with open(file_path, 'r', encoding='utf-8') as file:
56
- content = file.read()
57
- modified_content = content.replace("--extra-index-url", "--index-url")
58
- with open(file_path, 'w', encoding='utf-8') as file:
59
- file.write(modified_content)
60
-
61
  def setup_cuda_paths():
62
  if os.path.exists(cuda_bin_path) and os.path.exists(cuda_lib_path):
63
  current_path = os.environ.get("PATH", "")
64
  os.environ["PATH"] = f"{cuda_bin_path};{cuda_lib_path};{current_path}"
65
 
66
- def install_requirements():
67
- subprocess.run(pip_cmd, check=True)
68
- subprocess.run(uv_cmd + [requirements], check=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
 
70
  def download_bat():
71
  download_with_requests(updater_url, updater_bat)
 
23
  start_bat = os.path.join(base_dir, "start_nvidia.bat")
24
  ffmpeg_path = os.path.join(visomaster_dir, "dependencies", "ffmpeg.exe")
25
  pip_cmd = [python, "-m", "pip", "install", "uv"]
26
+ uv_cmd = [python, "-m", "uv", "pip", "install"]
27
  models_path = os.path.join(visomaster_dir, "model_assets")
28
  models_name = os.path.join(models_path, "visomaster_models.7z")
29
  cuda_bin_path = os.path.join(base_dir, "CUDA", "bin")
 
51
  return
52
  subprocess.run([git, "clone", repo_url, clone_dir], check=True)
53
 
 
 
 
 
 
 
 
54
  def setup_cuda_paths():
55
  if os.path.exists(cuda_bin_path) and os.path.exists(cuda_lib_path):
56
  current_path = os.environ.get("PATH", "")
57
  os.environ["PATH"] = f"{cuda_bin_path};{cuda_lib_path};{current_path}"
58
 
59
+ def install_req():
60
+ uv_torch = [uv_cmd, "torch==2.4.1", "torchvision", "torchaudio", "--index-url", "https://download.pytorch.org/whl/cu124"]
61
+ uv_tensorrt = [uv_cmd, "tensorrt==10.6.0", "tensorrt-cu12_libs==10.6.0", "tensorrt-cu12_bindings==10.6.0", "--index-url", "https://pypi.nvidia.com"]
62
+ dependencies = [
63
+ "numpy==1.26.4",
64
+ "opencv-python==4.10.0.84",
65
+ "scikit-image==0.21.0",
66
+ "pillow==9.5.0",
67
+ "onnx==1.16.1",
68
+ "protobuf==4.23.2",
69
+ "psutil==6.0.0",
70
+ "onnxruntime-gpu==1.20.0",
71
+ "packaging==24.1",
72
+ "PySide6==6.7.2",
73
+ "kornia",
74
+ "tqdm",
75
+ "ftfy",
76
+ "regex",
77
+ "pyvirtualcam==0.11.1",
78
+ "numexpr",
79
+ "onnxsim",
80
+ "requests",
81
+ "pyqt-toast-notification==1.3.2",
82
+ "qdarkstyle",
83
+ "pyqtdarktheme"
84
+ ]
85
+ subprocess.run(uv_torch, check=True)
86
+ subprocess.run(uv_tensorrt, check=True)
87
+ for dependency in dependencies:
88
+ subprocess.run(uv_cmd + dependency.split(), check=True)
89
 
90
  def download_bat():
91
  download_with_requests(updater_url, updater_bat)