Spaces:
Runtime error
Runtime error
pablo
commited on
Commit
·
38e04f9
1
Parent(s):
fcabde6
row
Browse files
app.py
CHANGED
@@ -224,30 +224,31 @@ def create_3d_demo():
|
|
224 |
gr.Markdown("### Image to 3D mesh")
|
225 |
|
226 |
with gr.Row():
|
227 |
-
with gr.
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
with gr.
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
with gr.Row() as share_btn_container:
|
244 |
-
with gr.Column():
|
245 |
-
result_og = gr.Model3D(label="original 3d reconstruction", clear_color=[
|
246 |
-
1.0, 1.0, 1.0, 1.0])
|
247 |
-
|
248 |
-
result_new = gr.Model3D(label="inpainted 3d reconstruction", clear_color=[
|
249 |
-
1.0, 1.0, 1.0, 1.0])
|
250 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
|
252 |
submit = gr.Button("Submit")
|
253 |
submit.click(fn=predict_images_3d, inputs=[image, depth, prompt, negative_prompt, guidance_scale, steps, strength, scheduler, checkbox], outputs=[result_og, result_new, share_btn_container], api_name='run')
|
|
|
224 |
gr.Markdown("### Image to 3D mesh")
|
225 |
|
226 |
with gr.Row():
|
227 |
+
with gr.Row():
|
228 |
+
with gr.Column():
|
229 |
+
image = gr.Image(source='upload', tool='sketch', elem_id="image_upload", type="numpy", label="Upload",height=400)
|
230 |
+
depth = gr.Image(source='upload', elem_id="depth_upload", type="numpy", label="Upload",height=400)
|
231 |
+
checkbox = gr.Checkbox(label="Keep occlusion edges", value=False)
|
232 |
+
prompt = gr.Textbox(placeholder="Your prompt (what you want in place of what is erased)", show_label=False, elem_id="prompt")
|
233 |
+
|
234 |
+
with gr.Accordion(label="Advanced Settings", open=False):
|
235 |
+
with gr.Row(mobile_collapse=False, equal_height=True):
|
236 |
+
guidance_scale = gr.Number(value=7.5, minimum=1.0, maximum=20.0, step=0.1, label="guidance_scale")
|
237 |
+
steps = gr.Number(value=20, minimum=10, maximum=30, step=1, label="steps")
|
238 |
+
strength = gr.Number(value=0.99, minimum=0.01, maximum=0.99, step=0.01, label="strength")
|
239 |
+
negative_prompt = gr.Textbox(label="negative_prompt", placeholder="Your negative prompt", info="what you don't want to see in the image")
|
240 |
+
with gr.Row(mobile_collapse=False, equal_height=True):
|
241 |
+
schedulers = ["DEISMultistepScheduler", "HeunDiscreteScheduler", "EulerDiscreteScheduler", "DPMSolverMultistepScheduler", "DPMSolverMultistepScheduler-Karras", "DPMSolverMultistepScheduler-Karras-SDE"]
|
242 |
+
scheduler = gr.Dropdown(label="Schedulers", choices=schedulers, value="EulerDiscreteScheduler")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
243 |
|
244 |
+
with gr.Row() as share_btn_container:
|
245 |
+
with gr.Column():
|
246 |
+
result_og = gr.Model3D(label="original 3d reconstruction", clear_color=[
|
247 |
+
1.0, 1.0, 1.0, 1.0])
|
248 |
+
|
249 |
+
result_new = gr.Model3D(label="inpainted 3d reconstruction", clear_color=[
|
250 |
+
1.0, 1.0, 1.0, 1.0])
|
251 |
+
|
252 |
|
253 |
submit = gr.Button("Submit")
|
254 |
submit.click(fn=predict_images_3d, inputs=[image, depth, prompt, negative_prompt, guidance_scale, steps, strength, scheduler, checkbox], outputs=[result_og, result_new, share_btn_container], api_name='run')
|