Update app.py
Browse files
app.py
CHANGED
@@ -96,36 +96,33 @@ def process_images(left_img, right_img, method, color_method):
|
|
96 |
return None
|
97 |
|
98 |
# Create the Gradio interface
|
99 |
-
with gr.Blocks(
|
100 |
with gr.Column():
|
101 |
-
gr.Markdown("# 3D Image Generator")
|
102 |
gr.Markdown("Upload left and right images to create 3D images using different methods.")
|
103 |
|
104 |
with gr.Row():
|
105 |
with gr.Column():
|
106 |
-
|
107 |
-
|
108 |
with gr.Row():
|
109 |
with gr.Column():
|
110 |
left_input = gr.Image(label="Left Image")
|
111 |
with gr.Column():
|
112 |
right_input = gr.Image(label="Right Image")
|
113 |
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
info="Select the color processing method"
|
128 |
-
)
|
129 |
|
130 |
generate_btn = gr.Button("Generate 3D Image", variant="primary")
|
131 |
|
@@ -143,10 +140,8 @@ with gr.Blocks(title="3D Image Generator") as app:
|
|
143 |
- **halfcolor**: Balance between color and depth
|
144 |
""")
|
145 |
|
146 |
-
output = gr.Image(label="Generated 3D Image")
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
generate_btn.click(
|
151 |
fn=process_images,
|
152 |
inputs=[left_input, right_input, method, color_method],
|
|
|
96 |
return None
|
97 |
|
98 |
# Create the Gradio interface
|
99 |
+
with gr.Blocks() as app:
|
100 |
with gr.Column():
|
101 |
+
gr.Markdown("# 3D Anaglyph Image Generator")
|
102 |
gr.Markdown("Upload left and right images to create 3D images using different methods.")
|
103 |
|
104 |
with gr.Row():
|
105 |
with gr.Column():
|
106 |
+
|
|
|
107 |
with gr.Row():
|
108 |
with gr.Column():
|
109 |
left_input = gr.Image(label="Left Image")
|
110 |
with gr.Column():
|
111 |
right_input = gr.Image(label="Right Image")
|
112 |
|
113 |
+
method = gr.Radio(
|
114 |
+
["anaglyph", "parallel", "crossed"],
|
115 |
+
label="Method",
|
116 |
+
value="anaglyph",
|
117 |
+
info="Select the 3D image creation method"
|
118 |
+
)
|
119 |
+
|
120 |
+
color_method = gr.Radio(
|
121 |
+
["optimized", "true", "mono", "color", "halfcolor"],
|
122 |
+
label="Color Method",
|
123 |
+
value="optimized",
|
124 |
+
info="Select the color processing method"
|
125 |
+
)
|
|
|
|
|
126 |
|
127 |
generate_btn = gr.Button("Generate 3D Image", variant="primary")
|
128 |
|
|
|
140 |
- **halfcolor**: Balance between color and depth
|
141 |
""")
|
142 |
|
143 |
+
output = gr.Image(label="Generated 3D Anaglyph Image")
|
144 |
+
|
|
|
|
|
145 |
generate_btn.click(
|
146 |
fn=process_images,
|
147 |
inputs=[left_input, right_input, method, color_method],
|