Skip to content

Commit

Permalink
fix install all models
Browse files Browse the repository at this point in the history
  • Loading branch information
TNTwise committed Dec 21, 2024
1 parent 2309ec4 commit 4a0f581
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion REAL-Video-Enhancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def __init__(self):
parent=self,
)
self.homeTab = HomeTab(parent=self)
self.downloadTab = DownloadTab(parent=self)
self.downloadTab = DownloadTab(parent=self, backends=self.backends)
self.settingsTab = SettingsTab(
parent=self, halfPrecisionSupport=halfPrecisionSupport
)
Expand Down
1 change: 0 additions & 1 deletion src/Util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import cv2
import os
import warnings
import requests
Expand Down
20 changes: 11 additions & 9 deletions src/ui/DownloadTab.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
ncnnUpscaleModels,
pytorchUpscaleModels,
)
from ..constants import MODELS_PATH


def downloadModelsBasedOnInstalledBackend(installed_backends: list):
Expand All @@ -16,30 +17,28 @@ def downloadModelsBasedOnInstalledBackend(installed_backends: list):
match backend:
case "ncnn":
for model in ncnnInterpolateModels:
DownloadModel(model, ncnnInterpolateModels[model][1], "ncnn")
DownloadModel(model, ncnnInterpolateModels[model][1], MODELS_PATH)
for model in ncnnUpscaleModels:
DownloadModel(model, ncnnUpscaleModels[model][1], "ncnn")
DownloadModel(model, ncnnUpscaleModels[model][1], MODELS_PATH)
case "pytorch": # no need for tensorrt as it uses pytorch models
for model in pytorchInterpolateModels:
DownloadModel(
model, pytorchInterpolateModels[model][1], "pytorch"
model, pytorchInterpolateModels[model][1], MODELS_PATH
)
for model in pytorchUpscaleModels:
DownloadModel(model, pytorchUpscaleModels[model][1], "pytorch")
"""case "directml":
for model in onnxInterpolateModels:
DownloadModel(model, onnxInterpolateModels[model][1], "onnx")
for model in onnxUpscaleModels:
DownloadModel(model, onnxUpscaleModels[model][1], "onnx")"""
DownloadModel(model, pytorchUpscaleModels[model][1], MODELS_PATH)



class DownloadTab:
def __init__(
self,
parent: QMainWindow,
backends: list,
):
self.parent = parent
self.downloadDeps = DownloadDependencies()
self.backends = backends
self.QButtonConnect()

def QButtonConnect(self):
Expand All @@ -61,6 +60,9 @@ def QButtonConnect(self):
["ncnn", "pytorch", "tensorrt", "directml"]
)
)
self.parent.downloadSomeModelsBasedOnInstalledBackendbtn.clicked.connect(
lambda: downloadModelsBasedOnInstalledBackend(self.backends)
)
self.parent.uninstallNCNNBtn.clicked.connect(
lambda: self.download("ncnn", False)
)
Expand Down

0 comments on commit 4a0f581

Please sign in to comment.