ShahzebKhoso commited on
Commit
988617d
1 Parent(s): aa382c7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -7,12 +7,12 @@ import requests
7
 
8
  # Load the model and processor
9
  processor = AutoImageProcessor.from_pretrained("caidas/swin2SR-realworld-sr-x4-64-bsrgan-psnr")
10
- model = Swin2SRForImageSuperResolution.from_pretrained("caidas/swin2SR-realworld-sr-x4-64-bsrgan-psnr").to('cuda')
11
 
12
  # Define the function for super-resolution
13
  def super_resolve(image):
14
  # Preprocess the input image
15
- inputs = processor(images=image, return_tensors="pt").to('cuda')
16
 
17
  # Perform super-resolution
18
  with torch.no_grad():
 
7
 
8
  # Load the model and processor
9
  processor = AutoImageProcessor.from_pretrained("caidas/swin2SR-realworld-sr-x4-64-bsrgan-psnr")
10
+ model = Swin2SRForImageSuperResolution.from_pretrained("caidas/swin2SR-realworld-sr-x4-64-bsrgan-psnr").to('cpu')
11
 
12
  # Define the function for super-resolution
13
  def super_resolve(image):
14
  # Preprocess the input image
15
+ inputs = processor(images=image, return_tensors="pt").to('cpu')
16
 
17
  # Perform super-resolution
18
  with torch.no_grad():