Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,10 +8,12 @@ from basicsr.utils.download_util import load_file_from_url
|
|
| 8 |
from realesrgan import RealESRGANer
|
| 9 |
from realesrgan.archs.srvgg_arch import SRVGGNetCompact
|
| 10 |
from torchvision.transforms.functional import rgb_to_grayscale
|
|
|
|
| 11 |
|
| 12 |
last_file = None
|
| 13 |
img_mode = "RGBA"
|
| 14 |
|
|
|
|
| 15 |
def realesrgan(img, model_name, denoise_strength, face_enhance, outscale):
|
| 16 |
"""Real-ESRGAN function to restore (and upscale) images.
|
| 17 |
"""
|
|
|
|
| 8 |
from realesrgan import RealESRGANer
|
| 9 |
from realesrgan.archs.srvgg_arch import SRVGGNetCompact
|
| 10 |
from torchvision.transforms.functional import rgb_to_grayscale
|
| 11 |
+
import spaces
|
| 12 |
|
| 13 |
last_file = None
|
| 14 |
img_mode = "RGBA"
|
| 15 |
|
| 16 |
+
@spaces.GPU
|
| 17 |
def realesrgan(img, model_name, denoise_strength, face_enhance, outscale):
|
| 18 |
"""Real-ESRGAN function to restore (and upscale) images.
|
| 19 |
"""
|