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