Spaces:
Running
Running
Upload app.py
Browse files
app.py
CHANGED
@@ -155,23 +155,33 @@ with gr.Blocks(title="Depth Anything AC - Depth Estimation Demo", theme=gr.theme
|
|
155 |
5. View the results and download
|
156 |
""")
|
157 |
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
# Upload image component
|
168 |
upload_image = gr.Image(
|
169 |
-
label="
|
170 |
type="pil",
|
171 |
-
height=
|
172 |
-
visible=True
|
173 |
-
container=True,
|
174 |
-
show_label=True
|
175 |
)
|
176 |
|
177 |
# Camera component
|
@@ -179,31 +189,15 @@ with gr.Blocks(title="Depth Anything AC - Depth Estimation Demo", theme=gr.theme
|
|
179 |
label="Camera Input",
|
180 |
type="pil",
|
181 |
sources=["webcam"],
|
182 |
-
height=
|
183 |
-
visible=False
|
184 |
-
container=True,
|
185 |
-
show_label=True
|
186 |
-
)
|
187 |
-
|
188 |
-
colormap_choice = gr.Dropdown(
|
189 |
-
choices=["Spectral", "Inferno", "Gray"],
|
190 |
-
value="Spectral",
|
191 |
-
label="Colormap Style"
|
192 |
-
)
|
193 |
-
|
194 |
-
submit_btn = gr.Button(
|
195 |
-
"🎯 Generate Depth Map",
|
196 |
-
variant="primary",
|
197 |
-
size="lg"
|
198 |
)
|
199 |
|
200 |
-
with gr.Column(scale=1):
|
201 |
output_image = gr.Image(
|
202 |
label="Depth Map Result",
|
203 |
type="pil",
|
204 |
-
height=
|
205 |
-
container=True,
|
206 |
-
show_label=True
|
207 |
)
|
208 |
|
209 |
# Function to switch between upload and camera input
|
|
|
155 |
5. View the results and download
|
156 |
""")
|
157 |
|
158 |
+
# Input controls row
|
159 |
+
with gr.Row():
|
160 |
+
input_source = gr.Radio(
|
161 |
+
choices=["Upload Image", "Use Camera"],
|
162 |
+
value="Upload Image",
|
163 |
+
label="Input Source"
|
164 |
+
)
|
165 |
+
colormap_choice = gr.Dropdown(
|
166 |
+
choices=["Spectral", "Inferno", "Gray"],
|
167 |
+
value="Spectral",
|
168 |
+
label="Colormap Style"
|
169 |
+
)
|
170 |
+
submit_btn = gr.Button(
|
171 |
+
"🎯 Generate Depth Map",
|
172 |
+
variant="primary",
|
173 |
+
size="lg"
|
174 |
+
)
|
175 |
+
|
176 |
+
# Images row - perfectly aligned
|
177 |
+
with gr.Row():
|
178 |
+
with gr.Column(scale=1, min_width=400):
|
179 |
# Upload image component
|
180 |
upload_image = gr.Image(
|
181 |
+
label="Input Image",
|
182 |
type="pil",
|
183 |
+
height=400,
|
184 |
+
visible=True
|
|
|
|
|
185 |
)
|
186 |
|
187 |
# Camera component
|
|
|
189 |
label="Camera Input",
|
190 |
type="pil",
|
191 |
sources=["webcam"],
|
192 |
+
height=400,
|
193 |
+
visible=False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
)
|
195 |
|
196 |
+
with gr.Column(scale=1, min_width=400):
|
197 |
output_image = gr.Image(
|
198 |
label="Depth Map Result",
|
199 |
type="pil",
|
200 |
+
height=400
|
|
|
|
|
201 |
)
|
202 |
|
203 |
# Function to switch between upload and camera input
|