Spaces:
Sleeping
Sleeping
Delete model.py
Browse files
model.py
DELETED
|
@@ -1,13 +0,0 @@
|
|
| 1 |
-
from realesrgan import RealESRGAN
|
| 2 |
-
from PIL import Image
|
| 3 |
-
import torch
|
| 4 |
-
|
| 5 |
-
device = torch.device("cpu")
|
| 6 |
-
|
| 7 |
-
model = RealESRGAN(device, scale=2)
|
| 8 |
-
model.load_weights("RealESRGAN_x2.pth", download=True)
|
| 9 |
-
|
| 10 |
-
def upscale_image(image: Image.Image):
|
| 11 |
-
image = image.convert("RGB")
|
| 12 |
-
result = model.predict(image)
|
| 13 |
-
return result
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|