Youngsun Lim commited on
Commit
9c1b594
ยท
1 Parent(s): f64f353

add example videos via git-lfs and update app.py

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ *.mp4 filter=lfs diff=lfs merge=lfs -text
app.py CHANGED
@@ -469,26 +469,26 @@ EXAMPLES = {
469
  "bad": "examples/WallPushUps_bad.mp4",
470
  },
471
  }
472
- EX_CACHE = {}
473
- for cls, files in EXAMPLES.items():
474
- EX_CACHE[cls] = {"real": None, "bad": None}
475
- for kind, fname in files.items():
476
- try:
477
- EX_CACHE[cls][kind] = hf_hub_download(
478
- repo_id=REPO_ID,
479
- filename=fname,
480
- repo_type="dataset",
481
- token=HF_TOKEN,
482
- local_dir="/tmp",
483
- local_dir_use_symlinks=False,
484
- )
485
- except Exception as e:
486
- print(f"[WARN] example missing: {cls} {kind} -> {fname}: {e}")
487
-
488
- for cls in EX_CACHE:
489
- for kind in EX_CACHE[cls]:
490
- if EX_CACHE[cls][kind]:
491
- EX_CACHE[cls][kind] = ensure_muted_copy(EX_CACHE[cls][kind])
492
 
493
 
494
  CLEAN_BG_CSS = r"""
@@ -598,18 +598,53 @@ with gr.Blocks(css=CLEAN_BG_CSS) as demo:
598
  return gr.update(interactive=checked, variant=("primary" if checked else "secondary"))
599
  understood.change(_toggle_start, inputs=understood, outputs=start_btn)
600
 
601
- # Examples: Squats
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
602
  with gr.Group():
603
  gr.Markdown("### Examples: BodyWeightSquats")
604
  with gr.Row():
605
  with gr.Column():
606
  gr.Markdown("**Expected depiction of action**")
607
- gr.Video(value=EX_CACHE["BodyWeightSquats"]["real"], height=240, autoplay=False, elem_id="ex_squats_real",)
 
 
 
 
 
608
  with gr.Column():
609
  gr.Markdown("**Poorly generated action**")
610
- gr.Video(value=EX_CACHE["BodyWeightSquats"]["bad"], height=240, autoplay=False)
611
- if not (EX_CACHE["BodyWeightSquats"]["real"] and EX_CACHE["BodyWeightSquats"]["bad"]):
612
- gr.Markdown("> โš ๏ธ Upload `examples/BodyWeightSquats_real.mp4` and `_bad.mp4` to show both samples.")
 
 
 
613
 
614
  # Examples: WallPushUps
615
  with gr.Group():
@@ -617,12 +652,20 @@ with gr.Blocks(css=CLEAN_BG_CSS) as demo:
617
  with gr.Row():
618
  with gr.Column():
619
  gr.Markdown("**Expected depiction of action**")
620
- gr.Video(value=EX_CACHE["WallPushUps"]["real"], height=240, autoplay=False, elem_id="ex_wallpushups_real",)
 
 
 
 
 
621
  with gr.Column():
622
  gr.Markdown("**Poorly generated action**")
623
- gr.Video(value=EX_CACHE["WallPushUps"]["bad"], height=240, autoplay=False)
624
- if not (EX_CACHE["WallPushUps"]["real"] and EX_CACHE["WallPushUps"]["bad"]):
625
- gr.Markdown("> โš ๏ธ Upload `examples/WallPushUps_real.mp4` and `_bad.mp4` to show both samples.")
 
 
 
626
 
627
  gr.HTML("""
628
  <script>
 
469
  "bad": "examples/WallPushUps_bad.mp4",
470
  },
471
  }
472
+ # EX_CACHE = {}
473
+ # for cls, files in EXAMPLES.items():
474
+ # EX_CACHE[cls] = {"real": None, "bad": None}
475
+ # for kind, fname in files.items():
476
+ # try:
477
+ # EX_CACHE[cls][kind] = hf_hub_download(
478
+ # repo_id=REPO_ID,
479
+ # filename=fname,
480
+ # repo_type="dataset",
481
+ # token=HF_TOKEN,
482
+ # local_dir="/tmp",
483
+ # local_dir_use_symlinks=False,
484
+ # )
485
+ # except Exception as e:
486
+ # print(f"[WARN] example missing: {cls} {kind} -> {fname}: {e}")
487
+
488
+ # for cls in EX_CACHE:
489
+ # for kind in EX_CACHE[cls]:
490
+ # if EX_CACHE[cls][kind]:
491
+ # EX_CACHE[cls][kind] = ensure_muted_copy(EX_CACHE[cls][kind])
492
 
493
 
494
  CLEAN_BG_CSS = r"""
 
598
  return gr.update(interactive=checked, variant=("primary" if checked else "secondary"))
599
  understood.change(_toggle_start, inputs=understood, outputs=start_btn)
600
 
601
+ # # Examples: Squats
602
+ # with gr.Group():
603
+ # gr.Markdown("### Examples: BodyWeightSquats")
604
+ # with gr.Row():
605
+ # with gr.Column():
606
+ # gr.Markdown("**Expected depiction of action**")
607
+ # gr.Video(value=EX_CACHE["BodyWeightSquats"]["real"], height=240, autoplay=False, elem_id="ex_squats_real",)
608
+ # with gr.Column():
609
+ # gr.Markdown("**Poorly generated action**")
610
+ # gr.Video(value=EX_CACHE["BodyWeightSquats"]["bad"], height=240, autoplay=False)
611
+ # if not (EX_CACHE["BodyWeightSquats"]["real"] and EX_CACHE["BodyWeightSquats"]["bad"]):
612
+ # gr.Markdown("> โš ๏ธ Upload `examples/BodyWeightSquats_real.mp4` and `_bad.mp4` to show both samples.")
613
+
614
+ # # Examples: WallPushUps
615
+ # with gr.Group():
616
+ # gr.Markdown("### Examples: WallPushUps")
617
+ # with gr.Row():
618
+ # with gr.Column():
619
+ # gr.Markdown("**Expected depiction of action**")
620
+ # gr.Video(value=EX_CACHE["WallPushUps"]["real"], height=240, autoplay=False, elem_id="ex_wallpushups_real",)
621
+ # with gr.Column():
622
+ # gr.Markdown("**Poorly generated action**")
623
+ # gr.Video(value=EX_CACHE["WallPushUps"]["bad"], height=240, autoplay=False)
624
+ # if not (EX_CACHE["WallPushUps"]["real"] and EX_CACHE["WallPushUps"]["bad"]):
625
+ # gr.Markdown("> โš ๏ธ Upload `examples/WallPushUps_real.mp4` and `_bad.mp4` to show both samples.")
626
+
627
+
628
+ # Examples: BodyWeightSquats
629
  with gr.Group():
630
  gr.Markdown("### Examples: BodyWeightSquats")
631
  with gr.Row():
632
  with gr.Column():
633
  gr.Markdown("**Expected depiction of action**")
634
+ gr.Video(
635
+ value="examples/BodyWeightSquats_good.mp4", # ๋ฌด์Œ์œผ๋กœ ๋งŒ๋“  ์ข‹์€ ์˜ˆ์‹œ
636
+ height=240,
637
+ autoplay=False,
638
+ elem_id="ex_squats_real",
639
+ )
640
  with gr.Column():
641
  gr.Markdown("**Poorly generated action**")
642
+ gr.Video(
643
+ value="examples/BodyWeightSquats_bad.mp4", # ๋‚˜์œ ์˜ˆ์‹œ
644
+ height=240,
645
+ autoplay=False,
646
+ )
647
+
648
 
649
  # Examples: WallPushUps
650
  with gr.Group():
 
652
  with gr.Row():
653
  with gr.Column():
654
  gr.Markdown("**Expected depiction of action**")
655
+ gr.Video(
656
+ value="examples/WallPushups_good.mp4", # ๋ฌด์Œ์œผ๋กœ ๋‹ค์‹œ ๋งŒ๋“  good ๋ฒ„์ „
657
+ height=240,
658
+ autoplay=False,
659
+ elem_id="ex_wallpushups_real",
660
+ )
661
  with gr.Column():
662
  gr.Markdown("**Poorly generated action**")
663
+ gr.Video(
664
+ value="examples/WallPushups_bad.mp4", # bad ๋ฒ„์ „
665
+ height=240,
666
+ autoplay=False,
667
+ )
668
+
669
 
670
  gr.HTML("""
671
  <script>
examples/BodyWeightSquats_bad.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a7050e269661b7ee1197695d701c8a2452a3597ae611707e40b8443333a1b299
3
+ size 127395
examples/BodyWeightSquats_good.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b3cc00e9cf0791fc5dca7b43d2a8ca2bbd3f06cd17bbd82209651b5ad1ca292e
3
+ size 336596
examples/WallPushups_bad.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a53619fcfddea713cda800631ccaf2c591fb06527bb551bb06837a4b2dbfa9bc
3
+ size 92288
examples/WallPushups_good.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:af696e8c41373b62f3dfa9a9e1590e0aa4219edc0fc4c0ce7c506447a996afc8
3
+ size 54353