Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,6 @@ from RealESRGAN import RealESRGAN
|
|
| 4 |
import gradio as gr
|
| 5 |
|
| 6 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 7 |
-
print(device)
|
| 8 |
model2 = RealESRGAN(device, scale=2)
|
| 9 |
model2.load_weights('weights/RealESRGAN_x2.pth', download=True)
|
| 10 |
model4 = RealESRGAN(device, scale=4)
|
|
@@ -27,7 +26,7 @@ def inference(image, size):
|
|
| 27 |
|
| 28 |
title = "Face Real ESRGAN UpScale: 2x 4x 8x"
|
| 29 |
description = "This is an unofficial demo for Real-ESRGAN. Scales the resolution of a photo. This model shows better results on faces compared to the original version.<br>Telegram BOT: https://t.me/restoration_photo_bot"
|
| 30 |
-
article = "<div style='text-align: center;'>Twitter <a href='https://twitter.com/DoEvent' target='_blank'>Max Skobeev</a> | <a href='https://huggingface.co/sberbank-ai/Real-ESRGAN' target='_blank'>Model card</a
|
| 31 |
|
| 32 |
|
| 33 |
gr.Interface(inference,
|
|
@@ -43,5 +42,5 @@ gr.Interface(inference,
|
|
| 43 |
examples=[['groot.jpeg', "2x"]],
|
| 44 |
allow_flagging='never',
|
| 45 |
cache_examples=False,
|
| 46 |
-
).queue(
|
| 47 |
|
|
|
|
| 4 |
import gradio as gr
|
| 5 |
|
| 6 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
|
|
|
| 7 |
model2 = RealESRGAN(device, scale=2)
|
| 8 |
model2.load_weights('weights/RealESRGAN_x2.pth', download=True)
|
| 9 |
model4 = RealESRGAN(device, scale=4)
|
|
|
|
| 26 |
|
| 27 |
title = "Face Real ESRGAN UpScale: 2x 4x 8x"
|
| 28 |
description = "This is an unofficial demo for Real-ESRGAN. Scales the resolution of a photo. This model shows better results on faces compared to the original version.<br>Telegram BOT: https://t.me/restoration_photo_bot"
|
| 29 |
+
article = "<div style='text-align: center;'>Twitter <a href='https://twitter.com/DoEvent' target='_blank'>Max Skobeev</a> | <a href='https://huggingface.co/sberbank-ai/Real-ESRGAN' target='_blank'>Model card</a><div>"
|
| 30 |
|
| 31 |
|
| 32 |
gr.Interface(inference,
|
|
|
|
| 42 |
examples=[['groot.jpeg', "2x"]],
|
| 43 |
allow_flagging='never',
|
| 44 |
cache_examples=False,
|
| 45 |
+
).queue().launch(show_error=True)
|
| 46 |
|