Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ from PIL import Image
|
|
| 4 |
import io
|
| 5 |
import numpy as np
|
| 6 |
import torch
|
| 7 |
-
from super_image import
|
| 8 |
|
| 9 |
app = FastAPI()
|
| 10 |
|
|
@@ -12,7 +12,7 @@ models = {}
|
|
| 12 |
|
| 13 |
def get_model(scale: int):
|
| 14 |
if scale not in models:
|
| 15 |
-
model =
|
| 16 |
model = model.eval()
|
| 17 |
models[scale] = model
|
| 18 |
return models[scale]
|
|
|
|
| 4 |
import io
|
| 5 |
import numpy as np
|
| 6 |
import torch
|
| 7 |
+
from super_image import DrlnModel, ImageLoader
|
| 8 |
|
| 9 |
app = FastAPI()
|
| 10 |
|
|
|
|
| 12 |
|
| 13 |
def get_model(scale: int):
|
| 14 |
if scale not in models:
|
| 15 |
+
model = DrlnModel.from_pretrained(f"eugenesiow/drln", scale=scale)
|
| 16 |
model = model.eval()
|
| 17 |
models[scale] = model
|
| 18 |
return models[scale]
|