Spaces:
Running
Running
Upload app.py
Browse files
app.py
CHANGED
@@ -141,7 +141,16 @@ def capture_and_predict(camera_image, colormap_choice):
|
|
141 |
return predict_depth(camera_image, colormap_choice)
|
142 |
|
143 |
|
144 |
-
with gr.Blocks(title="Depth Anything AC - Depth Estimation Demo", theme=gr.themes.Soft()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
gr.Markdown("""
|
146 |
# π Depth Anything AC - Depth Estimation Demo
|
147 |
|
@@ -173,31 +182,41 @@ with gr.Blocks(title="Depth Anything AC - Depth Estimation Demo", theme=gr.theme
|
|
173 |
size="lg"
|
174 |
)
|
175 |
|
176 |
-
#
|
177 |
with gr.Row():
|
178 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
# Upload image component
|
180 |
upload_image = gr.Image(
|
181 |
-
label="Input Image",
|
182 |
type="pil",
|
183 |
-
height=
|
184 |
-
visible=True
|
|
|
|
|
185 |
)
|
186 |
|
187 |
# Camera component
|
188 |
camera_image = gr.Image(
|
189 |
-
label="Camera Input",
|
190 |
type="pil",
|
191 |
sources=["webcam"],
|
192 |
-
height=
|
193 |
-
visible=False
|
|
|
|
|
194 |
)
|
195 |
|
196 |
-
|
|
|
197 |
output_image = gr.Image(
|
198 |
-
label="Depth Map Result",
|
199 |
type="pil",
|
200 |
-
height=
|
|
|
|
|
201 |
)
|
202 |
|
203 |
# Add download button to match the height of upload controls
|
|
|
141 |
return predict_depth(camera_image, colormap_choice)
|
142 |
|
143 |
|
144 |
+
with gr.Blocks(title="Depth Anything AC - Depth Estimation Demo", theme=gr.themes.Soft(), css="""
|
145 |
+
.image-container {
|
146 |
+
display: flex !important;
|
147 |
+
align-items: flex-start !important;
|
148 |
+
justify-content: center !important;
|
149 |
+
}
|
150 |
+
.gradio-image {
|
151 |
+
vertical-align: top !important;
|
152 |
+
}
|
153 |
+
""") as demo:
|
154 |
gr.Markdown("""
|
155 |
# π Depth Anything AC - Depth Estimation Demo
|
156 |
|
|
|
182 |
size="lg"
|
183 |
)
|
184 |
|
185 |
+
# Labels row
|
186 |
with gr.Row():
|
187 |
+
gr.HTML("<h3 style='text-align: center; margin: 10px;'>π· Input Image</h3>")
|
188 |
+
gr.HTML("<h3 style='text-align: center; margin: 10px;'>π Depth Map Result</h3>")
|
189 |
+
|
190 |
+
# Images row - force vertical alignment
|
191 |
+
with gr.Row(equal_height=True):
|
192 |
+
# Left column for input
|
193 |
+
with gr.Column(scale=1):
|
194 |
# Upload image component
|
195 |
upload_image = gr.Image(
|
|
|
196 |
type="pil",
|
197 |
+
height=450,
|
198 |
+
visible=True,
|
199 |
+
show_label=False,
|
200 |
+
container=False
|
201 |
)
|
202 |
|
203 |
# Camera component
|
204 |
camera_image = gr.Image(
|
|
|
205 |
type="pil",
|
206 |
sources=["webcam"],
|
207 |
+
height=450,
|
208 |
+
visible=False,
|
209 |
+
show_label=False,
|
210 |
+
container=False
|
211 |
)
|
212 |
|
213 |
+
# Right column for output
|
214 |
+
with gr.Column(scale=1):
|
215 |
output_image = gr.Image(
|
|
|
216 |
type="pil",
|
217 |
+
height=450,
|
218 |
+
show_label=False,
|
219 |
+
container=False
|
220 |
)
|
221 |
|
222 |
# Add download button to match the height of upload controls
|