NMHung commited on
Commit
f8adcfd
β€’
1 Parent(s): 2d35cad

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -3
main.py CHANGED
@@ -26,7 +26,7 @@ class Model(object):
26
  def load_model(self, weight_path=WEIGHT_PATH):
27
  if not os.path.isfile("./weights/best_weight.pth"):
28
  response = wget.download("https://raw.githubusercontent.com/hungnguyen2611/super-resolution/master/weights/best_weight.pth", "./weights/best_weight.pth")
29
- weight = torch.load(weight_path)
30
  print("[LOADING] Loading encoder...")
31
  self.model_Enc.load_state_dict(weight['model_Enc'])
32
  print("[LOADING] Loading decoder...")
@@ -74,8 +74,7 @@ if __name__ == '__main__':
74
  title = "Super-Resolution Demo USR-DA Unofficial πŸš€πŸš€πŸ”₯"
75
  description = '''
76
  <br>
77
- **This Demo expects low-quality and low-resolution images**
78
- **We are looking for collaborators! Collaborator**
79
  </br>
80
  '''
81
  article = "<p style='text-align: center'><a href='https://openaccess.thecvf.com/content/ICCV2021/papers/Wang_Unsupervised_Real-World_Super-Resolution_A_Domain_Adaptation_Perspective_ICCV_2021_paper.pdf' target='_blank'>Unsupervised Real-World Super-Resolution: A Domain Adaptation Perspective</a> | <a href='https://github.com/hungnguyen2611/super-resolution.git' target='_blank'>Github Repo</a></p>"
 
26
  def load_model(self, weight_path=WEIGHT_PATH):
27
  if not os.path.isfile("./weights/best_weight.pth"):
28
  response = wget.download("https://raw.githubusercontent.com/hungnguyen2611/super-resolution/master/weights/best_weight.pth", "./weights/best_weight.pth")
29
+ weight = torch.load(weight_path, map_location=torch.device(DEVICE))
30
  print("[LOADING] Loading encoder...")
31
  self.model_Enc.load_state_dict(weight['model_Enc'])
32
  print("[LOADING] Loading decoder...")
 
74
  title = "Super-Resolution Demo USR-DA Unofficial πŸš€πŸš€πŸ”₯"
75
  description = '''
76
  <br>
77
+ **This Demo expects low-quality and low-resolution images, better visual on real-world images**
 
78
  </br>
79
  '''
80
  article = "<p style='text-align: center'><a href='https://openaccess.thecvf.com/content/ICCV2021/papers/Wang_Unsupervised_Real-World_Super-Resolution_A_Domain_Adaptation_Perspective_ICCV_2021_paper.pdf' target='_blank'>Unsupervised Real-World Super-Resolution: A Domain Adaptation Perspective</a> | <a href='https://github.com/hungnguyen2611/super-resolution.git' target='_blank'>Github Repo</a></p>"