Spaces:
Runtime error
Runtime error
Commit
·
13070d7
1
Parent(s):
ddf5341
Update app.py
Browse files
app.py
CHANGED
@@ -71,29 +71,31 @@ with gr.Blocks() as app:
|
|
71 |
refined_result = gr.Image(interactive=False, label="Refined Generated Image")
|
72 |
post_processed_result = gr.Image(interactive=False, label="Post-Processed Image")
|
73 |
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
|
|
|
|
97 |
|
98 |
post_process_button = gr.Button("Apply Post-Processing")
|
99 |
|
|
|
71 |
refined_result = gr.Image(interactive=False, label="Refined Generated Image")
|
72 |
post_processed_result = gr.Image(interactive=False, label="Post-Processed Image")
|
73 |
|
74 |
+
with gr.Tabs():
|
75 |
+
with gr.TabItem("Color"):
|
76 |
+
enable_color_limit = gr.Checkbox(label="Enable", value=False)
|
77 |
+
palette_size_color = gr.Slider(label="Palette Size", minimum=1, maximum=256, step=1, value=16)
|
78 |
+
quantization_methods_color = gr.Radio(choices=["Median Cut", "Maximum Coverage", "Fast Octree"], label="Colors Quantization Method")
|
79 |
+
dither_methods_color = gr.Radio(choices=["None", "Floyd-Steinberg"], label="Colors Dither Method")
|
80 |
+
k_means_color = gr.Checkbox(label="Enable k-means for color quantization", value=True)
|
81 |
+
|
82 |
+
with gr.TabItem("Grayscale"):
|
83 |
+
enable_grayscale = gr.Checkbox(label="Enable", value=False)
|
84 |
+
palette_size_gray = gr.Slider(label="Palette Size", minimum=1, maximum=256, step=1, value=16)
|
85 |
+
quantization_methods_gray = gr.Radio(choices=["Median Cut", "Maximum Coverage", "Fast Octree"], label="Colors Quantization Method")
|
86 |
+
dither_methods_gray = gr.Radio(choices=["None", "Floyd-Steinberg"], label="Colors Dither Method")
|
87 |
+
k_means_gray = gr.Checkbox(label="Enable k-means for color quantization", value=True)
|
88 |
+
|
89 |
+
with gr.TabItem("Black and white"):
|
90 |
+
enable_black_and_white = gr.Checkbox(label="Enable", value=False)
|
91 |
+
inverse_black_and_white = gr.Checkbox(label="Inverse", value=False)
|
92 |
+
threshold_black_and_white = gr.Slider(label="Threshold", minimum=1, maximum=256, step=1, value=128)
|
93 |
+
|
94 |
+
with gr.TabItem("Custom color palette"):
|
95 |
+
enable_custom_palette = gr.Checkbox(label="Enable", value=False)
|
96 |
+
palette_image = gr.Image(label="Color palette image", type="pil")
|
97 |
+
palette_size_custom = gr.Slider(label="Palette Size", minimum=1, maximum=256, step=1, value=16)
|
98 |
+
dither_methods_custom = gr.Radio(choices=["None", "Floyd-Steinberg"], label="Colors Dither Method")
|
99 |
|
100 |
post_process_button = gr.Button("Apply Post-Processing")
|
101 |
|