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

Update esr.py

Browse files
Files changed (1) hide show
  1. esr.py +2 -1
esr.py CHANGED
@@ -51,7 +51,6 @@ 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
- model_path = os.path.join('weights', model_name + '.pth')
55
  if not os.path.isfile(model_path):
56
  ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
57
  for url in file_url:
@@ -59,6 +58,8 @@ if not os.path.isfile(model_path):
59
  model_path = load_file_from_url(
60
  url=url, model_dir=os.path.join(ROOT_DIR, 'weights'), progress=True, file_name=None)
61
  def realesrgan1(img, model_name, denoise_strength, face_enhance, outscale):
 
 
62
  # Use dni to control the denoise strength
63
  dni_weight = None
64
  if model_name == 'realesr-general-x4v3' and denoise_strength != 1:
 
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:
 
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
65
  if model_name == 'realesr-general-x4v3' and denoise_strength != 1: