Spaces:
Build error
Build error
Update colorization.py
Browse files- colorization.py +13 -14
colorization.py
CHANGED
@@ -66,29 +66,27 @@ output = cv2.cvtColor(output, cv2.COLOR_BGR2RGB)
|
|
66 |
|
67 |
|
68 |
|
69 |
-
|
70 |
inference, [
|
71 |
-
gr.
|
72 |
-
|
73 |
-
|
74 |
gr.inputs.Number(label="Rescaling factor", default=2),
|
|
|
|
|
75 |
# gr.Slider(0, 100, label='Weight, only for CodeFormer. 0 for better quality, 100 for better identity', default=50)
|
76 |
], [
|
77 |
-
gr.outputs.Image(type="numpy", label="Output (The
|
78 |
-
gr.outputs.File(label="Download the
|
79 |
],
|
80 |
title=title,
|
81 |
description=description,
|
82 |
article=article,
|
83 |
-
# examples=[['AI-generate.jpg', 'v1.4', 2, 50], ['lincoln.jpg', 'v1.4', 2, 50], ['Blake_Lively.jpg', 'v1.4', 2, 50],
|
84 |
-
# ['10045.png', 'v1.4', 2, 50]]).launch()
|
85 |
-
examples=[['a1.jpg', 'v1.4', 2], ['a2.jpg', 'v1.4', 2], ['a3.jpg', 'v1.4', 2],['a4.jpg', 'v1.4', 2]])
|
86 |
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
|
|
|
92 |
def create_interface():
|
93 |
with gr.Blocks() as enhancer:
|
94 |
gr.Markdown("Colorize old black & white photos")
|
@@ -104,4 +102,5 @@ def run_code():
|
|
104 |
create_interface()
|
105 |
|
106 |
# The main function
|
107 |
-
run_code()
|
|
|
|
66 |
|
67 |
|
68 |
|
69 |
+
colorize = gr.Interface(
|
70 |
inference, [
|
71 |
+
gr.Markdown("Colorize old black & white photos"),
|
72 |
+
gr.Image(type="filepath", label="Input"),
|
73 |
+
|
74 |
gr.inputs.Number(label="Rescaling factor", default=2),
|
75 |
+
gr.Button("Upscale & Colorize!")
|
76 |
+
|
77 |
# gr.Slider(0, 100, label='Weight, only for CodeFormer. 0 for better quality, 100 for better identity', default=50)
|
78 |
], [
|
79 |
+
gr.outputs.Image(type="numpy", label="Output (The colorized image)"),
|
80 |
+
gr.outputs.File(label="Download the colorized image")
|
81 |
],
|
82 |
title=title,
|
83 |
description=description,
|
84 |
article=article,
|
|
|
|
|
|
|
85 |
|
86 |
+
colorize.queue(concurrency_count=4)
|
87 |
+
colorize.launch()
|
|
|
|
|
88 |
|
89 |
+
'''
|
90 |
def create_interface():
|
91 |
with gr.Blocks() as enhancer:
|
92 |
gr.Markdown("Colorize old black & white photos")
|
|
|
102 |
create_interface()
|
103 |
|
104 |
# The main function
|
105 |
+
run_code()
|
106 |
+
'''
|