nicer ui
Browse files
app.py
CHANGED
@@ -158,44 +158,43 @@ with gr.Blocks(css=css) as app:
|
|
158 |
gr.Markdown("# 3D Anaglyph Image Generator")
|
159 |
gr.Markdown("Upload left and right images to create 3D images using different methods.")
|
160 |
|
|
|
161 |
with gr.Row():
|
162 |
-
|
163 |
-
|
164 |
-
left_input = gr.Image(label="Left Image")
|
165 |
-
right_input = gr.Image(label="Right Image")
|
166 |
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
|
196 |
-
|
197 |
|
198 |
-
|
199 |
|
200 |
generate_btn.click(
|
201 |
fn=process_images,
|
|
|
158 |
gr.Markdown("# 3D Anaglyph Image Generator")
|
159 |
gr.Markdown("Upload left and right images to create 3D images using different methods.")
|
160 |
|
161 |
+
|
162 |
with gr.Row():
|
163 |
+
left_input = gr.Image(label="Left Image")
|
164 |
+
right_input = gr.Image(label="Right Image")
|
|
|
|
|
165 |
|
166 |
+
method = gr.Radio(
|
167 |
+
["anaglyph", "parallel", "crossed"],
|
168 |
+
label="Method",
|
169 |
+
value="anaglyph",
|
170 |
+
info="Select the 3D image creation method"
|
171 |
+
)
|
172 |
|
173 |
+
color_method = gr.Radio(
|
174 |
+
["optimized", "true", "mono", "color", "halfcolor", "dubois", "dubois_optimized"],
|
175 |
+
label="Color Method",
|
176 |
+
value="dubois",
|
177 |
+
info="Select the color processing method"
|
178 |
+
)
|
179 |
|
180 |
+
with gr.Accordion("Details about methods", open=False):
|
181 |
+
gr.Markdown("""
|
182 |
+
### Methods:
|
183 |
+
- **anaglyph**: Creates a red-cyan 3D image (requires 3D glasses)
|
184 |
+
- **parallel**: Creates side-by-side images for parallel viewing
|
185 |
+
- **crossed**: Creates side-by-side images for cross-eyed viewing
|
186 |
|
187 |
+
### Color Methods:
|
188 |
+
- **optimized**: Best for most images (default)
|
189 |
+
- **true**: True color anaglyph
|
190 |
+
- **mono**: Monochrome output
|
191 |
+
- **color**: Full color (may cause ghosting)
|
192 |
+
- **halfcolor**: Balance between color and depth
|
193 |
+
""")
|
194 |
|
195 |
+
generate_btn = gr.Button("Generate 3D Image", variant="primary")
|
196 |
|
197 |
+
output = gr.Image(label="Generated 3D Anaglyph Image")
|
198 |
|
199 |
generate_btn.click(
|
200 |
fn=process_images,
|