Spaces:
Running on Zero
Running on Zero
Commit ·
9df336b
1
Parent(s): 33107b3
examples
Browse files- .gitattributes +1 -0
- app.py +65 -0
- examples/conf50_filter_sky.mp4 +3 -0
- examples/conf_20.mp4 +3 -0
- examples/conf_30.mp4 +3 -0
.gitattributes
CHANGED
|
@@ -1,3 +1,4 @@
|
|
| 1 |
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 2 |
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 3 |
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 1 |
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 2 |
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 3 |
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
examples/** filter=lfs diff=lfs merge=lfs -text
|
app.py
CHANGED
|
@@ -293,6 +293,15 @@ def update_visual_log():
|
|
| 293 |
return "Updating visualization..."
|
| 294 |
|
| 295 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 296 |
def build_ui():
|
| 297 |
theme = gr.themes.Ocean()
|
| 298 |
theme.set(
|
|
@@ -404,6 +413,62 @@ def build_ui():
|
|
| 404 |
mask_black_bg = gr.Checkbox(label="Filter Black Background", value=False)
|
| 405 |
mask_white_bg = gr.Checkbox(label="Filter White Background", value=False)
|
| 406 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 407 |
input_video.change(
|
| 408 |
fn=update_gallery_on_upload,
|
| 409 |
inputs=[input_video, input_images, video_sample_fps],
|
|
|
|
| 293 |
return "Updating visualization..."
|
| 294 |
|
| 295 |
|
| 296 |
+
# -------------------------------------------------------------------------
|
| 297 |
+
# Example videos
|
| 298 |
+
# -------------------------------------------------------------------------
|
| 299 |
+
|
| 300 |
+
conf_20_video = "examples/conf_20.mp4"
|
| 301 |
+
conf_30_video = "examples/conf_30.mp4"
|
| 302 |
+
conf50_filter_sky_video = "examples/conf50_filter_sky.mp4"
|
| 303 |
+
|
| 304 |
+
|
| 305 |
def build_ui():
|
| 306 |
theme = gr.themes.Ocean()
|
| 307 |
theme.set(
|
|
|
|
| 413 |
mask_black_bg = gr.Checkbox(label="Filter Black Background", value=False)
|
| 414 |
mask_white_bg = gr.Checkbox(label="Filter White Background", value=False)
|
| 415 |
|
| 416 |
+
# ---------------------- Examples section ----------------------
|
| 417 |
+
examples = [
|
| 418 |
+
[conf_20_video, 1.0, None, 20.0, False, False, True, False, 1000],
|
| 419 |
+
[conf_30_video, 1.0, None, 30.0, False, False, True, False, 1000],
|
| 420 |
+
[conf50_filter_sky_video, 1.0, None, 50.0, False, False, True, True, 1000],
|
| 421 |
+
]
|
| 422 |
+
|
| 423 |
+
def example_pipeline(
|
| 424 |
+
input_video,
|
| 425 |
+
video_sample_fps,
|
| 426 |
+
input_images,
|
| 427 |
+
conf_thres,
|
| 428 |
+
mask_black_bg,
|
| 429 |
+
mask_white_bg,
|
| 430 |
+
show_cam,
|
| 431 |
+
mask_sky,
|
| 432 |
+
max_points_k,
|
| 433 |
+
):
|
| 434 |
+
target_dir, image_paths = handle_uploads(input_video, input_images, video_sample_fps)
|
| 435 |
+
glbfile, log_msg = gradio_demo(
|
| 436 |
+
target_dir,
|
| 437 |
+
conf_thres,
|
| 438 |
+
mask_black_bg,
|
| 439 |
+
mask_white_bg,
|
| 440 |
+
show_cam,
|
| 441 |
+
mask_sky,
|
| 442 |
+
max_points_k,
|
| 443 |
+
)
|
| 444 |
+
return glbfile, log_msg, target_dir, image_paths
|
| 445 |
+
|
| 446 |
+
gr.Markdown("Click any row to load an example.")
|
| 447 |
+
|
| 448 |
+
gr.Examples(
|
| 449 |
+
examples=examples,
|
| 450 |
+
inputs=[
|
| 451 |
+
input_video,
|
| 452 |
+
video_sample_fps,
|
| 453 |
+
input_images,
|
| 454 |
+
conf_thres,
|
| 455 |
+
mask_black_bg,
|
| 456 |
+
mask_white_bg,
|
| 457 |
+
show_cam,
|
| 458 |
+
mask_sky,
|
| 459 |
+
max_points_k,
|
| 460 |
+
],
|
| 461 |
+
outputs=[
|
| 462 |
+
reconstruction_output,
|
| 463 |
+
log_output,
|
| 464 |
+
target_dir_output,
|
| 465 |
+
image_gallery,
|
| 466 |
+
],
|
| 467 |
+
fn=example_pipeline,
|
| 468 |
+
cache_examples=False,
|
| 469 |
+
examples_per_page=50,
|
| 470 |
+
)
|
| 471 |
+
|
| 472 |
input_video.change(
|
| 473 |
fn=update_gallery_on_upload,
|
| 474 |
inputs=[input_video, input_images, video_sample_fps],
|
examples/conf50_filter_sky.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:49b52f8a127db51724df71a0808e0308c09c293946e24fd26cb2d1066069de18
|
| 3 |
+
size 6539814
|
examples/conf_20.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:92861721942faa2e996443665d18cc5909ec1e6db1d6fc564c648fa198b1dd65
|
| 3 |
+
size 20177803
|
examples/conf_30.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e5e847d9b3863d29c12501347074c58c6cc4e68fb91f4c963bbe3f91294a169a
|
| 3 |
+
size 10681415
|