codeslake commited on
Commit
5086b19
1 Parent(s): 6aea108

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -24,8 +24,8 @@ os.makedirs(LR_path)
24
  os.makedirs(Ref_path)
25
  os.makedirs(Ref_path_T)
26
  os.makedirs('result')
27
-
28
- def resize(max_side,img):
29
  #basewidth = max_side
30
  #wpercent = (basewidth/float(img.size[0]))
31
  #hsize = int((float(img.size[1])*float(wpercent)))
@@ -41,8 +41,8 @@ def resize(max_side,img):
41
  return img
42
 
43
  def inference(LR, Ref):
44
- LR = resize(256, LR)
45
- Ref = resize(256, Ref)
46
 
47
  LR.save(os.path.join(LR_path, '0000.png'))
48
  Ref.save(os.path.join(Ref_path, '0000.png'))
@@ -68,8 +68,8 @@ description="Demo application for Reference-based Video Super-Resolution (RefVSR
68
 
69
  article = "<p style='text-align: center'><b>To check the full capability of the module, we recommend to clone Github repository and run RefVSR models on videos using GPUs.</b></p><p style='text-align: center'>This demo runs on CPUs and only supports RefVSR for a single LR and Ref frame due to computational complexity. Hence, the model will not take advantage of temporal LR and Ref frames.</p><p style='text-align: center'>The model is the small-sized model trained with the proposed two-stage training strategy.</p><p style='text-align: center'>The frames will be resized so that the length of a longer side of the frames doesn't exceed 256 pixels.</p><p style='text-align: center'><a href='https://junyonglee.me/projects/RefVSR' target='_blank'>Project</a> | <a href='https://arxiv.org/abs/2203.14537' target='_blank'>arXiv</a> | <a href='https://github.com/codeslake/RefVSR' target='_blank'>Github</a></p>"
70
 
71
- LR = resize(256, Image.open('LR.png'))
72
- Ref = resize(256, Image.open('Ref.png'))
73
  LR.save('LR.png')
74
  Ref.save('Ref.png')
75
 
24
  os.makedirs(Ref_path)
25
  os.makedirs(Ref_path_T)
26
  os.makedirs('result')
27
+ max_side = 512
28
+ def resize(img):
29
  #basewidth = max_side
30
  #wpercent = (basewidth/float(img.size[0]))
31
  #hsize = int((float(img.size[1])*float(wpercent)))
41
  return img
42
 
43
  def inference(LR, Ref):
44
+ LR = resize(LR)
45
+ Ref = resize(Ref)
46
 
47
  LR.save(os.path.join(LR_path, '0000.png'))
48
  Ref.save(os.path.join(Ref_path, '0000.png'))
68
 
69
  article = "<p style='text-align: center'><b>To check the full capability of the module, we recommend to clone Github repository and run RefVSR models on videos using GPUs.</b></p><p style='text-align: center'>This demo runs on CPUs and only supports RefVSR for a single LR and Ref frame due to computational complexity. Hence, the model will not take advantage of temporal LR and Ref frames.</p><p style='text-align: center'>The model is the small-sized model trained with the proposed two-stage training strategy.</p><p style='text-align: center'>The frames will be resized so that the length of a longer side of the frames doesn't exceed 256 pixels.</p><p style='text-align: center'><a href='https://junyonglee.me/projects/RefVSR' target='_blank'>Project</a> | <a href='https://arxiv.org/abs/2203.14537' target='_blank'>arXiv</a> | <a href='https://github.com/codeslake/RefVSR' target='_blank'>Github</a></p>"
70
 
71
+ LR = resize(Image.open('LR.png'))
72
+ Ref = resize(Image.open('Ref.png'))
73
  LR.save('LR.png')
74
  Ref.save('Ref.png')
75