fffiloni commited on
Commit
b3b4066
·
verified ·
1 Parent(s): f118b28

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +47 -40
app.py CHANGED
@@ -97,48 +97,55 @@ def process_images(left_img, right_img, method, color_method):
97
 
98
  # Create the Gradio interface
99
  with gr.Blocks(title="3D Image Generator") as app:
100
- gr.Markdown("# 3D Image Generator")
101
- gr.Markdown("Upload left and right images to create 3D images using different methods.")
102
-
103
- with gr.Row():
104
- with gr.Column():
105
- left_input = gr.Image(label="Left Image")
106
- with gr.Column():
107
- right_input = gr.Image(label="Right Image")
108
-
109
- with gr.Row():
110
- with gr.Column():
111
- method = gr.Radio(
112
- ["anaglyph", "parallel", "crossed"],
113
- label="Method",
114
- value="anaglyph",
115
- info="Select the 3D image creation method"
116
- )
117
- with gr.Column():
118
- color_method = gr.Radio(
119
- ["optimized", "true", "mono", "color", "halfcolor"],
120
- label="Color Method",
121
- value="optimized",
122
- info="Select the color processing method"
123
- )
124
-
125
- generate_btn = gr.Button("Generate 3D Image", variant="primary")
126
-
127
- output = gr.Image(label="Generated 3D Image")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
 
129
- gr.Markdown("""
130
- ### Methods:
131
- - **anaglyph**: Creates a red-cyan 3D image (requires 3D glasses)
132
- - **parallel**: Creates side-by-side images for parallel viewing
133
- - **crossed**: Creates side-by-side images for cross-eyed viewing
134
 
135
- ### Color Methods:
136
- - **optimized**: Best for most images (default)
137
- - **true**: True color anaglyph
138
- - **mono**: Monochrome output
139
- - **color**: Full color (may cause ghosting)
140
- - **halfcolor**: Balance between color and depth
141
- """)
142
 
143
  generate_btn.click(
144
  fn=process_images,
 
97
 
98
  # Create the Gradio interface
99
  with gr.Blocks(title="3D Image Generator") as app:
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
+ with gr.Row():
115
+ with gr.Column():
116
+ method = gr.Radio(
117
+ ["anaglyph", "parallel", "crossed"],
118
+ label="Method",
119
+ value="anaglyph",
120
+ info="Select the 3D image creation method"
121
+ )
122
+ with gr.Column():
123
+ color_method = gr.Radio(
124
+ ["optimized", "true", "mono", "color", "halfcolor"],
125
+ label="Color Method",
126
+ value="optimized",
127
+ info="Select the color processing method"
128
+ )
129
+
130
+ generate_btn = gr.Button("Generate 3D Image", variant="primary")
131
+
132
+ gr.Markdown("""
133
+ ### Methods:
134
+ - **anaglyph**: Creates a red-cyan 3D image (requires 3D glasses)
135
+ - **parallel**: Creates side-by-side images for parallel viewing
136
+ - **crossed**: Creates side-by-side images for cross-eyed viewing
137
+
138
+ ### Color Methods:
139
+ - **optimized**: Best for most images (default)
140
+ - **true**: True color anaglyph
141
+ - **mono**: Monochrome output
142
+ - **color**: Full color (may cause ghosting)
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,