Omnibus commited on
Commit
ea72b89
·
1 Parent(s): 2aa464f

Update esr.py

Browse files
Files changed (1) hide show
  1. esr.py +3 -2
esr.py CHANGED
@@ -51,14 +51,15 @@ file_url = [
51
  'https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-wdn-x4v3.pth',
52
  'https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-x4v3.pth'
53
  ]
 
 
54
  if not os.path.isfile(model_path):
55
  ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
56
  for url in file_url:
57
  # model_path will be updated
58
  model_path = load_file_from_url(
59
  url=url, model_dir=os.path.join(ROOT_DIR, 'weights'), progress=True, file_name=None)
60
- def realesrgan1(img, model_name, denoise_strength, face_enhance, outscale):
61
- model_path = os.path.join('weights', model_name + '.pth')
62
 
63
  # Use dni to control the denoise strength
64
  dni_weight = None
 
51
  'https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-wdn-x4v3.pth',
52
  'https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-x4v3.pth'
53
  ]
54
+ model_path = os.path.join('weights', model_name + '.pth')
55
+
56
  if not os.path.isfile(model_path):
57
  ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
58
  for url in file_url:
59
  # model_path will be updated
60
  model_path = load_file_from_url(
61
  url=url, model_dir=os.path.join(ROOT_DIR, 'weights'), progress=True, file_name=None)
62
+ def realesrgan1(img, model_name, denoise_strength, face_enhance, outscale,model_path=model_path):
 
63
 
64
  # Use dni to control the denoise strength
65
  dni_weight = None