Unverified Commit 2a5afd04 authored by Igor Pavlov's avatar Igor Pavlov Committed by GitHub
Browse files

Merge pull request #8 from dinosaurtirex/main

Updated requirements and add main.py file
parents 9489fa05 bfc22e45
import os
import torch
from PIL import Image
import numpy as np
from realesrgan import RealESRGAN
def main() -> int:
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
model = RealESRGAN(device, scale=4)
model.load_weights('weights/RealESRGAN_x4.pth')
for i, image in enumerate(os.listdir("inputs")):
image = Image.open(f"inputs/{image}").convert('RGB')
sr_image = model.predict(image)
sr_image.save(f'results/{i}.png')
return 1
if __name__ == '__main__':
main()
\ No newline at end of file
......@@ -4,3 +4,4 @@ Pillow
torch>=1.7
torchvision>=0.8.0
tqdm
imageio
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment