danielsapit commited on
Commit
5cb71e1
·
1 Parent(s): b002866

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -13,6 +13,7 @@ for model_path in ['fbcnn_gray.pth','fbcnn_color.pth']:
13
  if os.path.exists(model_path):
14
  print(f'{model_path} exists.')
15
  else:
 
16
  url = 'https://github.com/jiaxi-jiang/FBCNN/releases/download/v1.0/{}'.format(os.path.basename(model_path))
17
  r = requests.get(url, allow_redirects=True)
18
  open(model_path, 'wb').write(r.content)
@@ -36,6 +37,7 @@ def inference(input_img, is_gray, input_quality, zoom, x_shift, y_shift):
36
  if os.path.exists(model_path):
37
  print(f'loading model from {model_path}')
38
  else:
 
39
  os.makedirs(os.path.dirname(model_path), exist_ok=True)
40
  url = 'https://github.com/jiaxi-jiang/FBCNN/releases/download/v1.0/{}'.format(os.path.basename(model_path))
41
  r = requests.get(url, allow_redirects=True)
@@ -141,6 +143,9 @@ gr.Interface(
141
  "JPEG artifacts are noticeable distortion of images caused by JPEG lossy compression. "
142
  "This is not a super resolution AI but a JPEG compression artifact remover.",
143
  article = "<p style='text-align: center;'><a href='https://github.com/jiaxi-jiang/FBCNN'>FBCNN GitHub Repo</a><br>"
144
- "<a href='https://arxiv.org/abs/2109.14573'>Towards Flexible Blind JPEG Artifacts Removal (FBCNN, ICCV 2021)</a></p>",
 
 
 
145
  allow_flagging="never"
146
  ).launch(enable_queue=True)
 
13
  if os.path.exists(model_path):
14
  print(f'{model_path} exists.')
15
  else:
16
+ print("downloading model")
17
  url = 'https://github.com/jiaxi-jiang/FBCNN/releases/download/v1.0/{}'.format(os.path.basename(model_path))
18
  r = requests.get(url, allow_redirects=True)
19
  open(model_path, 'wb').write(r.content)
 
37
  if os.path.exists(model_path):
38
  print(f'loading model from {model_path}')
39
  else:
40
+ print("downloading model")
41
  os.makedirs(os.path.dirname(model_path), exist_ok=True)
42
  url = 'https://github.com/jiaxi-jiang/FBCNN/releases/download/v1.0/{}'.format(os.path.basename(model_path))
43
  r = requests.get(url, allow_redirects=True)
 
143
  "JPEG artifacts are noticeable distortion of images caused by JPEG lossy compression. "
144
  "This is not a super resolution AI but a JPEG compression artifact remover.",
145
  article = "<p style='text-align: center;'><a href='https://github.com/jiaxi-jiang/FBCNN'>FBCNN GitHub Repo</a><br>"
146
+ "<a href='https://arxiv.org/abs/2109.14573'>Towards Flexible Blind JPEG Artifacts Removal (FBCNN, ICCV 2021)</a><br>"
147
+ "<a href='https://jiaxi-jiang.github.io/'>Jiaxi Jiang, </a>"
148
+ "<a href='https://cszn.github.io/'>Kai Zhang, </a>"
149
+ "<a href='http://people.ee.ethz.ch/~timofter/'>Radu Timofte</a></p>",
150
  allow_flagging="never"
151
  ).launch(enable_queue=True)