|  |  | @ -96,16 +96,21 @@ Most universal is [EDSR](https://huggingface.co/eugenesiow/edsr-base). Sample py | 
			
		
	
		
			
				
					|  |  |  | from super_image import EdsrModel, ImageLoader | 
			
		
	
		
			
				
					|  |  |  | from PIL import Image | 
			
		
	
		
			
				
					|  |  |  | import requests | 
			
		
	
		
			
				
					|  |  |  | import os | 
			
		
	
		
			
				
					|  |  |  | import time | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | url = 'https://paperswithcode.com/media/datasets/Set5-0000002728-07a9793f_zA3bDjj.jpg' | 
			
		
	
		
			
				
					|  |  |  | image = Image.open(requests.get(url, stream=True).raw) | 
			
		
	
		
			
				
					|  |  |  | modelx2 = EdsrModel.from_pretrained('eugenesiow/edsr-base', scale=2) | 
			
		
	
		
			
				
					|  |  |  | modelx3 = EdsrModel.from_pretrained('eugenesiow/edsr-base', scale=3) | 
			
		
	
		
			
				
					|  |  |  | modelx4 = EdsrModel.from_pretrained('eugenesiow/edsr-base', scale=4) | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | model = EdsrModel.from_pretrained('eugenesiow/edsr-base', scale=2)      # scale 2, 3 and 4 models available | 
			
		
	
		
			
				
					|  |  |  | for filename in os.listdir("./Input"): | 
			
		
	
		
			
				
					|  |  |  |     if filename.endswith('.png'): | 
			
		
	
		
			
				
					|  |  |  |         print(filename) | 
			
		
	
		
			
				
					|  |  |  |         image = Image.open("./Input/" + filename) | 
			
		
	
		
			
				
					|  |  |  |         inputs = ImageLoader.load_image(image) | 
			
		
	
		
			
				
					|  |  |  | preds = model(inputs) | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | ImageLoader.save_image(preds, './scaled_2x.png')                        # save the output 2x scaled image to `./scaled_2x.png` | 
			
		
	
		
			
				
					|  |  |  | ImageLoader.save_compare(inputs, preds, './scaled_2x_compare.png')      # save an output comparing the super-image with a bicubic scaling | 
			
		
	
		
			
				
					|  |  |  |         preds = modelx4(preds) | 
			
		
	
		
			
				
					|  |  |  |         ImageLoader.save_image(preds, "./Output/upscaled-" + filename) | 
			
		
	
		
			
				
					|  |  |  |         del image, inputs, preds | 
			
		
	
		
			
				
					|  |  |  | ``` | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | ## Read More: | 
			
		
	
	
		
			
				
					|  |  | 
 |