xiaoyuxi commited on
Commit
7721ce6
·
1 Parent(s): a2d92a0
Files changed (1) hide show
  1. app.py +99 -129
app.py CHANGED
@@ -661,6 +661,13 @@ with gr.Blocks(
661
  padding: 20px;
662
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
663
  }
 
 
 
 
 
 
 
664
  /* 固定3D可视化器尺寸 */
665
  #viz_container {
666
  height: 650px !important;
@@ -707,152 +714,115 @@ with gr.Blocks(
707
  height: 260px !important;
708
  max-height: 260px !important;
709
  }
710
- /* 水平滚动的示例视频样式 */
711
- .example-videos .gr-examples {
712
- overflow: visible !important;
713
- }
714
- .example-videos .gr-examples .gr-table-wrapper {
715
- overflow-x: auto !important;
716
- overflow-y: hidden !important;
717
- scrollbar-width: thin;
718
- scrollbar-color: #667eea #f1f1f1;
719
- }
720
- .example-videos .gr-examples .gr-table-wrapper::-webkit-scrollbar {
721
- height: 8px;
722
- }
723
- .example-videos .gr-examples .gr-table-wrapper::-webkit-scrollbar-track {
724
- background: #f1f1f1;
725
- border-radius: 4px;
726
- }
727
- .example-videos .gr-examples .gr-table-wrapper::-webkit-scrollbar-thumb {
728
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
729
- border-radius: 4px;
730
- }
731
- .example-videos .gr-examples .gr-table-wrapper::-webkit-scrollbar-thumb:hover {
732
- background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
733
- }
734
- .example-videos .gr-examples .gr-table {
735
- display: flex !important;
736
- flex-wrap: nowrap !important;
737
- min-width: max-content !important;
738
- gap: 10px !important;
739
- }
740
- .example-videos .gr-examples .gr-table tbody {
741
- display: flex !important;
742
- flex-direction: row !important;
743
- flex-wrap: nowrap !important;
744
- gap: 10px !important;
745
- }
746
- .example-videos .gr-examples .gr-table tbody tr {
747
- display: flex !important;
748
- flex-direction: column !important;
749
- min-width: 120px !important;
750
- max-width: 120px !important;
751
- margin: 0 !important;
752
- background: white;
753
- border-radius: 8px;
754
- box-shadow: 0 2px 8px rgba(0,0,0,0.1);
755
- transition: all 0.3s ease;
756
- cursor: pointer;
757
- }
758
- .example-videos .gr-examples .gr-table tbody tr:hover {
759
- transform: translateY(-2px);
760
- box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
761
- }
762
- .example-videos .gr-examples .gr-table tbody tr td {
763
- text-align: center !important;
764
- padding: 8px !important;
765
  border: none !important;
766
  }
767
- .example-videos .gr-examples .gr-table tbody tr td video {
768
- border-radius: 6px !important;
769
- width: 100% !important;
770
- height: auto !important;
771
- }
772
- .example-videos .gr-examples .gr-table tbody tr td:last-child {
773
- font-size: 12px !important;
774
- font-weight: 500 !important;
775
- color: #333 !important;
776
- padding-top: 4px !important;
777
- }
778
 
779
- /* 新的水平滚动示例视频样式 */
780
- .horizontal-examples .gr-examples {
781
- overflow: visible !important;
 
782
  }
783
- .horizontal-examples .gr-examples .gr-table-wrapper {
 
 
 
784
  overflow-x: auto !important;
785
  overflow-y: hidden !important;
786
  scrollbar-width: thin;
787
- scrollbar-color: #667eea #f1f1f1;
788
- padding: 10px 0;
789
- }
790
- .horizontal-examples .gr-examples .gr-table-wrapper::-webkit-scrollbar {
791
- height: 8px;
792
- }
793
- .horizontal-examples .gr-examples .gr-table-wrapper::-webkit-scrollbar-track {
794
- background: #f1f1f1;
795
- border-radius: 4px;
796
- }
797
- .horizontal-examples .gr-examples .gr-table-wrapper::-webkit-scrollbar-thumb {
798
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
799
- border-radius: 4px;
800
- }
801
- .horizontal-examples .gr-examples .gr-table-wrapper::-webkit-scrollbar-thumb:hover {
802
- background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
803
  }
804
- .horizontal-examples .gr-examples .gr-table {
 
805
  display: flex !important;
806
  flex-wrap: nowrap !important;
807
  min-width: max-content !important;
808
  gap: 15px !important;
809
- padding-bottom: 10px;
 
 
810
  }
811
- .horizontal-examples .gr-examples .gr-table tbody {
 
812
  display: flex !important;
813
  flex-direction: row !important;
814
  flex-wrap: nowrap !important;
815
  gap: 15px !important;
 
816
  }
817
- .horizontal-examples .gr-examples .gr-table tbody tr {
 
818
  display: flex !important;
819
  flex-direction: column !important;
820
  min-width: 160px !important;
821
  max-width: 160px !important;
822
  margin: 0 !important;
823
- background: white;
824
  border-radius: 12px;
825
  box-shadow: 0 3px 12px rgba(0,0,0,0.12);
826
  transition: all 0.3s ease;
827
  cursor: pointer;
828
  overflow: hidden;
 
829
  }
830
- .horizontal-examples .gr-examples .gr-table tbody tr:hover {
 
831
  transform: translateY(-4px);
832
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.25);
833
  }
834
- .horizontal-examples .gr-examples .gr-table tbody tr td {
 
835
  text-align: center !important;
836
  padding: 0 !important;
837
  border: none !important;
 
838
  }
839
- .horizontal-examples .gr-examples .gr-table tbody tr td:first-child {
 
840
  padding: 0 !important;
 
841
  }
842
- .horizontal-examples .gr-examples .gr-table tbody tr td video {
 
843
  border-radius: 8px 8px 0 0 !important;
844
  width: 100% !important;
845
  height: 90px !important;
846
  object-fit: cover !important;
 
847
  }
848
- .horizontal-examples .gr-examples .gr-table tbody tr td:last-child {
 
849
  font-size: 11px !important;
850
  font-weight: 600 !important;
851
  color: #333 !important;
852
  padding: 8px 12px !important;
853
- background: linear-gradient(135deg, #f8f9ff 0%, #e6f3ff 100%);
854
  border-radius: 0 0 8px 8px;
855
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
856
  """
857
  ) as demo:
858
 
@@ -891,39 +861,39 @@ with gr.Blocks(
891
  )
892
 
893
  # Horizontal video examples with slider
894
- gr.HTML("<div style='margin-top: 20px;'></div>")
895
- gr.Markdown("**Examples:** (scroll horizontally to see all videos)")
896
 
897
- # Traditional examples but with horizontal scroll styling
898
- with gr.Row(elem_classes=["horizontal-examples"]):
899
- gr.Examples(
900
- examples=[
901
- ["./examples/kiss.mp4"],
902
- ["./examples/backpack.mp4"],
903
- ["./examples/kitchen.mp4"],
904
- ["./examples/pillow.mp4"],
905
- ["./examples/handwave.mp4"],
906
- ["./examples/hockey.mp4"],
907
- ["./examples/drifting.mp4"],
908
- ["./examples/basketball.mp4"],
909
- ["./examples/ken_block_0.mp4"],
910
- ["./examples/ego_kc1.mp4"],
911
- ["./examples/vertical_place.mp4"],
912
- ["./examples/ego_teaser.mp4"],
913
- ["./examples/robot_unitree.mp4"],
914
- ["./examples/robot_3.mp4"],
915
- ["./examples/teleop2.mp4"],
916
- ["./examples/pusht.mp4"],
917
- ["./examples/cinema_0.mp4"],
918
- ["./examples/cinema_1.mp4"],
919
- ],
920
- inputs=[video_input],
921
- outputs=[video_input],
922
- fn=None,
923
- cache_examples=False,
924
- label="",
925
- examples_per_page=6 # Show 6 examples per page so they can wrap to multiple rows
926
- )
 
927
 
928
  with gr.Column(scale=2):
929
  # 3D Visualization - wider and taller to match left side
 
661
  padding: 20px;
662
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
663
  }
664
+ /* 移除 gr.Group 的默认灰色背景 */
665
+ .gr-form {
666
+ background: transparent !important;
667
+ border: none !important;
668
+ box-shadow: none !important;
669
+ padding: 0 !important;
670
+ }
671
  /* 固定3D可视化器尺寸 */
672
  #viz_container {
673
  height: 650px !important;
 
714
  height: 260px !important;
715
  max-height: 260px !important;
716
  }
717
+ /* 强力移除examples的灰色背景 - 使用更通用的选择器 */
718
+ .horizontal-examples,
719
+ .horizontal-examples > *,
720
+ .horizontal-examples * {
721
+ background: transparent !important;
722
+ background-color: transparent !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
723
  border: none !important;
724
  }
 
 
 
 
 
 
 
 
 
 
 
725
 
726
+ /* Examples组件水平滚动样式 */
727
+ .horizontal-examples [data-testid="examples"] {
728
+ background: transparent !important;
729
+ background-color: transparent !important;
730
  }
731
+
732
+ .horizontal-examples [data-testid="examples"] > div {
733
+ background: transparent !important;
734
+ background-color: transparent !important;
735
  overflow-x: auto !important;
736
  overflow-y: hidden !important;
737
  scrollbar-width: thin;
738
+ scrollbar-color: #667eea transparent;
739
+ padding: 0 !important;
740
+ margin-top: 10px;
741
+ border: none !important;
 
 
 
 
 
 
 
 
 
 
 
 
742
  }
743
+
744
+ .horizontal-examples [data-testid="examples"] table {
745
  display: flex !important;
746
  flex-wrap: nowrap !important;
747
  min-width: max-content !important;
748
  gap: 15px !important;
749
+ padding: 10px 0;
750
+ background: transparent !important;
751
+ border: none !important;
752
  }
753
+
754
+ .horizontal-examples [data-testid="examples"] tbody {
755
  display: flex !important;
756
  flex-direction: row !important;
757
  flex-wrap: nowrap !important;
758
  gap: 15px !important;
759
+ background: transparent !important;
760
  }
761
+
762
+ .horizontal-examples [data-testid="examples"] tr {
763
  display: flex !important;
764
  flex-direction: column !important;
765
  min-width: 160px !important;
766
  max-width: 160px !important;
767
  margin: 0 !important;
768
+ background: white !important;
769
  border-radius: 12px;
770
  box-shadow: 0 3px 12px rgba(0,0,0,0.12);
771
  transition: all 0.3s ease;
772
  cursor: pointer;
773
  overflow: hidden;
774
+ border: none !important;
775
  }
776
+
777
+ .horizontal-examples [data-testid="examples"] tr:hover {
778
  transform: translateY(-4px);
779
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.25);
780
  }
781
+
782
+ .horizontal-examples [data-testid="examples"] td {
783
  text-align: center !important;
784
  padding: 0 !important;
785
  border: none !important;
786
+ background: transparent !important;
787
  }
788
+
789
+ .horizontal-examples [data-testid="examples"] td:first-child {
790
  padding: 0 !important;
791
+ background: transparent !important;
792
  }
793
+
794
+ .horizontal-examples [data-testid="examples"] video {
795
  border-radius: 8px 8px 0 0 !important;
796
  width: 100% !important;
797
  height: 90px !important;
798
  object-fit: cover !important;
799
+ background: #f8f9fa !important;
800
  }
801
+
802
+ .horizontal-examples [data-testid="examples"] td:last-child {
803
  font-size: 11px !important;
804
  font-weight: 600 !important;
805
  color: #333 !important;
806
  padding: 8px 12px !important;
807
+ background: linear-gradient(135deg, #f8f9ff 0%, #e6f3ff 100%) !important;
808
  border-radius: 0 0 8px 8px;
809
  }
810
+
811
+ /* 滚动条样式 */
812
+ .horizontal-examples [data-testid="examples"] > div::-webkit-scrollbar {
813
+ height: 8px;
814
+ }
815
+ .horizontal-examples [data-testid="examples"] > div::-webkit-scrollbar-track {
816
+ background: transparent;
817
+ border-radius: 4px;
818
+ }
819
+ .horizontal-examples [data-testid="examples"] > div::-webkit-scrollbar-thumb {
820
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
821
+ border-radius: 4px;
822
+ }
823
+ .horizontal-examples [data-testid="examples"] > div::-webkit-scrollbar-thumb:hover {
824
+ background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
825
+ }
826
  """
827
  ) as demo:
828
 
 
861
  )
862
 
863
  # Horizontal video examples with slider
864
+ gr.HTML("<div style='margin-top: 5px;'></div>")
 
865
 
866
+ gr.Markdown("**Examples:** (scroll horizontally to see all videos)")
867
+ # Traditional examples but with horizontal scroll styling
868
+ with gr.Row(elem_classes=["horizontal-examples"]):
869
+ gr.Examples(
870
+ examples=[
871
+ ["./examples/kiss.mp4"],
872
+ ["./examples/backpack.mp4"],
873
+ ["./examples/kitchen.mp4"],
874
+ ["./examples/pillow.mp4"],
875
+ ["./examples/handwave.mp4"],
876
+ ["./examples/hockey.mp4"],
877
+ ["./examples/drifting.mp4"],
878
+ ["./examples/basketball.mp4"],
879
+ ["./examples/ken_block_0.mp4"],
880
+ ["./examples/ego_kc1.mp4"],
881
+ ["./examples/vertical_place.mp4"],
882
+ ["./examples/ego_teaser.mp4"],
883
+ ["./examples/robot_unitree.mp4"],
884
+ ["./examples/robot_3.mp4"],
885
+ ["./examples/teleop2.mp4"],
886
+ ["./examples/pusht.mp4"],
887
+ ["./examples/cinema_0.mp4"],
888
+ ["./examples/cinema_1.mp4"],
889
+ ],
890
+ inputs=[video_input],
891
+ outputs=[video_input],
892
+ fn=None,
893
+ cache_examples=False,
894
+ label="",
895
+ examples_per_page=6 # Show 6 examples per page so they can wrap to multiple rows
896
+ )
897
 
898
  with gr.Column(scale=2):
899
  # 3D Visualization - wider and taller to match left side