xinjie.wang commited on
Commit
0f1a4e9
·
1 Parent(s): 0c39c56
Files changed (2) hide show
  1. app.py +9 -11
  2. app_style.py +17 -1
app.py CHANGED
@@ -14,6 +14,7 @@
14
  # implied. See the License for the specific language governing
15
  # permissions and limitations under the License.
16
 
 
17
  import os
18
 
19
  gradio_tmp_dir = os.path.join(
@@ -26,12 +27,11 @@ import shutil
26
  import uuid
27
  import xml.etree.ElementTree as ET
28
  from pathlib import Path
29
- from typing import Any, Dict, Tuple
30
 
31
  import gradio as gr
32
  import pandas as pd
33
- import yaml
34
  from app_style import custom_theme, lighting_css
 
35
 
36
  try:
37
  from embodied_gen.utils.gpt_clients import GPT_CLIENT as gpt_client
@@ -47,14 +47,8 @@ except Exception as e:
47
 
48
 
49
  # --- Configuration & Data Loading ---
50
- VERSION = "v0.1.5"
51
  RUNNING_MODE = "hf_remote" # local or hf_remote
52
  CSV_FILE = "dataset_index.csv"
53
- import spaces
54
- @spaces.GPU
55
- def fake_gpu_init():
56
- pass
57
- fake_gpu_init()
58
 
59
  if RUNNING_MODE == "local":
60
  DATA_ROOT = "/horizon-bucket/robot_lab/datasets/embodiedgen/assets"
@@ -260,8 +254,7 @@ def search_assets(query: str, top_k: int):
260
  return items, gr.update(interactive=True), top_assets
261
 
262
 
263
- # --- Mesh extraction ---
264
- def _extract_mesh_paths(row) -> Tuple[str | None, str | None, str]:
265
  desc = row["description"]
266
  urdf_path = os.path.join(DATA_ROOT, row["urdf_path"])
267
  asset_dir = os.path.join(DATA_ROOT, row["asset_dir"])
@@ -731,4 +724,9 @@ with gr.Blocks(
731
 
732
 
733
  if __name__ == "__main__":
734
- demo.launch()
 
 
 
 
 
 
14
  # implied. See the License for the specific language governing
15
  # permissions and limitations under the License.
16
 
17
+
18
  import os
19
 
20
  gradio_tmp_dir = os.path.join(
 
27
  import uuid
28
  import xml.etree.ElementTree as ET
29
  from pathlib import Path
 
30
 
31
  import gradio as gr
32
  import pandas as pd
 
33
  from app_style import custom_theme, lighting_css
34
+ from embodied_gen.utils.tags import VERSION
35
 
36
  try:
37
  from embodied_gen.utils.gpt_clients import GPT_CLIENT as gpt_client
 
47
 
48
 
49
  # --- Configuration & Data Loading ---
 
50
  RUNNING_MODE = "hf_remote" # local or hf_remote
51
  CSV_FILE = "dataset_index.csv"
 
 
 
 
 
52
 
53
  if RUNNING_MODE == "local":
54
  DATA_ROOT = "/horizon-bucket/robot_lab/datasets/embodiedgen/assets"
 
254
  return items, gr.update(interactive=True), top_assets
255
 
256
 
257
+ def _extract_mesh_paths(row) -> tuple[str | None, str | None, str]:
 
258
  desc = row["description"]
259
  urdf_path = os.path.join(DATA_ROOT, row["urdf_path"])
260
  asset_dir = os.path.join(DATA_ROOT, row["asset_dir"])
 
724
 
725
 
726
  if __name__ == "__main__":
727
+ demo.launch(
728
+ # server_port=8088,
729
+ # allowed_paths=[
730
+ "/horizon-bucket/robot_lab/datasets/embodiedgen/assets"
731
+ ],
732
+ )
app_style.py CHANGED
@@ -1,10 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  from gradio.themes import Soft
2
  from gradio.themes.utils.colors import gray, neutral, slate, stone, teal, zinc
3
 
4
  lighting_css = """
5
  <style>
6
  #lighter_mesh canvas {
7
- filter: brightness(1.9) !important;
8
  }
9
  </style>
10
  """
 
1
+ # Project EmbodiedGen
2
+ #
3
+ # Copyright (c) 2025 Horizon Robotics. All Rights Reserved.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14
+ # implied. See the License for the specific language governing
15
+ # permissions and limitations under the License.
16
+
17
  from gradio.themes import Soft
18
  from gradio.themes.utils.colors import gray, neutral, slate, stone, teal, zinc
19
 
20
  lighting_css = """
21
  <style>
22
  #lighter_mesh canvas {
23
+ filter: brightness(2.3) !important;
24
  }
25
  </style>
26
  """