modify weight path

This commit is contained in:
Xintao
2022-09-19 01:43:22 +08:00
parent 89aa45c72d
commit 0ac8d66d39
8 changed files with 23 additions and 28 deletions

View File

@@ -56,13 +56,10 @@ class RealESRGANer():
assert len(model_path) == len(dni_weight), 'model_path and dni_weight should have the save length.'
loadnet = self.dni(model_path[0], model_path[1], dni_weight)
else:
# if the model_path starts with https, it will first download models to the folder: realesrgan/weights
# if the model_path starts with https, it will first download models to the folder: weights
if model_path.startswith('https://'):
model_path = load_file_from_url(
url=model_path,
model_dir=os.path.join(ROOT_DIR, 'realesrgan/weights'),
progress=True,
file_name=None)
url=model_path, model_dir=os.path.join(ROOT_DIR, 'weights'), progress=True, file_name=None)
loadnet = torch.load(model_path, map_location=torch.device('cpu'))
# prefer to use params_ema

View File

@@ -1,3 +0,0 @@
# Weights
Put the downloaded weights to this folder.