Spaces:
Sleeping
Sleeping
Update app.py to use the new interactive demo UI
Browse filesthere are some formatting issue though, will fix tomorrow.
app.py
CHANGED
|
@@ -61,50 +61,53 @@ with gr.Blocks(title="World-in-World: Building a Closed-Loop World Interface to
|
|
| 61 |
|
| 62 |
with gr.Tabs():
|
| 63 |
with gr.TabItem("🧑🏫 Interactive Demo"):
|
| 64 |
-
with
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
-
# Middle Zone: Closed-Loop Environmental Feedback
|
| 96 |
-
with gr.Column(scale=4, min_width=500):
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
|
| 103 |
-
# Right Zone: World Model's Generation
|
| 104 |
-
with gr.Column(scale=3, min_width=400):
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
|
| 109 |
|
| 110 |
with gr.TabItem("📊 Leaderboard"):
|
|
|
|
| 61 |
|
| 62 |
with gr.Tabs():
|
| 63 |
with gr.TabItem("🧑🏫 Interactive Demo"):
|
| 64 |
+
with open("src/display/demo_new.html", "r", encoding="utf-8") as f:
|
| 65 |
+
html_content = f.read()
|
| 66 |
+
gr.HTML(html_content)
|
| 67 |
+
# with gr.Row():
|
| 68 |
+
# # Left Zone: Agent's View
|
| 69 |
+
# with gr.Column(scale=2, min_width=350):
|
| 70 |
+
# gr.HTML("<h2 style='text-align: center;'>Agent's View</h2>")
|
| 71 |
+
# # Mimicking the blue instruction box from the image
|
| 72 |
+
# gr.HTML("""
|
| 73 |
+
# <div style='background-color: #e6f3ff; border: 1px solid #b3d9ff; border-radius: 8px; padding: 15px; font-family: sans-serif;'>
|
| 74 |
+
# <div style='display: flex; align-items: center; margin-bottom: 10px;'>
|
| 75 |
+
# <span style='font-size: 24px; margin-right: 10px;'>🧠</span>
|
| 76 |
+
# <h3 style='margin: 0; color: #333;'>Instruction:</h3>
|
| 77 |
+
# </div>
|
| 78 |
+
# <p style='margin: 0; color: #555;'>Navigate to the Toaster in the room and be as close as possible to it.</p>
|
| 79 |
+
# </div>
|
| 80 |
+
# """)
|
| 81 |
+
# # Mimicking the grey planning box from the image
|
| 82 |
+
# gr.HTML("""
|
| 83 |
+
# <div style='background-color: #f5f5f5; border: 1px solid #e0e0e0; border-radius: 8px; padding: 15px; margin-top: 20px; font-family: sans-serif;'>
|
| 84 |
+
# <div style='display: flex; align-items: center; margin-bottom: 10px;'>
|
| 85 |
+
# <span style='font-size: 24px; margin-right: 10px;'>🦾</span>
|
| 86 |
+
# <h3 style='margin: 0; color: #333;'>Environment Step 4-7:</h3>
|
| 87 |
+
# </div>
|
| 88 |
+
# <h4 style='margin-top: 10px; margin-bottom: 5px; color: #444;'>Planning:</h4>
|
| 89 |
+
# <ol start="4" style='padding-left: 20px; margin: 0; color: #555;'>
|
| 90 |
+
# <li>Move leftward by 0.25.</li>
|
| 91 |
+
# <li>Move leftward by 0.25.</li>
|
| 92 |
+
# <li>Move forward by 0.25.</li>
|
| 93 |
+
# <li>Move forward by 0.25.</li>
|
| 94 |
+
# </ol>
|
| 95 |
+
# </div>
|
| 96 |
+
# """)
|
| 97 |
|
| 98 |
+
# # Middle Zone: Closed-Loop Environmental Feedback
|
| 99 |
+
# with gr.Column(scale=4, min_width=500):
|
| 100 |
+
# gr.HTML("<h2 style='text-align: center; color: #db83b5;'>Closed-Loop Environmental Feedback</h2>")
|
| 101 |
+
# with gr.Row():
|
| 102 |
+
# gr.Video(value=load_file_from_url(f"{BASE_URL}/AR/FTwan21_lora/5ZKStnWn8Zo/E014/A001/world_model_gen/bbox_gen_video_1.mp4"), label="First Person View", interactive=False)
|
| 103 |
+
# gr.Image(value=load_image_from_url(f"{BASE_URL}/scenes_glb/birdEye_5ZKStnWn8Zo.png"), label="Bird's Eye View", type="pil", interactive=False)
|
| 104 |
+
# # gr.Model3D(value=load_file_from_url(f"{BASE_URL}/scenes_glb/5ZKStnWn8Zo.glb"), label="3D Scene", interactive=False)
|
| 105 |
|
| 106 |
+
# # Right Zone: World Model's Generation
|
| 107 |
+
# with gr.Column(scale=3, min_width=400):
|
| 108 |
+
# gr.HTML("<h2 style='text-align: center;'>World Model's Generation</h2>")
|
| 109 |
+
# # Using the new video path provided by the user
|
| 110 |
+
# gr.Video(value=load_file_from_url(f"{BASE_URL}/AR/FTwan21_lora/5ZKStnWn8Zo/E014/A005/world_model_gen/obj_centered_gen_video_1.mp4"), label="Generated View", interactive=False)
|
| 111 |
|
| 112 |
|
| 113 |
with gr.TabItem("📊 Leaderboard"):
|