Move load_file_from_url to modelloader

This commit is contained in:
Aarni Koskela
2023-05-29 09:34:26 +03:00
parent 59419bd64a
commit 89352a2f52
6 changed files with 39 additions and 18 deletions

View File

@@ -2,7 +2,6 @@ import os
import numpy as np
from PIL import Image
from basicsr.utils.download_util import load_file_from_url
from realesrgan import RealESRGANer
from modules.upscaler import Upscaler, UpscalerData
@@ -10,6 +9,7 @@ from modules.shared import cmd_opts, opts
from modules import modelloader, errors
class UpscalerRealESRGAN(Upscaler):
def __init__(self, path):
self.name = "RealESRGAN"
@@ -71,7 +71,7 @@ class UpscalerRealESRGAN(Upscaler):
return None
if info.local_data_path.startswith("http"):
info.local_data_path = load_file_from_url(url=info.data_path, model_dir=self.model_download_path, progress=True)
info.local_data_path = modelloader.load_file_from_url(info.data_path, model_dir=self.model_download_path)
return info
except Exception: