aboutsummaryrefslogtreecommitdiff
path: root/modules/dat_model.py
diff options
context:
space:
mode:
authorn0kovo <n0kovo@riseup.net>2024-01-19 00:39:14 +0100
committern0kovo <n0kovo@riseup.net>2024-01-19 00:39:14 +0100
commit2e7efe47b6c78a59f9f3d64c1d30f54751a31a56 (patch)
tree8cd82f9c6df6d8f74142c224fb6d5e29888d567f /modules/dat_model.py
parenta97147bc8a43ade7c18bb755f0cfac111fc1a619 (diff)
Minor cleanup
Diffstat (limited to 'modules/dat_model.py')
-rw-r--r--modules/dat_model.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/modules/dat_model.py b/modules/dat_model.py
index 8637351c..495d5f49 100644
--- a/modules/dat_model.py
+++ b/modules/dat_model.py
@@ -1,12 +1,10 @@
import os
-import sys
-from modules import modelloader, devices
+from modules import modelloader, errors
from modules.shared import cmd_opts, opts
from modules.upscaler import Upscaler, UpscalerData
from modules.upscaler_utils import upscale_with_model
-from icecream import ic
class UpscalerDAT(Upscaler):
def __init__(self, user_path):
@@ -24,13 +22,13 @@ class UpscalerDAT(Upscaler):
if model.name in opts.dat_enabled_models:
self.scalers.append(model)
- def do_upscale(self, img, selected_model):
+ def do_upscale(self, img, path):
try:
- info = self.load_model(selected_model)
- except Exception as e:
+ info = self.load_model(path)
+ except Exception:
errors.report(f"Unable to load DAT model {path}", exc_info=True)
return img
-
+
model_descriptor = modelloader.load_spandrel_model(
info.local_data_path,
device=self.device,