Spaces:
Sleeping
Sleeping
Ashraf
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -248,8 +248,7 @@ def split_image(image: Image.Image) -> List[Image.Image]:
|
|
| 248 |
|
| 249 |
|
| 250 |
with gr.Blocks(delete_cache=(600, 600)) as demo:
|
| 251 |
-
gr.Markdown(""
|
| 252 |
-
|
| 253 |
|
| 254 |
with gr.Row():
|
| 255 |
with gr.Column():
|
|
@@ -286,8 +285,10 @@ with gr.Blocks(delete_cache=(600, 600)) as demo:
|
|
| 286 |
with gr.Row():
|
| 287 |
extract_glb_btn = gr.Button("Extract GLB", interactive=False)
|
| 288 |
extract_gs_btn = gr.Button("Extract Gaussian", interactive=False)
|
| 289 |
-
gr.Markdown(
|
| 290 |
-
|
|
|
|
|
|
|
| 291 |
with gr.Column():
|
| 292 |
video_output = gr.Video(label="Generated 3D Asset", autoplay=True, loop=True, height=300)
|
| 293 |
model_output = LitModel3D(label="Extracted GLB/Gaussian", exposure=10.0, height=300)
|
|
@@ -300,8 +301,27 @@ with gr.Blocks(delete_cache=(600, 600)) as demo:
|
|
| 300 |
output_buf = gr.State()
|
| 301 |
|
| 302 |
# Example images at the bottom of the page
|
| 303 |
-
|
| 304 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 305 |
|
| 306 |
# Handlers
|
| 307 |
demo.load(start_session)
|
|
|
|
| 248 |
|
| 249 |
|
| 250 |
with gr.Blocks(delete_cache=(600, 600)) as demo:
|
| 251 |
+
gr.Markdown("")
|
|
|
|
| 252 |
|
| 253 |
with gr.Row():
|
| 254 |
with gr.Column():
|
|
|
|
| 285 |
with gr.Row():
|
| 286 |
extract_glb_btn = gr.Button("Extract GLB", interactive=False)
|
| 287 |
extract_gs_btn = gr.Button("Extract Gaussian", interactive=False)
|
| 288 |
+
gr.Markdown("""
|
| 289 |
+
*NOTE: Gaussian file can be very large (~50MB), it will take a while to display and download.*
|
| 290 |
+
""")
|
| 291 |
+
|
| 292 |
with gr.Column():
|
| 293 |
video_output = gr.Video(label="Generated 3D Asset", autoplay=True, loop=True, height=300)
|
| 294 |
model_output = LitModel3D(label="Extracted GLB/Gaussian", exposure=10.0, height=300)
|
|
|
|
| 301 |
output_buf = gr.State()
|
| 302 |
|
| 303 |
# Example images at the bottom of the page
|
| 304 |
+
with gr.Row() as single_image_example:
|
| 305 |
+
examples = gr.Examples(
|
| 306 |
+
examples=[
|
| 307 |
+
f'assets/example_image/{image}'
|
| 308 |
+
for image in os.listdir("")
|
| 309 |
+
],
|
| 310 |
+
inputs=[image_prompt],
|
| 311 |
+
fn=preprocess_image,
|
| 312 |
+
outputs=[image_prompt],
|
| 313 |
+
run_on_click=True,
|
| 314 |
+
examples_per_page=64,
|
| 315 |
+
)
|
| 316 |
+
with gr.Row(visible=False) as multiimage_example:
|
| 317 |
+
examples_multi = gr.Examples(
|
| 318 |
+
examples=prepare_multi_example(),
|
| 319 |
+
inputs=[image_prompt],
|
| 320 |
+
fn=split_image,
|
| 321 |
+
outputs=[multiimage_prompt],
|
| 322 |
+
run_on_click=True,
|
| 323 |
+
examples_per_page=8,
|
| 324 |
+
)
|
| 325 |
|
| 326 |
# Handlers
|
| 327 |
demo.load(start_session)
|