Spaces:
Runtime error
Runtime error
danielsapit
commited on
Commit
•
494344f
1
Parent(s):
12f34a6
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ import requests
|
|
11 |
|
12 |
for model_path in ['fbcnn_gray.pth','fbcnn_color.pth']:
|
13 |
if os.path.exists(model_path):
|
14 |
-
print(f'
|
15 |
else:
|
16 |
url = 'https://github.com/jiaxi-jiang/FBCNN/releases/download/v1.0/{}'.format(os.path.basename(model_path))
|
17 |
r = requests.get(url, allow_redirects=True)
|
@@ -109,7 +109,7 @@ def inference(input_img, is_gray, input_quality, enable_zoom, zoom, x_shift, y_s
|
|
109 |
|
110 |
return img_E, in_img, out_img, [state[0],img_E]
|
111 |
|
112 |
-
|
113 |
fn = inference,
|
114 |
inputs = [gr.inputs.Image(label="Input Image"),
|
115 |
gr.inputs.Checkbox(label="Grayscale (Check this if your image is grayscale)"),
|
@@ -136,7 +136,7 @@ interface = gr.Interface(
|
|
136 |
["cemetry.jpg",False,70,False,20,44,77],
|
137 |
["michelangelo_david.jpg",True,30,False,12,53,27],
|
138 |
["elon_musk.jpg",False,45,False,15,33,30],
|
139 |
-
["text.jpg",True,
|
140 |
title = "JPEG Artifacts Removal [FBCNN]",
|
141 |
description = "Gradio Demo for JPEG Artifacts Removal. To use it, simply upload your image, "
|
142 |
"or click one of the examples to load them. Check out the paper and the original GitHub repo at the link below. "
|
|
|
11 |
|
12 |
for model_path in ['fbcnn_gray.pth','fbcnn_color.pth']:
|
13 |
if os.path.exists(model_path):
|
14 |
+
print(f'{model_path} exists.')
|
15 |
else:
|
16 |
url = 'https://github.com/jiaxi-jiang/FBCNN/releases/download/v1.0/{}'.format(os.path.basename(model_path))
|
17 |
r = requests.get(url, allow_redirects=True)
|
|
|
109 |
|
110 |
return img_E, in_img, out_img, [state[0],img_E]
|
111 |
|
112 |
+
gr.Interface(
|
113 |
fn = inference,
|
114 |
inputs = [gr.inputs.Image(label="Input Image"),
|
115 |
gr.inputs.Checkbox(label="Grayscale (Check this if your image is grayscale)"),
|
|
|
136 |
["cemetry.jpg",False,70,False,20,44,77],
|
137 |
["michelangelo_david.jpg",True,30,False,12,53,27],
|
138 |
["elon_musk.jpg",False,45,False,15,33,30],
|
139 |
+
["text.jpg",True,70,False,50,11,29]],
|
140 |
title = "JPEG Artifacts Removal [FBCNN]",
|
141 |
description = "Gradio Demo for JPEG Artifacts Removal. To use it, simply upload your image, "
|
142 |
"or click one of the examples to load them. Check out the paper and the original GitHub repo at the link below. "
|