Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -21,8 +21,8 @@ dtype = torch.float16 if device != 'cpu' else torch.float32
|
|
21 |
def magnify_image(image, scale_factor=2):
|
22 |
start_time = time.time()
|
23 |
try:
|
24 |
-
if image.size[0] >
|
25 |
-
message = 'Failed! Image too large, please resize to <
|
26 |
else:
|
27 |
image = magnifier.magnify(image, scale_factor=scale_factor)
|
28 |
fprint(f'Inference time: {time.time() - start_time:.2f}s')
|
@@ -35,10 +35,10 @@ with gr.Blocks() as demo:
|
|
35 |
if not os.path.exists('imgs'):
|
36 |
os.mkdir('imgs')
|
37 |
|
38 |
-
gr.Markdown('# Free Anime Image Scale Up Demo (CPU)')
|
39 |
-
gr.Markdown('## 免费动漫插图图片分辨率放大 (最大支持500x500,更大尺寸请clone repo本地运行)')
|
40 |
-
gr.Markdown('## Powered by Waifu2x')
|
41 |
-
gr.Markdown("## Author: [yangheng95](https://github.com/yangheng95) Github:[Github](https://github.com/yangheng95/SuperResolutionAnimeDiffusion)")
|
42 |
|
43 |
with gr.Row():
|
44 |
with gr.Column(scale=40):
|
|
|
21 |
def magnify_image(image, scale_factor=2):
|
22 |
start_time = time.time()
|
23 |
try:
|
24 |
+
if image.size[0] > 1500 or image.size[1] > 1500:
|
25 |
+
message = 'Failed! Image too large, please resize to <3000x3000 or clone the repo and code to allow larger images on your local machine.'
|
26 |
else:
|
27 |
image = magnifier.magnify(image, scale_factor=scale_factor)
|
28 |
fprint(f'Inference time: {time.time() - start_time:.2f}s')
|
|
|
35 |
if not os.path.exists('imgs'):
|
36 |
os.mkdir('imgs')
|
37 |
|
38 |
+
# gr.Markdown('# Free Anime Image Scale Up Demo (CPU)')
|
39 |
+
# gr.Markdown('## 免费动漫插图图片分辨率放大 (最大支持500x500,更大尺寸请clone repo本地运行)')
|
40 |
+
# gr.Markdown('## Powered by Waifu2x')
|
41 |
+
# gr.Markdown("## Author: [yangheng95](https://github.com/yangheng95) Github:[Github](https://github.com/yangheng95/SuperResolutionAnimeDiffusion)")
|
42 |
|
43 |
with gr.Row():
|
44 |
with gr.Column(scale=40):
|