Spaces:
Sleeping
Sleeping
Debug url access for files
Browse files
app.py
CHANGED
|
@@ -1,8 +1,30 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import pandas as pd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
BASE_URL = "https://huggingface.co/datasets/zonszer/demo_source_data/resolve/main"
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
# Static data - reordered columns: Method, #Param., Input Type, Control Type, Model Type, Mean Traj. ↓, Acc. ↑
|
| 7 |
STATIC_DATA = [
|
| 8 |
["w/o WM", "72B", "RGB", "–", "VLM", 6.24, 50.27],
|
|
@@ -73,15 +95,15 @@ with gr.Blocks(title="World-in-World: Building a Closed-Loop World Interface to
|
|
| 73 |
with gr.Column(scale=4, min_width=500):
|
| 74 |
gr.HTML("<h2 style='text-align: center; color: #db83b5;'>Closed-Loop Environmental Feedback</h2>")
|
| 75 |
with gr.Row():
|
| 76 |
-
gr.Video(f"{BASE_URL}/AR/FTwan21_lora/X7HyMhZNoso/E145/A001/world_model_gen/bbox_gen_video_1.mp4", label="First Person View", interactive=False)
|
| 77 |
-
gr.Image(f"{BASE_URL}/AR/FTwan21_lora/5ZKStnWn8Zo/E014/A000/real_obs_bbox.png", label="Bird's Eye View", type="pil", interactive=False)
|
| 78 |
-
gr.Model3D(f"{BASE_URL}/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=400):
|
| 82 |
gr.HTML("<h2 style='text-align: center;'>World Model's Generation</h2>")
|
| 83 |
# Using the new video path provided by the user
|
| 84 |
-
gr.Video(f"{BASE_URL}/AR/FTwan21_lora/5ZKStnWn8Zo/E014/A005/world_model_gen/obj_centered_gen_video_1.mp4", label="Generated View", interactive=False)
|
| 85 |
|
| 86 |
|
| 87 |
with gr.TabItem("📊 Leaderboard"):
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import pandas as pd
|
| 3 |
+
import requests
|
| 4 |
+
from PIL import Image
|
| 5 |
+
from io import BytesIO
|
| 6 |
+
import os
|
| 7 |
+
import tempfile
|
| 8 |
|
| 9 |
BASE_URL = "https://huggingface.co/datasets/zonszer/demo_source_data/resolve/main"
|
| 10 |
|
| 11 |
+
def load_image_from_url(url):
|
| 12 |
+
try:
|
| 13 |
+
response = requests.get(url)
|
| 14 |
+
return Image.open(BytesIO(response.content))
|
| 15 |
+
except:
|
| 16 |
+
return None
|
| 17 |
+
|
| 18 |
+
def load_file_from_url(url):
|
| 19 |
+
try:
|
| 20 |
+
response = requests.get(url)
|
| 21 |
+
file_ext = os.path.splitext(url)[1]
|
| 22 |
+
with tempfile.NamedTemporaryFile(delete=False, suffix=file_ext) as tmp_file:
|
| 23 |
+
tmp_file.write(response.content)
|
| 24 |
+
return tmp_file.name
|
| 25 |
+
except:
|
| 26 |
+
return None
|
| 27 |
+
|
| 28 |
# Static data - reordered columns: Method, #Param., Input Type, Control Type, Model Type, Mean Traj. ↓, Acc. ↑
|
| 29 |
STATIC_DATA = [
|
| 30 |
["w/o WM", "72B", "RGB", "–", "VLM", 6.24, 50.27],
|
|
|
|
| 95 |
with gr.Column(scale=4, min_width=500):
|
| 96 |
gr.HTML("<h2 style='text-align: center; color: #db83b5;'>Closed-Loop Environmental Feedback</h2>")
|
| 97 |
with gr.Row():
|
| 98 |
+
gr.Video(value=load_file_from_url(f"{BASE_URL}/AR/FTwan21_lora/X7HyMhZNoso/E145/A001/world_model_gen/bbox_gen_video_1.mp4"), label="First Person View", interactive=False)
|
| 99 |
+
gr.Image(value=load_image_from_url(f"{BASE_URL}/AR/FTwan21_lora/5ZKStnWn8Zo/E014/A000/real_obs_bbox.png"), label="Bird's Eye View", type="pil", interactive=False)
|
| 100 |
+
gr.Model3D(value=load_file_from_url(f"{BASE_URL}/scenes_glb/5ZKStnWn8Zo.glb"), label="3D Scene", interactive=False)
|
| 101 |
|
| 102 |
# Right Zone: World Model's Generation
|
| 103 |
with gr.Column(scale=3, min_width=400):
|
| 104 |
gr.HTML("<h2 style='text-align: center;'>World Model's Generation</h2>")
|
| 105 |
# Using the new video path provided by the user
|
| 106 |
+
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)
|
| 107 |
|
| 108 |
|
| 109 |
with gr.TabItem("📊 Leaderboard"):
|