TaiMingLu commited on
Commit
a652572
Β·
1 Parent(s): b471609

Update code

Browse files
Files changed (1) hide show
  1. app.py +45 -22
app.py CHANGED
@@ -35,30 +35,53 @@ with gr.Blocks(title="World-in-World: Building a Closed-Loop World Interface to
35
  gr.HTML("<h1 style='text-align: center; margin-bottom: 1rem'>πŸ† World-in-World: Building a Closed-Loop World Interface to Evaluate World Models</h1>")
36
 
37
  with gr.Tabs():
38
- # New Zone before Leaderboard
39
- with gr.TabItem("πŸ§‘β€πŸ« Instruction & Environmental Feedback"):
40
  with gr.Row():
41
- with gr.Column(scale=1, min_width=300): # Ensuring proper alignment
42
- gr.HTML("<h3 style='text-align: center;'>Instruction:</h3>")
43
- gr.Markdown("Navigate to the Toaster in the room and be as close as possible to it.")
44
- gr.Markdown("""
45
- **Environment Step 4-7:**
46
-
47
- **Planning:**
48
- 1. Move leftward by 0.25.
49
- 2. Move leftward by 0.25.
50
- 3. Move forward by 0.25.
51
- 4. Move forward by 0.25.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  """)
53
 
54
- with gr.Column(scale=2, min_width=600):
55
- gr.HTML("<h3 style='text-align: center;'>Closed-Loop Environmental Feedback</h3>")
56
- # Adjust image/video sizes for better layout
57
- gr.Video("/home/user/app/demo_source_data/AR/FTwan21_lora/X7HyMhZNoso/E145/A001/world_model_gen/bbox_gen_video_1.mp4", label="Left Image", width=480)
58
- gr.Image("/home/user/app/demo_source_data/AR/FTwan21_lora/X7HyMhZNoso/E145/A001/real_obs.png", label="Bird Eye View", type="pil", width=480)
59
- gr.HTML("<h4 style='text-align: center;'>3D Scene:</h4>")
60
- with gr.Column(scale=1):
61
- gr.Model3D("/home/user/app/demo_source_data/scenes_glb/5ZKStnWn8Zo.glb", label="3D Scene")
 
 
 
 
 
 
 
 
62
 
63
  with gr.TabItem("πŸ“Š Leaderboard"):
64
  leaderboard_table = gr.DataFrame(
@@ -94,4 +117,4 @@ with gr.Blocks(title="World-in-World: Building a Closed-Loop World Interface to
94
  """)
95
 
96
  if __name__ == "__main__":
97
- demo.launch()
 
35
  gr.HTML("<h1 style='text-align: center; margin-bottom: 1rem'>πŸ† World-in-World: Building a Closed-Loop World Interface to Evaluate World Models</h1>")
36
 
37
  with gr.Tabs():
38
+ with gr.TabItem("πŸ§‘β€πŸ« Interactive Demo"):
 
39
  with gr.Row():
40
+ # Left Zone: Instructions
41
+ with gr.Column(scale=2, min_width=350):
42
+ # Mimicking the blue instruction box from the image
43
+ gr.HTML("""
44
+ <div style='background-color: #e6f3ff; border: 1px solid #b3d9ff; border-radius: 8px; padding: 15px; font-family: sans-serif;'>
45
+ <div style='display: flex; align-items: center; margin-bottom: 10px;'>
46
+ <span style='font-size: 24px; margin-right: 10px;'>🧠</span>
47
+ <h3 style='margin: 0; color: #333;'>Instruction:</h3>
48
+ </div>
49
+ <p style='margin: 0; color: #555;'>Navigate to the Toaster in the room and be as close as possible to it.</p>
50
+ </div>
51
+ """)
52
+ # Mimicking the grey planning box from the image
53
+ gr.HTML("""
54
+ <div style='background-color: #f5f5f5; border: 1px solid #e0e0e0; border-radius: 8px; padding: 15px; margin-top: 20px; font-family: sans-serif;'>
55
+ <div style='display: flex; align-items: center; margin-bottom: 10px;'>
56
+ <span style='font-size: 24px; margin-right: 10px;'>🦾</span>
57
+ <h3 style='margin: 0; color: #333;'>Environment Step 4-7:</h3>
58
+ </div>
59
+ <h4 style='margin-top: 10px; margin-bottom: 5px; color: #444;'>Planning:</h4>
60
+ <ol start="4" style='padding-left: 20px; margin: 0; color: #555;'>
61
+ <li>Move leftward by 0.25.</li>
62
+ <li>Move leftward by 0.25.</li>
63
+ <li>Move forward by 0.25.</li>
64
+ <li>Move forward by 0.25.</li>
65
+ </ol>
66
+ </div>
67
  """)
68
 
69
+ # Middle Zone: Closed-Loop Environmental Feedback
70
+ with gr.Column(scale=4, min_width=400):
71
+ gr.HTML("<h2 style='text-align: center; color: #db83b5;'>Closed-Loop Environmental Feedback</h2>")
72
+ with gr.Row():
73
+ # The single video on the left of this zone
74
+ gr.Video("/home/user/app/demo_source_data/AR/FTwan21_lora/X7HyMhZNoso/E145/A001/world_model_gen/bbox_gen_video_1.mp4", label="First Person View", interactive=False)
75
+ # The column with the other two views on the right
76
+ with gr.Column():
77
+ gr.Image("/home/user/app/demo_source_data/AR/FTwan21_lora/5ZKStnWn8Zo/E014/A000/real_obs_bbox.png", label="Bird's Eye View", type="pil", interactive=False)
78
+ gr.Model3D("/home/user/app/demo_source_data/scenes_glb/5ZKStnWn8Zo.glb", label="3D Scene", interactive=False)
79
+
80
+ # Right Zone: World Model's Generation
81
+ with gr.Column(scale=3, min_width=300):
82
+ gr.HTML("<h2 style='text-align: center;'>World Model's Generation</h2>")
83
+ gr.Video("/home/user/app/demo_source_data/AR/FTwan21_lora/X7HyMhZNoso/E145/A001/world_model_gen/gen_video_1.mp4", label="Generated View", interactive=False)
84
+
85
 
86
  with gr.TabItem("πŸ“Š Leaderboard"):
87
  leaderboard_table = gr.DataFrame(
 
117
  """)
118
 
119
  if __name__ == "__main__":
120
+ demo.launch()