ManiacWallnut commited on
Commit
9ee6f68
·
verified ·
1 Parent(s): bd12d90

Deploy ManiTaskGen VLM-free Gradio demo

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. README.md +162 -10
  2. config/default_config.yml +224 -0
  3. data/templates/benchmark_prompts.json +215 -0
  4. data/templates/manitask_ot200.txt +200 -0
  5. data/templates/reflection_prompts.json +173 -0
  6. data/templates/renaming_engine.json +19 -0
  7. data/templates/voting_prompts.json +92 -0
  8. demo/app.py +292 -0
  9. demo/assets/example_scene.zip +3 -0
  10. demo/assets/example_scene/README.md +40 -0
  11. demo/assets/example_scene/configs/objects/book_blue.object_config.json +10 -0
  12. demo/assets/example_scene/configs/objects/book_green.object_config.json +10 -0
  13. demo/assets/example_scene/configs/objects/book_red.object_config.json +10 -0
  14. demo/assets/example_scene/configs/objects/bowl.object_config.json +10 -0
  15. demo/assets/example_scene/configs/objects/cereal_box.object_config.json +10 -0
  16. demo/assets/example_scene/configs/objects/counter.object_config.json +10 -0
  17. demo/assets/example_scene/configs/objects/desk.object_config.json +10 -0
  18. demo/assets/example_scene/configs/objects/laptop.object_config.json +10 -0
  19. demo/assets/example_scene/configs/objects/mug.object_config.json +10 -0
  20. demo/assets/example_scene/configs/objects/plant_pot.object_config.json +10 -0
  21. demo/assets/example_scene/configs/objects/remote.object_config.json +10 -0
  22. demo/assets/example_scene/configs/objects/shelf.object_config.json +10 -0
  23. demo/assets/example_scene/configs/objects/table.object_config.json +10 -0
  24. demo/assets/example_scene/configs/objects/toaster.object_config.json +10 -0
  25. demo/assets/example_scene/configs/scenes/demo_studio.scene_instance.json +262 -0
  26. demo/assets/example_scene/objects/book_blue.glb +0 -0
  27. demo/assets/example_scene/objects/book_green.glb +0 -0
  28. demo/assets/example_scene/objects/book_red.glb +0 -0
  29. demo/assets/example_scene/objects/bowl.glb +0 -0
  30. demo/assets/example_scene/objects/cereal_box.glb +0 -0
  31. demo/assets/example_scene/objects/counter.glb +0 -0
  32. demo/assets/example_scene/objects/desk.glb +0 -0
  33. demo/assets/example_scene/objects/laptop.glb +0 -0
  34. demo/assets/example_scene/objects/mug.glb +0 -0
  35. demo/assets/example_scene/objects/plant_pot.glb +0 -0
  36. demo/assets/example_scene/objects/remote.glb +0 -0
  37. demo/assets/example_scene/objects/shelf.glb +0 -0
  38. demo/assets/example_scene/objects/table.glb +0 -0
  39. demo/assets/example_scene/objects/toaster.glb +0 -0
  40. demo/assets/example_scene/stages/demo_room.glb +0 -0
  41. demo/build_example_scene.py +342 -0
  42. demo/pipeline.py +346 -0
  43. demo/requirements.txt +29 -0
  44. demo/scene_pack.py +210 -0
  45. docs/AI2THOR_DATASET.md +55 -0
  46. docs/API_REFERENCE.md +43 -0
  47. docs/Config Short Explanations.md +565 -0
  48. docs/FULL_CONFIG_REFERENCE.md +1 -0
  49. docs/HABITAT_DATASETS.md +63 -0
  50. docs/INSTALLATION.md +87 -0
README.md CHANGED
@@ -1,15 +1,167 @@
1
  ---
2
- title: ManiTaskGen
3
- emoji: 👁
4
- colorFrom: green
5
- colorTo: gray
6
  sdk: gradio
7
- sdk_version: 6.32.0
8
- python_version: '3.13'
9
- app_file: app.py
10
  pinned: false
11
- license: apache-2.0
12
- short_description: "\tGenerate manipulation tasks from an example scene or your o"
13
  ---
14
 
15
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: ManiTaskGen Demo
3
+ emoji: 🎯
4
+ colorFrom: blue
5
+ colorTo: purple
6
  sdk: gradio
7
+ sdk_version: 4.44.1
8
+ app_file: demo/app.py
9
+ python_version: "3.10"
10
  pinned: false
 
 
11
  ---
12
 
13
+ # ManiTaskGen: A Comprehensive Task Generator for Embodied AI
14
+
15
+ [![arXiv](https://img.shields.io/badge/arXiv-2505.20726-df2a2a.svg)](https://arxiv.org/abs/2505.20726)
16
+ [![Website](https://img.shields.io/badge/Project%20Page-Visit-brightgreen)](https://manitaskgen.github.io/)
17
+
18
+ ManiTaskGen automatically generates a comprehensive set of mobile-manipulation
19
+ tasks for **any given scene**:
20
+
21
+ - **Process-based tasks** — step-by-step move instructions
22
+ (e.g. *"Move the remote to the desk's front-left freespace"*), complete with
23
+ PDDL-style goal expressions.
24
+ - **Outcome-based task candidates** — goal-state instructions instantiated from
25
+ the ManiTaskOT-200 template set (e.g. *"Organize all books on the shelf by
26
+ height and type"*).
27
+
28
+ ## 🖱️ Click-and-use web demo (no API key, no VLM, CPU-only)
29
+
30
+ This repository ships a [Gradio](https://gradio.app) demo at **`demo/app.py`**:
31
+
32
+ 1. **Try the built-in example** — a tiny synthetic "demo studio" scene
33
+ (desk, low table, 3-layer shelf, counter + 12 small objects). One click
34
+ generates both task types in a few seconds.
35
+ 2. **Upload your own `scene.zip`** — a Habitat/ReplicaCAD-style scene pack
36
+ (see format below). The scene is parsed in an isolated temp directory and
37
+ the original ManiTaskGen generators run on it directly.
38
+
39
+ Both paths return two lists of tasks plus a downloadable **`tasks.jsonl`**.
40
+ Everything runs offline: **no VLM is called** — object renaming and feasibility
41
+ voting are skipped, and outcome candidates are exported with
42
+ `voting_status: "not_run"`.
43
+
44
+ ### Run it locally
45
+
46
+ ```bash
47
+ conda create -n manitaskgen-demo python=3.10 -y
48
+ conda activate manitaskgen-demo
49
+ pip install -r demo/requirements.txt
50
+ python demo/app.py # open http://127.0.0.1:7860
51
+ ```
52
+
53
+ Or deploy the repository as a Hugging Face Space: create a new *Gradio* Space,
54
+ upload/push this repository, and it builds straight from the `README.md`
55
+ front-matter above (`app_file: demo/app.py`). The demo runs on the **free CPU
56
+ Basic** hardware — no GPU grant is needed.
57
+
58
+ ### Scene pack format (`scene.zip`)
59
+
60
+ The archive mirrors the on-disk layout of a Habitat / ReplicaCAD dataset root —
61
+ exactly what the repository's scene parser consumes:
62
+
63
+ ```
64
+ scene.zip
65
+ ├── configs/
66
+ │ ├── scenes/<any-name>.scene_instance.json ← entry file (Habitat scene instance)
67
+ │ └── objects/<template>.object_config.json ← per-template asset config
68
+ ├── objects/
69
+ │ ├── <template>.glb ← object meshes (Y-up, like ReplicaCAD)
70
+ │ └── convex/<template>_cv_decomp.glb ← optional collision meshes
71
+ ├── stages/<stage>.glb ← background/stage mesh
72
+ └── urdf/<name>/<name>.urdf ← optional (articulated objects)
73
+ ```
74
+
75
+ - **Entry file**: a `*.scene_instance.json` (searched under
76
+ `configs/scenes/` first, then anywhere in the archive). It lists
77
+ `stage_instance`, `object_instances` (template name, `motion_type`,
78
+ `translation`, `rotation` — Habitat convention, quaternion `[w, x, y, z]`)
79
+ and optional `articulated_object_instances`.
80
+ - **Coordinates**: translations follow the Habitat convention (Y-up). Meshes
81
+ are stored Y-up (ReplicaCAD convention); the pipeline converts both to its
82
+ internal Z-up representation.
83
+ - **Naming matters**: outcome-task categories are derived from the object name
84
+ before the first `_` (`book_red_0` → *book*), and everything before the
85
+ trailing `_index` is the minor category (`book_red`). `door`/`drawer` in a
86
+ template name are skipped by the scene-graph builder.
87
+
88
+ ### Modify the built-in example and re-upload
89
+
90
+ ```bash
91
+ # download example_scene.zip from the demo page, then:
92
+ unzip example_scene.zip -d my_scene && cd my_scene
93
+ # 1. edit configs/scenes/demo_studio.scene_instance.json
94
+ # - move an object: change its "translation"
95
+ # - remove one: delete its entry (and optionally its glb/config files)
96
+ # 2. re-zip (keeping the layout) and upload to the demo
97
+ zip -r ../my_scene.zip .
98
+ ```
99
+
100
+ Results always reflect the uploaded scene — tasks referencing removed objects
101
+ disappear, because uploaded packs are never cached. Missing assets are
102
+ reported with the exact file paths.
103
+
104
+ ## 📄 Paper pipeline (experiments, VLM voting, benchmarking)
105
+
106
+ The original workflow is unchanged:
107
+
108
+ ```bash
109
+ # environment (paper experiments)
110
+ conda create -n manitaskgen python=3.10 -y && conda activate manitaskgen
111
+ bash install.sh # installs config/requirements_minimal.txt + VLMEvalKit
112
+
113
+ # stage 1: parse scene + build scene graph
114
+ bash scripts/run_01_preprocessings.sh
115
+ # stage 2a: process-based tasks
116
+ bash scripts/run_02a_gen_process_tasks.sh
117
+ # stage 2b: outcome-based tasks (VLM voting; add --skip_vlm_vote to skip)
118
+ bash scripts/run_02b_gen_outcome_tasks.sh
119
+ # stage 3: benchmark
120
+ bash scripts/run_03_run_benchmark.sh
121
+ ```
122
+
123
+ `src/scripts/02b_gen_outcome_based_tasks.py` additionally accepts
124
+ `--skip_vlm_vote`, which skips VLM voting and the voting-only SAPIEN render
125
+ scene (CPU-only machines) and writes every successfully-bound candidate with
126
+ `voting_status: not_run`. See `docs/` for architecture details.
127
+
128
+ ## Repository layout
129
+
130
+ ```
131
+ .
132
+ ├── demo/ # Gradio demo (click-and-use web app)
133
+ │ ├── app.py # UI entry (HF Spaces: app_file)
134
+ │ ├── pipeline.py # parse → scene graph → tasks → tasks.jsonl
135
+ │ ├── scene_pack.py # safe zip handling + asset verification
136
+ │ ├── build_example_scene.py # regenerates demo/assets/example_scene(.zip)
137
+ │ └── assets/example_scene.zip
138
+ ├── config/ # runtime configuration
139
+ ├── data/templates/ # ManiTaskOT-200 templates + prompt files
140
+ ├── src/
141
+ │ ├── core/ # scene graph, process/outcome task generation
142
+ │ ├── preprocessing/ # scene parsers (ReplicaCAD, SUN-RGBD)
143
+ │ ├── scripts/ # 01/02a/02b/03 pipeline entry scripts
144
+ │ └── vlm_interaction/ # VLM renaming / voting / benchmark (paper pipeline)
145
+ ├── scripts/ # shell entry points + dataset download helpers
146
+ └── docs/ # design documents
147
+ ```
148
+
149
+ ## Notes & licenses
150
+
151
+ - The built-in example scene is generated from primitive geometry
152
+ (`demo/build_example_scene.py`) and freely redistributable.
153
+ - [ReplicaCAD](https://aihabitat.org/datasets/replica_cad/) assets
154
+ (CC-BY-NC 4.0, by Meta) are **not** included in this repository; download
155
+ them via `scripts/download_habitat_datasets.py` for paper experiments.
156
+ - ManiTaskOT-200 templates are part of the ManiTaskGen project.
157
+
158
+ ## Citation
159
+
160
+ ```bibtex
161
+ @article{manitaskgen2025,
162
+ title={ManiTaskGen: A Comprehensive Task Generator for Benchmarking and
163
+ Improving Vision-Language Agents on Embodied Decision-Making},
164
+ journal={arXiv preprint arXiv:2505.20726},
165
+ year={2025}
166
+ }
167
+ ```
config/default_config.yml ADDED
@@ -0,0 +1,224 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ common:
2
+ open_router:
3
+ api_key: Bearer sk-or-v1-YourAPIKeyHere
4
+ model: irrelevant/placeholder-model-name-only-for-initialization
5
+ scene_graph_pkl_load_path: ${run_dir}/cache/scene_graph.pkl
6
+ stage1_pre_processing:
7
+ adjust_with_gravity: true
8
+ collision_path_prefix: data/datasets/replica_cad_dataset/objects/convex
9
+ dataset_root_path: data/datasets/replica_cad_dataset
10
+ entity_json_path: ${run_dir}/cache/scene_entities.json
11
+ image4rename_path: ${run_dir}/images/image4rename
12
+ input_json_path: data/datasets/replica_cad_dataset/configs/scenes/apt_0.scene_instance.json
13
+ object_config_path: data/datasets/replica_cad_dataset/configs/objects
14
+ output_dir: ./output/
15
+ output_json_path: ${run_dir}/cache/scene_parsed.json
16
+ raw_scene:
17
+ desired_articulations: null
18
+ desired_objects: null
19
+ not_desired_articulations: null
20
+ not_desired_objects:
21
+ - frl_apartment_handbag
22
+ - frl_apartment_cushion_01
23
+ - frl_apartment_monitor
24
+ - frl_apartment_cloth_01
25
+ - frl_apartment_cloth_02
26
+ - frl_apartment_cloth_03
27
+ - frl_apartment_cloth
28
+ - frl_apartment_umbrella
29
+ - frl_apartment_tv_screen
30
+ - frl_apartment_indoor_plant_01
31
+ - frl_apartment_monitor_stand
32
+ - frl_apartment_setupbox
33
+ - frl_apartment_beanbag
34
+ - frl_apartment_bike_01
35
+ - frl_apartment_bike_02
36
+ - frl_apartment_indoor_plant_02
37
+ - frl_apartment_picture_01
38
+ - frl_apartment_towel
39
+ - frl_apartment_rug_01
40
+ - frl_apartment_rug_02
41
+ - frl_apartment_rug_03
42
+ - frl_apartment_mat
43
+ - frl_apartment_tv_object
44
+ rename_dict_path: ${run_dir}/cache/rename_dict.json
45
+ rename_engine:
46
+ model: openai/gpt-4.1-mini
47
+ scene_graph_pkl_save_path: ${run_dir}/cache/scene_graph.pkl
48
+ stage_path_prefix: data/datasets/replica_cad_dataset
49
+ urdf_path_prefix: data/datasets/replica_cad_dataset/urdf
50
+ use_renaming_engine: false
51
+ visual_path_prefix: data/datasets/replica_cad_dataset/objects
52
+ stage2a_process_task_generation:
53
+ process_based_task:
54
+ max_task_length: 5
55
+ max_task_num: 10
56
+ use_level1_tasks: false
57
+ process_based_task_pkl_save_path: ${run_dir}/cache/process_based_task.pkl
58
+ process_based_task_txt_save_path: ${run_dir}/output/process_based_task.txt
59
+ stage2b_outcome_task_generation:
60
+ image4vote_path: ${run_dir}/images/image4vote
61
+ manitaskot_pattern_file: data/templates/manitask_ot200.txt
62
+ outcome_based_task:
63
+ task_num_per_pattern: 5
64
+ vlm_list:
65
+ - "openai/gpt-4.1"
66
+ - "anthropic/claude-3.5-haiku"
67
+ - "google/gemini-2.5-flash-lite-preview-06-17"
68
+ outcome_based_task_txt_save_path: ${run_dir}/output/outcome_based_task.txt
69
+ stage3_benchmark:
70
+ benchmark_model_name: openai/gpt-4.1-mini
71
+ benchmark_task_num: 5
72
+ generate_mistake_note: false
73
+ mode: manual
74
+ image4interaction_path: ${run_dir}/images/image4interact
75
+ reflection_txt_load_path: ${run_dir}/reflection/load_reflection.txt
76
+ reflection_txt_save_path: ${run_dir}/reflection/save_reflection.txt
77
+ result_file_path: ${run_dir}/output/result.txt
78
+ use_mistake_note: 1
79
+ vlm_interactor:
80
+ MAX_INTERACTION_COUNT: 20
81
+ utilities:
82
+ basic_geometry_config:
83
+ EPS: 1.0e-05
84
+ benchmark_executor_config:
85
+ default_fovy_deg_max: 60.0
86
+ default_fovy_deg_min: 40.0
87
+ enable_detailed_logging: false
88
+ focus_ratio: 0.6
89
+ max_interaction_count: 20
90
+ picture_height: 768
91
+ picture_width: 1366
92
+ save_interaction_history: true
93
+ benchmark_prompt_template_path: data/templates/benchmark_prompts.json
94
+ concave_processor_config:
95
+ eps: 0.0001
96
+ min_polygon_area: 0.1
97
+ target_aspect_ratio: 1.8
98
+ max_target_strips: 4
99
+ merge_tolerance: 0.01
100
+ concave_threshold: 0.2
101
+ concave_min_area: 0.00001
102
+ ground_coverage_config:
103
+ eps: 0.001
104
+ resolution: 0.01
105
+ min_rect_size: 0.4
106
+ standing_point_distance: 0.8
107
+ global_bounds:
108
+ - -5.0
109
+ - 5.0
110
+ - -5.0
111
+ - 5.0
112
+ z_range:
113
+ - 0.1
114
+ - 1
115
+ image_path: ${run_dir}/data/images
116
+ image_renderer_config:
117
+ EPS: 1.0e-06
118
+ default_camera_xy:
119
+ - 0.0
120
+ - 0.0
121
+ default_far: 100.0
122
+ default_focus_ratio: 0.5
123
+ default_fovy: 1.0471975511965976
124
+ default_fovy_range:
125
+ - 0.17453292519943295
126
+ - 1.7453292519943295
127
+ default_near: 0.1
128
+ default_scipy_minimize_ftol: 0.001
129
+ default_scipy_minimize_maxiter: 250
130
+ font_size: 48
131
+ height: 1080
132
+ number_font_size: 40
133
+ roll_range:
134
+ - -0.003490658503988659
135
+ - 0.003490658503988659
136
+ trans_visiblity: 0.2
137
+ width: 1920
138
+ z_range:
139
+ - 0.2
140
+ - 2.5
141
+ interact_prompt_template_path: data/templates/interact_prompts.json
142
+ mesh_processor_config:
143
+ EPS: 1.0e-06
144
+ coverage_threshold: 0.6
145
+ height_threshold: 0.01
146
+ min_size: 0.0025
147
+ relative_size_ratio: 0.25
148
+ rectangle_query_config:
149
+ EPS: 0.001
150
+ placement_coverage_threshold: 0.95
151
+ reflection_prompt_template_path: data/templates/reflection_prompts.json
152
+ rename_engine_prompt_template_path: data/templates/renaming_engine.json
153
+ sapien_config:
154
+ ambient_light:
155
+ - 0.5
156
+ - 0.5
157
+ - 0.5
158
+ camera_shader: default
159
+ correction_rotation_x: -90
160
+ cushion_z_offset: 0.1
161
+ default_json_file: scene_parsed.json
162
+ default_material:
163
+ base_color:
164
+ - 1
165
+ - 1
166
+ - 1
167
+ metallic: 0.0
168
+ roughness: 0.5
169
+ specular: 0.5
170
+ transmission: 9.0
171
+ default_output_file: entities_apt_0.json
172
+ default_shading_mode: 1
173
+ directional_light:
174
+ - color:
175
+ - 0.5
176
+ - 0.5
177
+ - 0.5
178
+ direction:
179
+ - 0
180
+ - 1
181
+ - -1
182
+ excluded_shading_objects:
183
+ - book_03
184
+ ground_altitude: 0.0
185
+ point_lights:
186
+ - color:
187
+ - 0.5
188
+ - 0.5
189
+ - 0.5
190
+ position:
191
+ - 1.989
192
+ - -5.822
193
+ - 1
194
+ - color:
195
+ - 0.4
196
+ - 0.4
197
+ - 0.4
198
+ position:
199
+ - 2.15
200
+ - -5.9
201
+ - 1.0
202
+ ray_tracing_denoiser: none
203
+ rotation_offset_x: 90
204
+ time_step: 0.01
205
+ urdf_z_adjustment_offset: 0.005
206
+ scene_config:
207
+ collision_check_enabled: true
208
+ global_bounds:
209
+ - -5.0
210
+ - 5.0
211
+ - -5.0
212
+ - 5.0
213
+ safety_margin: 0.1
214
+ scene_element_config:
215
+ bbox_eps: 0.4
216
+ contact_eps: 0.05
217
+ ground_level_correction: 0.0001
218
+ scene_type:
219
+ NEED_COLLISION_ADJUSTMENT: true
220
+ RGBD_SCENE: false
221
+ task_interaction_config:
222
+ enable_ambiguous_item_handling: true
223
+ enable_hint_prompts: true
224
+ enable_reflection_prompts: true
data/templates/benchmark_prompts.json ADDED
@@ -0,0 +1,215 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "system_initialization": {
3
+ "prompt_type": "system_initialization",
4
+ "required_variables": [],
5
+ "content": "You are a household assistant robot equipped with a vision system and manipulation capabilities. You need to complete a task in a 3D environment, mainly involving moving, picking up, and placing objects. Your goal is to move an object from one place to another correctly according to instructions. Please strictly follow the given Action Space for operations.\n\n"
6
+ },
7
+ "task_instructions": {
8
+ "prompt_type": "task_instructions",
9
+ "required_variables": [],
10
+ "content": "At the beginning of each task, you will be informed of a specific task to complete. Throughout the task execution, you will transit between multiple states and have access to a set of possible actions (action space).\n\nYou may receive one of the following task types involving one object and another object or a platform '{an object/another object/a platform} are the name of objects or platforms:\n\n- move {an object} to {a platform}.\n- move {an object} to the {dir} of {a platform}.\n- move {an object} around {another object}.\n- move {an object} to the {dir} of {another object}.\n- move {an object} between {another object} and {yet another object}."
11
+ },
12
+ "understanding_directions": {
13
+ "prompt_type": "understanding_directions",
14
+ "required_variables": [],
15
+ "content": "**Understanding directions:**\nDirections like 'front', 'rear', 'left', and 'right' are defined relative to the robot's perspective and the heading of the object or platform you are interacting with. The heading of a ground object is not fixed and depends on where the robot is standing and facing.\n\n* **Empty Surfaces (Platforms):** When interacting with an empty platform, imagine it divided into a 3x3 grid. The direction aligned with the heading (also, the FARTHEST middle space to you, NOT THE NEAREST MIDDLE SPACE) is labeled \"front,\" with the remaining regions proceeding counterclockwise as \"front-left,\" \"left,\" \"rear-left,\" \"rear,\" \"rear-right,\" \"right,\" and \"front-right.\" The grid is conceptually numbered as follows, based on these directions:\n\n [front-left, front, front-right],\n [left, center, right],\n [rear-left, rear, rear-right]\n\n * **Occupied Surfaces (Objects on Platforms):** For objects on platforms, imagine extending the edges of the object's bounding box to the platform's boundaries. The resulting regions define the object's 8 free spaces, and the direction is defined similarly."
16
+ },
17
+ "task_success_criteria": {
18
+ "prompt_type": "task_success_criteria",
19
+ "required_variables": [],
20
+ "content": "**Task success criteria:**\n\n- **move {an object} to {a platform}**: The task is considered successful only when {an object} is placed anywhere on the specified platform.\n\n- **move {an object} to the {dir} of {a platform}**: The task is considered successful only when {an object} is placed on the platform and the geometric center of the placement is in the {dir} direction relative to the platform. \n\n- **move {an object} around {another object}**: The task is considered successful only when {an object} is placed in any of the free spaces surrounding {another object}.\n\n- **move {an object} to the {dir} of {another object}**: The task is considered successful only when {an object} is placed in the free spaces surrounding {another object} and overlaps with the {dir} direction.\n\n- **move {an object} between {another object} and {yet another object}**: The task is considered successful only when {an object} is placed such that it intersects with free spaces in a pair of opposite directions between {another object} and {yet another object}."
21
+ },
22
+ "possible_action_space_description": {
23
+ "prompt_type": "possible_action_space_description",
24
+ "required_variables": [],
25
+ "content": "Your action space, includes walking to platforms, picking up items, putting items down, rotating direction, getting information about directions around an object; CALL_END, placing an item in a specific direction on a platform, in a direction relative to another object, or placing it anywhere. Whenever you're about to choose an action, I will provide your current action space. If you choose an action that cannot be performed, such as trying to pick up an object repeatedly or attempting to place an object in a space that's too small, you'll receive a notification.\n\nPicking up an item: Corresponds to the command \"pick_up_object_{object number}_of_current_platform\".\n\nWalking to a platform: Corresponds to the command \"goto_{platform name}\".\n\nRotating direction: Corresponds to the command \"rotate_observation_view_of_current_platform\".\n\nGetting an image of an object: Corresponds to the command \"show_freespace_of_object_{object_number}_of_current_platform\".\n\nPutting down your holding item on empty platform: Corresponds to the command \"place_at_freespace_[{region_idx1},{region_idx2}...]\" where {dir_idx1}, {dir_idx2} are NUMBERS, indicating the index of the freespace; Putting down your item on an occupied platform: Corresponds to the command \"place_at_freespace_[({object_idx1},{dir_idx1})...]\",where {object_idx1}, {dir_idx1} are NUMBERS, indicating the object and its corresponding freespace. For example, \"place_at_freespace_[(1,2), (2,5)]\" means putting down your item at the union of object 1's 2nd freespace and object 2's 5th freespace.Note that for placement action, the system will attempt to find a valid placement area that intersects with all the regions you selected. If it fails, it will place the object anywhere within your chosen space and you'll receive a notification.\n\n"
26
+ },
27
+ "possible_image_type_description": {
28
+ "prompt_type": "possible_image_explanation",
29
+ "required_variables": [],
30
+ "content": "You may be shown various types of images:\n\n0) At the beginning of a task, if the task involves objects on a platform that contains other objects of the same type (e.g., the object is a book on a bookshelf with many books), you will receive a notification and images of these objects to help you distinguish them.\n\n1) Whenever you move to a platform, you will see an image of the platform from your current perspective (or multiple images for longer platforms, indicating you can move horizontally to better observe the platform).\nIf the platform has no objects, a 3x3 grid will be marked on the platform to help you place objects.\nIf there are objects on the platform, guiding lines will indicate the object numbers.\n\n2) If there are objects on a platform, you can use \"display {an object} free space\" to get a focused image of that object with numbered free spaces around it. This allows you to see the available free spaces around the object."
31
+ },
32
+ "task_remainder": {
33
+ "prompt_type": "task_remainder",
34
+ "required_variables": ["task_description", "steps_used", "total_steps"],
35
+ "content": "Current task:\n{task_description}\n\nSteps used: {steps_used}/{total_steps}. You can only take at most {total_steps} steps, so hurry if you've almost used all of them!\n",
36
+ "identical_objects_prompt": "Important: There are identical objects in this task. To help you distinguish them, we also provided images of the relevant objects.\n\n"
37
+ },
38
+ "important_suggestion": {
39
+ "prompt_type": "important_suggestion",
40
+ "required_variables": [],
41
+ "content": "Here are some useful suggestions for you to better finish the task: \n\n1. We only provide the initial states about the items and destinations, so whenever you start performing a subtask, you need to consider whether the target objects are already moved to elsewhere while you're performing the former subtasks. \n\n2. Your extra actions do not affect the success of the task, you only need to keep your steps within the total step limit.\n\n3. When you want to place an object but cannot find enough space, you can try changing your standing position to find the correct orientation, try combining multiple free spaces, or remove objects that are blocking your way first (although you generally do not need to do this). Specifically, for the task asking you to put an object on empty platforms, try combining adjacent free spaces may be very useful.\n\n4. For tasks that involve placing objects near other objects, please remember to get a focused image of the target object and examine it carefully. This is important because the regions may not be intuitive. \n\n5. **Important: Don't output anything other than the action you want to take. You will only receive the same hint informing you your invalid action. If you make mistakes, just start outputting correct actions from the next prompt without any apologies.\n\n**"
42
+ },
43
+
44
+ "current_state": {
45
+ "prompt_type": "current_state",
46
+ "required_variables": ["platform_name", "holding_object"],
47
+ "content": "You are currently at {platform_name}.\n\nAnd you are holding {holding_object}."
48
+ },
49
+ "action_space": {
50
+ "prompt_type": "action_space",
51
+ "template": {
52
+ "required_variables": [],
53
+ "content": "Your available action space:\n{action_space_content}\n\nAll your current available actions are listed as follows (all are without quotes and square brackets). Please don't mix up it with the action space of previous steps."
54
+ },
55
+ "variants": {
56
+ "navigation": {
57
+ "required_variables": ["location_action_list"],
58
+ "content": "Your available actions (all are without quotes and square brackets):\n- `CALL_END`: Call end (terminate the task).\n- {location_action_list}. Please choose one of the available actions."
59
+ },
60
+ "idle": {
61
+ "required_variables": [
62
+ "location_action_list",
63
+ "object_action_list",
64
+ "show_freespace_of_object_action_list"
65
+ ],
66
+ "content": "Your available actions:\n- {location_action_list}\n- {object_action_list}\n- {show_freespace_of_object_action_list}\n- `CALL_END`: Call end (terminate the task).\n- `rotate_observation_view_of_current_platform`: Change the viewing angle to observe the scene from another perspective.\n\nChoose one of the available actions."
67
+ },
68
+ "holding_empty_platform": {
69
+ "required_variables": [
70
+ "location_action_list",
71
+ "show_freespace_of_object_action_list"
72
+ ],
73
+ "content": "Your available actions:\n-{location_action_list}\n- {show_freespace_of_object_action_list}\n- `CALL_END`: Call end (terminate the task).\n- `rotate_observation_view_of_current_platform`: Change the viewing angle to observe the scene from another perspective.\n- `place_at_anywhere`:Place the object in an arbitrary place on the platform. - `place_at_freespace_[{region_idx1},{region_idx2}...]`: Place the object in the union area of regions with indices {region_idx1}, {region_idx2}, etc. regions should be numbered from 1 to 9\n\n"
74
+ },
75
+ "holding_occupied_platform": {
76
+ "required_variables": [
77
+ "available_freespace_pair_list",
78
+ "location_action_list",
79
+ "show_freespace_of_object_action_list"
80
+ ],
81
+ "content": "Your available actions:\n-{location_action_list}\n- {show_freespace_of_object_action_list}\n- `CALL_END`: Call end (terminate the task).\n- `rotate_observation_view_of_current_platform`: Change the viewing angle to observe the scene from another perspective.\n- `place_at_anywhere`:Place the object in an arbitrary place on the platform. - `place_at_freespace_[({object_idx1},{dir_idx1})...]`: Place the object in the union area of regions with indices {(object_idx1,region_idx1)}(object_idx1's region_idx1 space) etc. All available pairs are in {available_freespace_pair_list}, and a valid choice should be a subset of it. \n\n"
82
+ }
83
+ }
84
+ },
85
+
86
+ "image_description": {
87
+ "template": {
88
+ "required_variables": ["n_image", "image_name_list"],
89
+ "content": "Here are {n_image} images, named {image_name_list} respectively.\n\nTheir description is as follows: {image_description}"
90
+ },
91
+ "variants": {
92
+ "identical_object_to_move": {
93
+ "required_variables": [
94
+ "image_name",
95
+ "source_object_name",
96
+ "source_platform_name"
97
+ ],
98
+ "content": "This image, {image_name}, is an image of the object you are going to move, with its adjacent objects transparentized. The object is {source_object_name}.\n\nThe object is located on {source_platform_name}.\n\n"
99
+ },
100
+ "identical_object_destination": {
101
+ "required_variables": [
102
+ "image_name",
103
+ "destination_object_name",
104
+ "destination_platform_name"
105
+ ],
106
+ "content": "This image, {image_name}, is an image of the object you are going to place an object nearby, with its adjacent objects transparentized. The object is {destination_object_name}.\n\nThe object is located on {destination_platform_name}.\n\n"
107
+ },
108
+
109
+ "show_freespace_of_object": {
110
+ "required_variables": ["image_name", "object_idx", "freespace_num"],
111
+ "shared_variables": ["object_idx"],
112
+ "content": "This image shows the available free spaces around object {object_idx} on the platform, you see this because you've taken \"show_freespace\" action previously. The numbers from 1 to {freespace_num} indicate the available free spaces. Not all numbers from 1 to 8 may be present, as some free spaces might be too small or blocked. To use the numbers shown in the image to specify where you want to place the object you are holding, you can include ({object_idx}, {freespace_idx} (freespace_idx in [1, {freespace_num}]) in the output action.\n\n"
113
+ },
114
+ "show_platform": {
115
+ "required_variables": ["image_name"],
116
+ "shared_variables": ["platform_name"],
117
+ "content": "This image shows the platform you are currently on in one view, with regions or objects marked with numbers for you to place objects accurately. The platform is {platform_name}.\n\nIf the platform has no objects, a 3x3 grid will be marked on the platform to help you place objects, with each grid marked in numbers from 1 to 9. If there are objects on the platform, guiding lines will indicate the object numbers. Note that if you see multiple images, it means the platform is too long to be captured in one image, and it's guaranteed that the same object will marked in THE SAME COLOR GUILDLINES AND THE SAME NUMBER. If you think you can't determine the number of an item in one picture, you can go through other pictures and see if this item is marked more clearly.\n\n"
118
+ }
119
+ }
120
+ },
121
+ "states": {
122
+ "navigation": {
123
+ "prompts": [
124
+ "system_initialization",
125
+ "task_instructions",
126
+ "possible_action_space_description",
127
+ "possible_image_type_description",
128
+ "understanding_directions",
129
+ "task_success_criteria",
130
+ "task_remainder",
131
+ "action_space_navigation",
132
+ "important_suggestion"
133
+ ]
134
+ },
135
+ "idle": {
136
+ "prompts": [
137
+ "current_state",
138
+ "action_space_idle",
139
+ "task_remainder",
140
+ "important_suggestion",
141
+ "image_description"
142
+ ]
143
+ },
144
+ "holding_empty_platform": {
145
+ "prompts": [
146
+ "current_state",
147
+ "action_space_holding_empty_platform",
148
+ "task_remainder",
149
+ "understanding_directions",
150
+ "important_suggestion",
151
+ "image_description"
152
+ ]
153
+ },
154
+ "holding_occupied_platform": {
155
+ "prompts": [
156
+ "current_state",
157
+ "action_space_holding_occupied_platform",
158
+ "task_remainder",
159
+ "understanding_directions",
160
+ "important_suggestion",
161
+ "image_description"
162
+ ]
163
+ }
164
+ },
165
+ "hints": {
166
+ "attempt_moving_destination_hint": {
167
+ "prompt_type": "attempt_moving_destination_hint",
168
+ "content": "You are trying to pick up a destination object, which is not allowed and not necessary to finish the task. Please try picking up another object instead."
169
+ },
170
+ "identical_object_involved": {
171
+ "content": "The task involves identical objects. To help you distinguish them, we have provided images of the relevant objects.\n\n"
172
+ },
173
+ "not_available_action_hint": {
174
+ "prompt_type": "not_available_action_hint",
175
+ "content": "We can't recognize the action you've entered so it is ignored, and it seems you've entered an action having correct format but is not available currently (such as picking up repeatedly or placing with no object in hand).Please note you can only hold one item at a time, and you need different patterns of instruction for placing items on empty platform and occupied platform. If you are seeing this repeatedly, please check if you're trying to place while holding nothing, pickup while already holding something, using \"place_at_freespace_[({object_idx1},{dir_idx1})...]\" with empty platform or \"place_at_freespace_[{dir_idx1},{dir_idx2}...]\" with occupied platform. \n\n Please enter a valid action according to the action space. Remember, don't output any irrelevant characters, don't output your thinking steps or apologize!!\n\n"
176
+ },
177
+ "invalid_action_hint": {
178
+ "prompt_type": "invalid_action_hint",
179
+ "content": "We can't recognize the action you've entered so it is ignored. Please note you can only hold one item at a time, and you need different patterns of instruction for placing items on empty platform and occupied platform. If you are seeing this repeatedly, please check if you're trying to place while holding nothing, pickup while already holding something, using \"place_at_freespace_[({object_idx1},{dir_idx1})...]\" with empty platform or \"place_at_freespace_[{dir_idx1},{dir_idx2}...]\" with occupied platform. Remember, don't output any irrelevant characters, including quotes; don't output your thinking steps or apologize!!\n\n"
180
+ },
181
+ "placement_failure_area_too_small": {
182
+ "prompt_type": "placement_failure",
183
+ "content": "The combined area you selected is not large enough to place the object. Please choose a larger area, select 'place_at_anywhere' or go elsewhere instead.\n\n"
184
+ },
185
+ "placement_failure_no_intersection": {
186
+ "content": "The system could not find a location that intersects with all the regions/free spaces you selected. The system will now place the object anywhere within your chosen space. If you think the placement doesn't match your expectation, you can pick it up and try placement again. \n\n"
187
+ },
188
+ "placement_failure_idle": {
189
+ "prompt_type": "placement_failure_idle",
190
+ "content": "You don't have an object in your hand, so you cannot place anything. Please pick up an object first before attempting to place it.\n\n"
191
+ },
192
+ "placement_failure_empty_platform": {
193
+ "prompt_type": "placement_failure_empty_platform",
194
+ "content": "The platform you are trying to place the object on is empty. Please ensure that you are placing the object with correct placement format.\n\nYou are still holding {holding_object} and are at {platform_description}.\n\n"
195
+ },
196
+ "placement_failure_occupied_platform": {
197
+ "prompt_type": "placement_failure_occupied_platform",
198
+ "content": "The platform you are trying to place the object on is occupied. Please ensure that you are placing the object with correct placement format.\n\nYou are still holding {holding_object} and are at {platform_description}.\n\n"
199
+ },
200
+ "placement_failure_invalid_place": {
201
+ "prompt_type": "placement_failure_invalid_place",
202
+ "content": "The placement action you attempted is invalid, you probably entered invalid region. You are still holding {holding_object} and are at {platform_description}.\n\n"
203
+ },
204
+ "placement_made": {
205
+ "content": "The object has been placed successfully. You can now call end if you think you've finished the task correctly, or can also pick up the object again if you think the placement is not correct.\n\n"
206
+ },
207
+ "response_format_hint": {
208
+ "prompt_type": "response_format_hint",
209
+ "content": "Please only respond with the action you want to take. Do not include any additional characters, neither text or explanations. The action should be one of the following:\n\n{action_space}\n\n."
210
+ },
211
+ "rotation_failed_hint": {
212
+ "content": "Unable to rotate to another view. The platform you at only have 1 walkable place for you. \n\n"
213
+ }
214
+ }
215
+ }
data/templates/manitask_ot200.txt ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Arrange [SUB-PLATFORM-CATEGORY-OBJECTS00] on [PLATFORM0] by height and type.
2
+ Reorganize the left side of the top of [PLATFORM0].
3
+ Set up an artistic arrangement on [PLATFORM0] by positioning [SUB-PLATFORM-OBJECTS00] in a pattern that highlights their artistic qualities.
4
+ Organize the objects on [PLATFORM0] into a "symphony" by arranging them in a pattern that resembles musical notes and instruments.
5
+ Help me straighten [PLATFORM0] to make it tidy.
6
+ Optimize [PLATFORM0] by categorizing and aligning all [SUB-PLATFORM-OBJECTS00] into sections, creating a clear and organized system for easy access.
7
+ Assemble an interactive project display on [PLATFORM0] by collecting all related materials and organizing them to represent a project timeline.
8
+ Organize the objects on [PLATFORM0] into a "geometric pattern" by arranging them in a series of interconnected shapes and lines.
9
+ Align all [SUB-PLATFORM-OBJECTS00] on [PLATFORM0] symmetrically.
10
+ Create a functional workspace on [PLATFORM0] by strategically placing the [SUB-PLATFORM-OBJECTS00] to maximize efficiency and ergonomics.
11
+ Create a symmetrical display on [PLATFORM0] by arranging the items into evenly spaced and aligned sections.
12
+ Sort [SUB-PLATFORM-CATEGORY-OBJECTS00] on [PLATFORM0] by material and usage.
13
+ Arrange [SUB-PLATFORM-CATEGORY-OBJECT00] on [PLATFORM0] by relevance.
14
+ On [PLATFORM0], create a symmetrical arrangement of [SUB-PLATFORM-OBJECTS00] and [SUB-PLATFORM-OBJECTS01], alternating their positions in a pattern that emphasizes their distinct shapes and colors for a harmonious aesthetic.
15
+ Organize all the items on [PLATFORM0] by separating them into categories: place all [SUB-PLATFORM-OBJECTS00] in a single stack, align any [SUB-PLATFORM-OBJECTS01] in a row, and move [SUB-PLATFORM-OBJECTS02] to the left side.
16
+ Reorganize [PLATFORM0] by color-coding [SUB-PLATFORM-CATEGORY-OBJECTS00] in a gradient order.
17
+ Reorganize the contents of [PLATFORM0] to enhance its functionality for a specific task, such as creating a dedicated space for [SUB-PLATFORM-OBJECTS00].
18
+ Create a thematic display on [PLATFORM0].
19
+ Reposition all [SUB-PLATFORM-OBJECTS00] on top of [PLATFORM0] to form a balanced layout, ensuring that no items obstruct the workspace in the center.
20
+ Use items from [PLATFORM0] and [PLATFORM1] to create an artistic installation or arrangement on [PLATFORM2] that reflects a specific theme or concept.
21
+ Rearrange the [SUB-PLATFORM-OBJECTS00] and [SUB-PLATFORM-OBJECTS01] scattered across the surface of [PLATFORM0] into an organized, color-coordinated display. Ensure that each category of items is neatly grouped together and aligned parallel to the edges of the [PLATFORM0].
22
+ Design a "jigsaw puzzle" on [PLATFORM0] by arranging the objects in a way that creates a cohesive whole.
23
+ Sort all [SUB-PLATFORM-CATEGORY-OBJECTS00] on [PLATFORM0] by material type.
24
+ Arrange all [SUB-PLATFORM-OBJECTS00] on the top of [PLATFORM0] into a neatly ordered gradient, transitioning from the largest [SUB-PLATFORM-OBJECTS00] to the smallest, to create a visually appealing display.
25
+ Create a "staircase" on [PLATFORM0] by arranging the objects to resemble steps.
26
+ Create a pattern with the [SUB-PLATFORM-OBJECTS00] on [PLATFORM0] by placing them in a spiral, starting from the center of the desk and expanding outward.
27
+ Transform [PLATFORM0] into a presentation space by placing colorful [SUB-PLATFORM-CATEGORY-OBJECT00] to create an engaging backdrop.
28
+ Design a pattern with [SUB-PLATFORM-OBJECTS00] on [PLATFORM0].
29
+ On [PLATFORM0], set up an educational arrangement with [SUB-PLATFORM-CATEGORY-OBJECTS00], making sure that each item is placed for optimal learning and interaction.
30
+ Create an aesthetically pleasing arrangement of [SUB-PLATFORM-OBJECTS00] on [PLATFORM0]. Place [SUB-PLATFORM-OBJECTS00] in a staggered formation and group other [SUB-PLATFORM-OBJECTS01] to create visual interest.
31
+ Design a thematic organization system on [PLATFORM0] for all [SUB-PLATFORM-OBJECTS00], separating items by color and function.
32
+ Align [SUB-PLATFORM-CATEGORY-OBJECTS00] on [PLATFORM0] symmetrically by type.
33
+ Rearrange [SUB-PLATFORM-CATEGORY-OBJECTS00] on [PLATFORM0] into a visually appealing pattern, ensuring even spacing and grouping by type.
34
+ Reorganize [SUB-PLATFORM-OBJECTS00] on [PLATFORM0] so that they are easily reachable.
35
+ On [PLATFORM0], organize the [SUB-PLATFORM-CATEGORY-OBJECTS00] and [SUB-PLATFORM-CATEGORY-OBJECTS01] by size and functionality. Stack the [SUB-PLATFORM-CATEGORY-OBJECTS00] neatly in a pyramid-like structure on the left side while arranging the [SUB-PLATFORM-CATEGORY-OBJECTS01] on the right based on their power source.
36
+ Organize the entire contents of [PLATFORM0] by categorizing items into labeled sections, with frequently used items at a central location for easy access.
37
+ Move frequently used items from [PLATFORM0] and [PLATFORM1] to the top of [PLATFORM2], arranging them in a logical order.
38
+ Position [SUB-PLATFORM-OBJECTS00] on [PLATFORM0] for optimal accessibility.
39
+ Locate all [SUB-OBJECTS0] in the room, group them by size, and place them in descending order along the edge of [PLATFORM0].
40
+ Create a color gradient arrangement of [SUB-PLATFORM-CATEGORY-OBJECTS00] on [PLATFORM0].
41
+ Group [SUB-PLATFORM-CATEGORY-OBJECT00] on [PLATFORM0] by type and size.
42
+ Design an interactive display on [PLATFORM0] by arranging all [SUB-PLATFORM-OBJECTS00] into a functional setup, ensuring easy interaction with each device.
43
+ Reorganize [PLATFORM0] to group similar items together, placing frequently used items at eye level.
44
+ Organize the clutter on the top of [PLATFORM0] by grouping all [SUB-PLATFORM-OBJECTS00] into designated areas and aligning them in a precise row or grid.
45
+ Find all [SUB-LAYER-OBJECTS0] and [SUB-LAYER-OBJECTS1] scattered across [MULTILAYER-OBJECT0] and place them in chronological order by date of publication on the second shelf. Ensure they are aligned perfectly, with their spines facing outward.
46
+ Transform the top of [PLATFORM0] into a "cityscape" by arranging objects to resemble buildings and roads.
47
+ Reorganize the top of [PLATFORM0].
48
+ Arrange [PLATFORM0], [PLATFORM1], and [PLATFORM2] for collaborative work, ensuring ample space for group discussions and joint tasks.
49
+ On [PLATFORM0], create a designated workspace by clearing the center and arranging [SUB-PLATFORM-OBJECTS00] in a semi-circle around the periphery.
50
+ Transform [PLATFORM0] into an "art gallery" by arranging the objects to resemble paintings, sculptures, and other forms of art.
51
+ Bundle the [SUB-PLATFORM-CATEGORY-OBJECTS00] on [PLATFORM0] by length, secure them, and place each bundle in opposite corners of the desk.
52
+ Take all [SUB-PLATFORM-OBJECTS00] from [PLATFORM0] and arrange them on [PLATFORM1] in an orderly fashion.
53
+ Rearrange the scattered [SUB-PLATFORM-CATEGORY-OBJECTS00] and [SUB-PLATFORM-CATEGORY-OBJECTS01] on the [PLATFORM0] in a structured manner, creating a visually appealing workspace that fosters creativity and productivity.
54
+ Carefully arrange all the [SUB-PLATFORM-CATEGORY-OBJECTS00] on [PLATFORM0] in ascending order of size, leaving a clear space in the center for the [SUB-PLATFORM-OBJECTS00] from [PLATFORM0] to be placed as a decorative piece.
55
+ Create a neat and functional layout on top of [PLATFORM0]. Begin by removing unnecessary items and sorting the remaining objects. Place any [SUB-PLATFORM-OBJECTS00] near the back left corner. Arrange the [SUB-PLATFORM-OBJECTS01] in the back right corner and stack any loose [SUB-PLATFORM-OBJECTS02] at the front left of the desk, ensuring the center remains clean.
56
+ Align [SUB-PLATFORM-CATEGORY-OBJECTS00] on [PLATFORM0] symmetrically by size.
57
+ Clear all items from the top of [PLATFORM0] and perform a deep cleaning.
58
+ Reorganize the [SUB-PLATFORM-OBJECTS00] on [PLATFORM0] to create a cohesive color scheme.
59
+ Arrange [SUB-PLATFORM-OBJECTS00] in a grid pattern on [PLATFORM0].
60
+ Arrange the [SUB-PLATFORM-OBJECTS00] on [PLATFORM0] by height.
61
+ Transform the top of [PLATFORM0] into a "kaleidoscope" by arranging objects to create a colorful, symmetrical pattern.
62
+ Design an aesthetic display of [SUB-PLATFORM-OBJECTS00] on [PLATFORM0].
63
+ Create a balanced layout of [SUB-PLATFORM-OBJECTS00] on [PLATFORM0].
64
+ Transform the top of [PLATFORM0] into an interactive display area, arranging [SUB-PLATFORM-OBJECTS00] in a way that highlights their features.
65
+ Organize a color-coordinated shelf on [MULTILAYER-OBJECT0] by grouping items by their colors and arranging them in a gradient pattern.
66
+ Transform the cluttered space on [PLATFORM0] into a functional work area by systematically removing unnecessary items and arranging the remaining objects in a neat and organized manner.
67
+ Design an efficient storage system on [PLATFORM0] by categorizing and arranging small objects into separate sections to maximize space.
68
+ Create a "city" on [PLATFORM0] by arranging the objects to resemble buildings, roads, and parks.
69
+ Reorganize the items on [PLATFORM0] and [PLATFORM1] to create a thematic display that tells a story or represents a concept, ensuring that the display is both visually engaging and informative.
70
+ Arrange [SUB-PLATFORM-CATEGORY-OBJECT00] on [PLATFORM0] by color gradient.
71
+ Clear [PLATFORM0] by folding [SUB-PLATFORM-OBJECTS00] and placing them on [PLATFORM1].
72
+ Transform the top of [PLATFORM0] into a "mini-garden" by arranging the objects to resemble a miniature landscape with flowers, trees, and paths.
73
+ On [PLATFORM0], create a streamlined workstation by pushing all [SUB-PLATFORM-OBJECTS00] to the far side and arranging the [SUB-PLATFORM-OBJECTS01] ergonomically.
74
+ Reorganize the top surface of [PLATFORM0] by categorizing all visible objects. Group [SUB-PLATFORM-OBJECTS00] by color and size, place all [SUB-PLATFORM-OBJECTS01] neatly in one corner, and arrange any other objects in a row along the back edge.
75
+ Transform the area surrounding [PLATFORM0] into a neatly organized workshop space by grouping all [SUB-PLATFORM-CATEGORY-OBJECT00] according to their type.
76
+ Arrange [SUB-PLATFORM-CATEGORY-OBJECT00] on [PLATFORM0] by importance.
77
+ Reconfigure the items on [PLATFORM0] to set up a mini art studio.
78
+ On [PLATFORM0], group [SUB-PLATFORM-OBJECTS00] based on their functions, and arrange tools into an organized toolkit display according to frequency of use.
79
+ Establish a functional workspace on [PLATFORM0].
80
+ Clear the entire top surface of [PLATFORM0], and then create a structured workspace by placing the [SUB-PLATFORM-OBJECTS00], [SUB-PLATFORM-OBJECTS01] in a symmetrical arrangement. Leave room in the corner of the [PLATFORM0] for the [SUB-PLATFORM-OBJECTS10] from [PLATFORM1].
81
+ Design a "mirrored room" on top of [PLATFORM0] by arranging the objects to create a sense of symmetry and reflection.
82
+ Group [SUB-PLATFORM-CATEGORY-OBJECT00] on [PLATFORM0] by usage frequency.
83
+ Align all [SUB-PLATFORM-CATEGORY-OBJECTS00] on [PLATFORM0] into a grid pattern based on their shape, with the largest objects positioned near the back.
84
+ Create a cohesive and visually appealing display on [PLATFORM0] by organizing the various [SUB-PLATFORM-CATEGORY-OBJECT00] into thematic groups.
85
+ Selectively curate the items on [PLATFORM0] to only include those that promote productivity, then arrange the remaining objects in a minimalistic style.
86
+ Transform [PLATFORM0] into a visually appealing display by organizing all [SUB-PLATFORM-CATEGORY-OBJECTS00], [SUB-PLATFORM-CATEGORY-OBJECTS01], and [SUB-PLATFORM-CATEGORY-OBJECTS02] in a balanced manner, ensuring that the [SUB-PLATFORM-CATEGORY-OBJECTS00] are sorted by size or color and that the [SUB-PLATFORM-CATEGORY-OBJECTS01] are placed in a way that enhances the overall look.
87
+ Design a functional and aesthetically pleasing arrangement for the top surface of [PLATFORM0], incorporating a mix of [SUB-PLATFORM-OBJECTS00], [SUB-PLATFORM-OBJECTS01], and [SUB-PLATFORM-OBJECTS02] in a visually balanced manner, with careful attention to height and placement for optimal display.
88
+ Reorganize the items on [PLATFORM0] to optimize it for collaborative work.
89
+ On [PLATFORM0], group all [SUB-PLATFORM-OBJECTS00] by color and arrange them in a circular pattern around the [SUB-PLATFORM-OBJECTS01], with a gap of 1 centimeter between each item, making it visually appealing and functional.
90
+ Transform the space on [PLATFORM0] by categorizing all [SUB-PLATFORM-CATEGORY-OBJECTS00] and [SUB-PLATFORM-CATEGORY-OBJECTS01] according to their colors and sizes. Arrange them in a visually appealing gradient from left to right.
91
+ Organize all the objects on top of [PLATFORM0] into a series of concentric circles, with the largest objects at the center.
92
+ Create a "mini-city" on the top of [PLATFORM0] by arranging surface items to form a small landscape with hills and valleys.
93
+ Organize [SUB-PLATFORM-CATEGORY-OBJECT00] on [PLATFORM0] by height.
94
+ Gather [SUB-OBJECT-CATEGORY0] from the [ROOM], clean them, and place them in a balanced pattern on [PLATFORM0], ensuring no adjacent matching colors.
95
+ Create a product display on [PLATFORM0] by arranging the items in a visually appealing and functional manner that highlights their features.
96
+ Gather all the [SUB-PLATFORM-OBJECTS00] from [PLATFORM0], then organize them by category on the top shelf of [MULTILAYER-OBJECT0], arranging them in a gradient from smallest to largest.
97
+ Align the [SUB-PLATFORM-OBJECTS00] on [PLATFORM0] into a circle.
98
+ Redesign the surface of [PLATFORM0] to create an efficient workspace by arranging the [SUB-PLATFORM-CATEGORY-OBJECTS00], [SUB-PLATFORM-CATEGORY-OBJECTS01], and [SUB-PLATFORM-CATEGORY-OBJECTS02] in a systematic manner, with each category neatly separated and easily accessible.
99
+ Declutter the right side of [PLATFORM0] by moving all loose objects to the left side and aligning them by size.
100
+ Transform [PLATFORM0] into a functional workspace by systematically arranging [SUB-PLATFORM-OBJECTS00], keeping frequently used items within easy reach.
101
+ Design a "futuristic cityscape" on top of [PLATFORM0] using the small objects, with towering skyscrapers, roads, and buildings.
102
+ Arrange [SUB-PLATFORM-OBJECTS00] on [PLATFORM0] in a cascading fashion.
103
+ Transform the [TOP-LAYER] of [MULTILAYER-OBJECT0] by aligning all [SUB-LAYER-CATEGORY-OBJECTS00] into neatly organized rows.
104
+ From [PLATFORM0], collect all the [SUB-PLATFORM-OBJECTS00] and [SUB-PLATFORM-OBJECTS01], then create a visually appealing display on the middle shelf of [MULTILAYER-OBJECT0], ensuring the tallest items are in the back and shorter ones in front.
105
+ On the top surface of [PLATFORM0], create a visually appealing layout by arranging all [SUB-PLATFORM-OBJECTS00] into a grid pattern with even spacing.
106
+ Build a geometric sculpture using [SUB-PLATFORM-OBJECTS00] on top of [PLATFORM0].
107
+ Rearrange all [SUB-LAYER-OBJECTS0] across layers of [MULTILAYER-OBJECT0] so that they are organized by size, placing the largest ones at the bottom and the smallest ones at the top, ensuring that the top shelf has only [SUB-LAYER-OBJECTS0] neatly aligned side by side.
108
+ For the collection of small electronic devices on [PLATFORM0], use principles of proportion and balance to group them.
109
+ Position [SUB-PLATFORM-OBJECTS00] on [PLATFORM0] for a streamlined setup.
110
+ On [PLATFORM0], gather all [SUB-PLATFORM-OBJECTS00] and line them up by size, ensuring they are equidistant.
111
+ Prepare [PLATFORM0] for an upcoming meeting by organizing [SUB-PLATFORM-OBJECTS00] into a neat, functional workspace.
112
+ Create a whimsical "forest" on top of [PLATFORM0] using objects on top of it.
113
+ Transform [PLATFORM0] into a futuristic art installation using [SUB-PLATFORM-CATEGORY-OBJECTS00].
114
+ Tidy up the [PLATFORM0].
115
+ Transform the cluttered top of [PLATFORM0] by systematically categorizing the [SUB-PLATFORM-OBJECTS00], [SUB-PLATFORM-OBJECTS01], and [SUB-PLATFORM-OBJECTS02] into designated sections, providing a clear overview of components for future tasks and projects.
116
+ Redesign the layout of [PLATFORM0] and its surrounding area, repositioning the [SUB-PLATFORM-OBJECTS00] for better ergonomics.
117
+ Design a maze using [SUB-PLATFORM-OBJECTS00] on the [PLATFORM0], creating a complex and challenging path that requires careful navigation to complete.
118
+ Transform the top of [PLATFORM0] into a "maze" by arranging objects to create a challenging path for a robot to navigate.
119
+ Conduct a thorough inspection and organization of [PLATFORM0], categorizing the contents and placing vivid [SUB-PLATFORM-SINGLE-OBJECTS00] at eye level.
120
+ Elevate the functionality of [PLATFORM0] by restructuring its surface layout.
121
+ Construct a mini obstacle course using objects on the [PLATFORM0].
122
+ Create a "dramatic scene" on [PLATFORM0] by arranging the objects to resemble characters, props, and scenery from a play or movie.
123
+ Transform the contents of [PLATFORM0] into a visually striking arrangement, placing all [SUB-PLATFORM-OBJECTS00] in a gradient of colors from left to right.
124
+ Revamp [PLATFORM0] to achieve a Zen-like atmosphere by meticulously sorting and aligning all [SUB-PLATFORM-CATEGORY-OBJECTS00] on the surface.
125
+ Reconfigure the layout of [PLATFORM0] by sorting all [SUB-PLATFORM-OBJECTS00] into thematic sections, using dividers for better organization.
126
+ Clear the top of [PLATFORM0], then reposition the [SUB-PLATFORM-OBJECTS00] and [SUB-PLATFORM-OBJECTS01] to create a miniature diorama.
127
+ Rearrange the [SUB-PLATFORM-OBJECTS00] on the right side of [PLATFORM0] to create a visually appealing spiral pattern with the [SUB-PLATFORM-OBJECTS01].
128
+ Rearrange the [SUB-PLATFORM-OBJECTS00] scattered across [PLATFORM0], placing them neatly and leaving a clear space in the center for working.
129
+ Design a thematic layout with [SUB-PLATFORM-OBJECTS00] on [PLATFORM0].
130
+ Create a visual flow with [SUB-PLATFORM-OBJECTS00] on [PLATFORM0].
131
+ Organize the top surface of [PLATFORM0] by grouping similar items together and ensuring a visually balanced layout.
132
+ Align [SUB-PLATFORM-CATEGORY-OBJECT00] on [PLATFORM0] by color and type.
133
+ Transform the top of [PLATFORM0] into a functional artistic display by arranging [SUB-PLATFORM-OBJECTS00] to highlight creativity.
134
+ Arrange the [SUB-PLATFORM-OBJECTS00] on [PLATFORM0] in a systematic manner that reduces the time spent searching for items and supports a smooth workflow.
135
+ Rearrange and optimize the [SPECIFIC-LAYER] of [MULTILAYER-OBJECT0].
136
+ Design a "mandala" on top of [PLATFORM0] by arranging objects in a pattern resembling intricate geometric shapes and symmetries.
137
+ Create an interactive display on [PLATFORM0] by arranging all [SUB-PLATFORM-OBJECTS00] in a circuit-like pattern.
138
+ Redesign the layout of [PLATFORM0] to create a curated gallery by organizing all [SUB-PLATFORM-OBJECTS00] into thematic sections.
139
+ Gather all [SUB-PLATFORM-OBJECTS00] , [SUB-PLATFORM-OBJECTS10], [SUB-PLATFORM-OBJECTS20]scattered across [PLATFORM0], [PLATFORM1], and [PLATFORM2], and arrange them by size and color on [PLATFORM3].
140
+ Remove all objects from [PLATFORM0] and organize them into distinct categories, placing related items together on [PLATFORM1].
141
+ Disorganize the top of [PLATFORM0] to make it messy.
142
+ Sort items from [PLATFORM0] and [PLATFORM1] into categories and place them on [PLATFORM2] and [PLATFORM3].
143
+ On [PLATFORM0], organize [SUB-PLATFORM-OBJECTS00] by size into two piles: larger on the left, smaller on the right, placing [SUB-PLATFORM-OBJECTS00] next to them.
144
+ Assemble a dynamic work area on [PLATFORM0] by grouping [SUB-PLATFORM-OBJECTS00] into functional clusters with cables neatly routed and connected.
145
+ Inside [PLATFORM0], locate the [SUB-PLATFORM-OBJECTS00] and rearrange them to create a visual story, ensuring even spacing and alignment.
146
+ Curate the top and middle layers of [MULTILAYER-OBJECT0] to resemble a library exhibit, organizing the [SUB-LAYER-CATEGORY-OBJECTS00].
147
+ Design a "labyrinth" on [PLATFORM0] by arranging the [SUB-PLATFORM-OBJECTS00] in a way that creates a challenging and intricate maze.
148
+ Create a "mazelike" sculpture on [PLATFORM0] using [SUB-PLATFORM-OBJECTS00] with multiple paths and dead ends
149
+ Organize the objects on [PLATFORM0] into a "geometric pattern" by arranging them in interconnected shapes and lines.
150
+ Craft a miniature sculpture from the assortment of [SUB-PLATFORM-OBJECTS00] on [PLATFORM0] and place it on [PLATFORM1] for creative inspiration, ensuring it's positioned to catch the eye while minimizing distraction.
151
+ Transform [PLATFORM0] into a curated display, arranging [SUB-PLATFORM-OBJECTS00] to highlight their unique features.
152
+ Organize the objects on top of [PLATFORM0] into a "waterfall" by arranging them to create a cascading pattern.
153
+ Arrange the [SUB-PLATFORM-OBJECTS00] on [PLATFORM0] in a manner that minimizes clutter and provides easy access. Consider ergonomic factors and the flow of movement when positioning these items.
154
+ Arrange the items on the top layer of [PLATFORM0] into an orderly sequence, aligning them in neat rows or columns for balance and proportion.
155
+ On [PLATFORM0], clear all objects except for the [SUB-PLATFORM-OBJECTS00], and create a minimalist aesthetic with three carefully selected items.
156
+ Take all [SUB-PLATFORM-CATEGORY-OBJECT00] from [PLATFORM0], sort them by subject or project, and store them on [PLATFORM0].
157
+ Create a "stage" on [PLATFORM0] by arranging the objects to resemble a theater set.
158
+ Design a "mini-museum" on [PLATFORM0] by arranging objects to tell a story with one item as the centerpiece.
159
+ Transform the top of [PLATFORM0] into a mini gallery by creatively displaying [SUB-PLATFORM-CATEGORY-OBJECTS00] and [SUB-PLATFORM-CATEGORY-OBJECTS01].
160
+ Optimize the utility of [PLATFORM0] by categorizing and positioning all [SUB-PLATFORM-OBJECTS00] in a structured manner, ensuring easy retrieval and organization.
161
+ Design a sustainable storage system on [PLATFORM0] by categorizing and arranging small objects to promote eco-friendliness.
162
+ Align all [SUB-PLATFORM-CATEGORY-OBJECTS00] on [PLATFORM0] in a visually pleasing gradient from light to dark colors, ensuring proper spacing for easy access.
163
+ Place [SUB-PLATFORM-OBJECTS00] on [PLATFORM0] in a mirrored arrangement.
164
+ Create an artistic arrangement on [PLATFORM0].
165
+ Clean up the [SUB-PLATFORM-OBJECTS00] on [PLATFORM0] into other places.
166
+ Clear all the items from [PLATFORM0] and redistribute them across the room: place any [SUB-PLATFORM-OBJECTS00] onto [PLATFORM1], any [SUB-PLATFORM-OBJECTS01] onto [PLATFORM2], and any [SUB-PLATFORM-OBJECTS02] onto [PLATFORM3], creating a purposeful flow throughout the room.
167
+ Gather all the [SUB-OBJECTS0] scattered across [PLATFORM0] and [PLATFORM1]. Place them in a straight line in front of [PLATFORM0], facing toward the center of the room as if they are positioned for display.
168
+ Transform the surface of [PLATFORM0] into an art installation by arranging the scattered [SUB-PLATFORM-OBJECTS00] into an intricate geometric pattern.
169
+ On the top layer of [PLATFORM0], gather all loose [SUB-PLATFORM-OBJECTS00] and store them in a designated [SUB-PLATFORM-OBJECTS01] to ensure neatness.
170
+ Optimize shelving layout of [ALL_LAYERS] on [MULTILAYER-OBJECT0].
171
+ Sort [SUB-PLATFORM-CATEGORY-OBJECT00] on [PLATFORM0] into color-coded sections.
172
+ Create a symmetrical pattern using [SUB-PLATFORM-OBJECTS00] on top of [PLATFORM0].
173
+ Optimize the arrangement of [SUB-PLATFORM-OBJECTS00] on [PLATFORM0], aligning them in a symmetrical pattern for a clean and organized appearance.
174
+ Set up an instructional display on [PLATFORM0] by arranging [SUB-PLATFORM-OBJECTS00] for an engaging demonstration.
175
+ Rearrange the items on [PLATFORM0] to create a harmonious display, grouping similar items together and ensuring a visually balanced arrangement.
176
+ Align all [SUB-PLATFORM-OBJECTS00] on [PLATFORM0] into a clean, linear formation with the labels facing outward to create a neat and uniform appearance.
177
+ Organize the objects on top of [PLATFORM0] into a "jigsaw puzzle" pattern, with each object fitting together perfectly.
178
+ Reconfigure the setup of [PLATFORM0], [PLATFORM1], and [PLATFORM2] to optimize for a multi-step workflow. Arrange the objects on [PLATFORM0] to facilitate easy handover to [PLATFORM1], and then to [PLATFORM2].
179
+ Group similar items on [PLATFORM0] and create an organized system where each category of objects has a designated area.
180
+ Reconfigure the items on [PLATFORM0] to establish a central focal point for [SUB-PLATFORM-SINGLE-OBJECT00].
181
+ Design a geometric pattern using [SUB-PLATFORM-OBJECTS00] on the top of [PLATFORM0], with the pattern extending to cover the entire surface.
182
+ Enhance the overall visual aesthetics of [PLATFORM0] by removing all clutter and arranging the [SUB-PLATFORM-OBJECTS00] into a geometric pattern.
183
+ Adjust the positioning of objects on [MULTILAYER-OBJECT0] so that each shelf has an equal distribution of weight and aesthetics, focusing on creating symmetry with [SUB-LAYER-OBJECTS00].
184
+ Design a "garden" on [PLATFORM0] by arranging objects to resemble flowers and trees.
185
+ Remove all [SUB-PLATFORM-OBJECTS00] from [PLATFORM0] and arrange them neatly on [PLATFORM1].
186
+ Move the [SUB-PLATFORM-OBJECTS00] from the right side of [PLATFORM0] and place it on the left.
187
+ Group objects on the [SPECIFIC-LAYER] of [MULTILAYER-OBJECT0] by color and arrange them from darkest to lightest, ensuring equal spacing.
188
+ Reconfigure the objects on [PLATFORM0] to create a functional mini-laboratory setup.
189
+ Reorganize the contents of [MULTILAYER-OBJECT0] such that all items related to [SUB-LAYER-OBJECTS00] are grouped together on the top shelf, while [SUB-LAYER-OBJECTS01] and [SUB-LAYER-OBJECTS02] are arranged on the lower shelves, ensuring a balanced and orderly presentation.
190
+ Design a "bridge" on [PLATFORM0] by arranging objects to create a sturdy structure.
191
+ Organize the objects on top of [PLATFORM0] into a symmetrical pattern, with identical pairs on either side of a central axis.
192
+ Organize [SUB-PLATFORM-OBJECTS00] on [MULTILAYER-OBJECT0] alphabetically by title on the top shelf, ensuring a visually balanced distribution.
193
+ Curate a gallery of inspiration by arranging [SUB-PLATFORM-OBJECTS00] found on [PLATFORM0] into an organized display.
194
+ Clear the top of [PLATFORM0] of any objects and then arrange the [SUB-PLATFORM-SINGLE-OBJECTS00], [SUB-PLATFORM-SINGLE-OBJECTS01], and [SUB-PLATFORM-SINGLE-OBJECTS02] in a harmonious triangle formation.
195
+ Reorganize the [SUB-PLATFORM-OBJECTS00] on [PLATFORM0] into a custom, modular storage system that maximizes space and facilitates quick retrieval.
196
+ On [PLATFORM0], arrange a collection of seasonal decorations, ensuring that the items complement each other and create a festive atmosphere.
197
+ Sort all [SUB-PLATFORM-CATEGORY-OBJECT00] on [PLATFORM0] by size and color, placing the largest and most colorful items in a prominent spot.
198
+ Create a neat arrangement of [SUB-PLATFORM-OBJECTS00] on [PLATFORM0].
199
+ Optimize the top of [PLATFORM0] by clearing it of all unnecessary items and arranging the remaining [SUB-PLATFORM-CATEGORY-OBJECTS00], [SUB-PLATFORM-CATEGORY-OBJECTS01], and [SUB-PLATFORM-CATEGORY-OBJECTS02] into neatly defined zones for improved functionality and aesthetics.
200
+ Set up [PLATFORM0] with a mini workspace on one side and a relaxation corner on the other, using [SUB-PLATFORM-OBJECTS00] and [SUB-PLATFORM-OBJECTS01].
data/templates/reflection_prompts.json ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "partial_score": {
3
+ "prompt_type": "partial_score",
4
+ "required_variables": [
5
+ "action_list",
6
+ "correct_state_list",
7
+ "failed_state_list"
8
+ ],
9
+ "content": "In your first {action_list} operations, you successfully completed {correct_state_list} actions, however you failed to complete {failed_state_list} actions.\n\n"
10
+ },
11
+ "one_possible_correct_answer": {
12
+ "prompt_type": "one_possible_correct_answer",
13
+ "required_variables": ["failed_state_list", "solution_list"],
14
+ "content": "To complete the operations in {failed_state_list}, one possible solution is as follows: {solution_list}.\n\n"
15
+ },
16
+
17
+ "action_reason": {
18
+ "pick_up_object": {
19
+ "prompt_type": "pick_up_object",
20
+ "required_variables": ["object_name", "object_idx"],
21
+ "content": "From the available images, we can identify that {object_name} is object #{object_idx}. So, we need to select action 'pick_up_object_{object_idx}_of_current_platform'\n\n"
22
+ },
23
+ "goto_platform": {
24
+ "prompt_type": "goto_platform",
25
+ "required_variables": ["platform_name"],
26
+ "content": "Based on the initial position information and action space provided by the system, we can recognize that now you need to go to {platform_name} with action 'goto_{platform_name}'.\n\n"
27
+ },
28
+ "rotate_observation_view": {
29
+ "prompt_type": "rotate_observation_view",
30
+ "required_variables": ["direction"],
31
+ "content": "The existing view may not be the optimal angle or may not align with the position of the target object at the beginning of the task, which may intervere our judgement. Therefore, we can try to rotate the viewing angle with action 'rotate_observation_view_of_current_platform';.\n\n"
32
+ },
33
+ "show_freespace_of_object": {
34
+ "prompt_type": "show_freespace_of_object",
35
+ "required_variables": [
36
+ "object_name",
37
+ "object_idx",
38
+ "adjacent_object_name_list",
39
+ "adjacent_object_idx_list"
40
+ ],
41
+ "content": "Given that the task requires placing an item in a location related to {object_name}, and from the existing images we can see that {object_name} is object #{object_idx}, we need to observe its free space. Additionally, we can see {adjacent_object_name_list}, numbered as {adjacent_object_idx_list}, which are also around {object_name}. If we find that the free space of the task object is not large enough, we can also check their free spaces and consider choosing appropriate areas among them.\n\n"
42
+ },
43
+
44
+ "place_object": {
45
+ "prompt_type": "place_object",
46
+ "required_variables": ["placement_type", "freespace_list"],
47
+ "placement_type": {
48
+ "middle_of_2_objects": {
49
+ "prompt_type": "middle",
50
+ "required_variables": [
51
+ "object_name_a",
52
+ "object_name_b",
53
+ "object_idx_a",
54
+ "object_idx_b",
55
+ "adjacent_object_name_list",
56
+ "adjacent_object_idx_list"
57
+ ],
58
+ "content": "To complete the task, you need to place the object between {object_name_a} and {object_name_b}; From the given platform image and the freespace image, we can recognize that they are #{object_idx_a} and #{object_idx_b} on the platform, and the free space between them is {freespace_list}, so you should choose 'place_at_freespace_{freespace_list}' to place the object there. If it doesn't fit, you can try to combine more freespace regions from these two objects; further more, around your chosen area, there are {adjacent_object_name_list}, numbered as {adjacent_object_idx_list}, and you can also try to combine their free spaces that are close to the target area with the current choice. \n\n"
59
+ },
60
+ "around_object": {
61
+ "prompt_type": "around_object",
62
+ "required_variables": [
63
+ "object_name",
64
+ "object_idx",
65
+ "adjacent_object_name_list",
66
+ "adjacent_object_idx_list"
67
+ ],
68
+ "content": "To complete the task, you need to place the object around {object_name}. From the images, we can recognize that this object is #{object_idx}, and its free space numbers are {freespace_list}, so you should choose 'place_at_freespace_{freespace_list}' to place the object within its collection of free spaces. If it doesn't fit, around your chosen area, there are {adjacent_object_name_list}, numbered as {adjacent_object_idx_list}, and you can also try to combine their free spaces that are close to the target area with the current choice.\n\n"
69
+ },
70
+ "on_platform": {
71
+ "prompt_type": "around",
72
+ "required_variables": [
73
+ "object_name",
74
+ "object_idx",
75
+ "adjacent_object_name_list",
76
+ "adjacent_object_idx_list"
77
+ ],
78
+ "content": "To complete the task, you need to place the object around {object_name}. From the images, we can recognize that this object is #{object_idx}, and its free space numbers are {freespace_list}, so you should choose 'place_at_freespace_{freespace_list}' to place the object within its collection of free spaces. If it doesn't fit, around your chosen area, there are {adjacent_object_name_list}, numbered as {adjacent_object_idx_list}, and you can also try to combine their free spaces that are close to the target area with the current choice.\n\n"
79
+ },
80
+ "on_platform_dir_cardinal": {
81
+ "required_variables": [
82
+ "platform_name",
83
+ "direction",
84
+ "direction_idx",
85
+ "extending_direction_cardinal_list",
86
+ "more_extending_direction_cardinal_list"
87
+ ],
88
+ "content": "To complete the task, you need to place the object in the {direction} direction of {platform_name}. From the given platform image and the freespace image, the free space number in the {direction} direction is {object_idx}, so you should choose 'place_at_freespace_{freespace_list}' to place the object in this direction. If it doesn't fit, you can also choose {extending_direction_list} or {more_extending_direction_list}, combining free spaces adjacent to the {direction} direction and collectively in the {direction} direction of the platform.\n\n"
89
+ },
90
+ "on_platform_dir_diagonal": {
91
+ "required_variables": [
92
+ "platform_name",
93
+ "direction",
94
+ "direction_idx",
95
+ "extending_direction_diagonal_list"
96
+ ],
97
+ "content": "To complete the task, you need to place the object in the {direction} direction of {platform_name}. From the given platform image, we can recognize that the free space number in the {direction} direction is {object_idx}, so you should choose 'place_at_freespace_{freespace_list}' to place the object in this direction. If it doesn't fit, you can also choose {extending_direction_list}, combining free spaces adjacent to the {direction} direction and collectively in the {direction} direction of the platform.\n\n"
98
+ },
99
+ "direction_of_object": {
100
+ "required_variables": [
101
+ "object_name",
102
+ "object_idx",
103
+ "adjacent_object_name_list",
104
+ "adjacent_object_idx_list",
105
+ "adjacent_direction_list"
106
+ ],
107
+ "content": "To complete the task, you need to place the object in the {direction} direction of {object_name}. From the given platform image, this object has ID {object_idx}, and the free space in this direction is {freespace_list}, so you should choose 'place_at_freespace_{freespace_list}' to place the object in this direction. If it doesn't fit, you can consider combining free spaces from adjacent directions ({adjacent_direction_list}). Additionally, around your chosen area, there are {adjacent_object_name_list}, numbered as {adjacent_object_idx_list}, and you can also try to combine their free spaces that are close to the target area.\n\n"
108
+ }
109
+ }
110
+ }
111
+ },
112
+ "image_description": {
113
+ "template": {
114
+ "required_variables": ["n_image", "image_name_list"],
115
+ "content": "Here are {n_image} images, named {image_name_list} respectively.\n\nTheir description is as follows: {image_description}"
116
+ },
117
+ "variants": {
118
+ "show_freespace_of_object": {
119
+ "required_variables": ["image_name", "object_idx", "freespace_num"],
120
+ "shared_variables": ["object_idx"],
121
+ "content": "This image shows the available free spaces around object {object_idx} on the platform, you see this because you've taken \"show_freespace\" action previously. The numbers from 1 to {freespace_num} indicate the available free spaces. Not all numbers from 1 to 8 may be present, as some free spaces might be too small or blocked. To use the numbers shown in the image to specify where you want to place the object you are holding, you can include ({object_idx}, {freespace_idx} (freespace_idx in [1, {freespace_num}]) in the output action.\n\n"
122
+ },
123
+ "show_platform": {
124
+ "required_variables": ["image_name"],
125
+ "shared_variables": ["platform_name"],
126
+ "content": "This image shows the platform you are currently on in one view, with regions or objects marked with numbers for you to place objects accurately. The platform is {platform_name}.\n\nIf the platform has no objects, a 3x3 grid will be marked on the platform to help you place objects, with each grid marked in numbers from 1 to 9. If there are objects on the platform, guiding lines will indicate the object numbers. Note that if you see multiple images, it means the platform is too long to be captured in one image, and it's guaranteed that the same object will marked in THE SAME COLOR GUILDLINES AND THE SAME NUMBER. If you think you can't determine the number of an item in one picture, you can go through other pictures and see if this item is marked more clearly.\n\n"
127
+ }
128
+ }
129
+ },
130
+ "action_description_with_image": {
131
+ "prompt_type": "image_description",
132
+ "required_variables": [
133
+ "image_name_list",
134
+ "action_name",
135
+ "image_list_reason",
136
+ "action_reason"
137
+ ],
138
+ "content": "At this point, we can see images such as {image_name_list}, because {image_list_reason}; and you should choose {action_name}. The reason for choosing this action is {action_reason}.\n\n"
139
+ },
140
+
141
+ "hints": {
142
+ "no_rotate_hint": {
143
+ "prompt_type": "no_rotate_hint",
144
+ "required_variables": [],
145
+ "content": "You don't seem to have tried using the 'rotate_observation_view_of_current_platform' action to rotate the viewing angle. Please learn to use it effectively to avoid observing objects from non-frontal angles, which can result in a suboptimal view that could be improved.\n\n"
146
+ },
147
+ "attempted_place_repeatedly_at_beginning_hint": {
148
+ "prompt_type": "attempted_place_repeatedly_at_beginning_hint",
149
+ "required_variables": ["action_list"],
150
+ "content": "You made multiple placement attempts at the starting platform through {action_list}. This is commendable, indicating that you're trying to pick up the correct object. However, if you tried too many times, you can also use 'show_freespace_of_object_x' to clearly see the placement space of object #x, which can indirectly confirm whether this object is what you want.\n\n"
151
+ },
152
+ "attempted_place_repeatedly_at_end_with_correct_item_hint": {
153
+ "prompt_type": "attempted_place_repeatedly_at_end_correct_hint",
154
+ "required_variables": ["action_list"],
155
+ "content": "After picking up the correct object, you made multiple placement attempts at the destination platform through {action_list}. This is commendable, suggesting you may have noticed issues with the placement. However, the images obtained from the 'show_freespace_of_object_x' command can help you determine what object #x is, which might allow you to identify it more quickly.\n\n"
156
+ },
157
+ "attempted_place_repeatedly_at_end_with_wrong_item_hint": {
158
+ "prompt_type": "attempted_place_repeatedly_at_end_wrong_hint",
159
+ "required_variables": ["action_list"],
160
+ "content": "After picking up the wrong object, you made multiple placement attempts at the destination platform through {action_list}. This is commendable, indicating that you recognize you've picked up the wrong object; however, since the destination platform may not have space to place the incorrect object you're holding, your operations might be in vain. You might instead try these operations at the starting platform instead.\n\n"
161
+ },
162
+ "attempted_place_before_look_hint": {
163
+ "prompt_type": "attempted_place_before_look_hint",
164
+ "required_variables": ["action_list"],
165
+ "content": "You made multiple placement attempts before have a look at the object's freespace. However, you can also use 'show_freespace_of_object_x' to clearly see the placement space of object #x, which can indirectly confirm whether this object is what you want.\n\n"
166
+ },
167
+ "too_much_invalid_action_hint": {
168
+ "prompt_type": "too_much_invalid_action_hint",
169
+ "required_variables": [],
170
+ "content": "You've output too many invalid actions. Please don't attempt to print your thought process, explanations, or apologies, as they won't be recognized by the system. If you believe your output is a correct instruction, please carefully observe your current action space. Note that you can only pick up one object at a time, and the methods for placing on empty platforms versus occupied platforms with objects are different.\n\n"
171
+ }
172
+ }
173
+ }
data/templates/renaming_engine.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task_config": {
3
+ "system_prompt": "You are a professional item classification and naming assistant. You need to provide a unique and meaningful name for each item based on indoor object images.",
4
+ "user_prompt": "I need your help to classify and rename a series of indoor object images. Each image contains an item to be named, marked with a white cubic box. Please follow these requirements:\n\n1. Naming Rules:\n- Each item name must be unique\n- Names should reflect the item's category and characteristics\n- Use English naming format '{category}_{specific_name}', no non-alphabetic characters allowed\n\n2. Naming Examples:\n- A red mug -> kitchenware_red_mug\n- A textbook -> book_textbook\n- A desk lamp -> electronics_desk_lamp\n\nPlease review the images and provide standardized names according to the above rules. The following images are the items to be classified, one item per image.\n",
5
+ "per_pic_prompt": "The provided image contains an item, probably be placed on some table platform, waited to be rename. Note that we want you to rename the item should be some item on a platform, so you need to distinguish it with its containing object (e.g. table, shoe rack, wall cabinet etc.) Please provide a UNIQUE name for the item in the image. Follow the naming rules and classification guidelines provided in the system prompt. Your response should be a single line, the new name, with '_' concating different words, e.g.'utensil_white_soap_dispenser' (without quotes).Don't include redundant characters, don't include characters other than alphabets and underlines, and don't coincide with any previous name you've given in the context. \n",
6
+ "temperature": 0.2,
7
+ "max_tokens": 500
8
+ },
9
+ "file_config": {
10
+ "input_dir": "dataset/original",
11
+ "output_dir": "dataset/renamed",
12
+ "supported_formats": [".jpg", ".jpeg", ".png"],
13
+ "log_file": "rename_mapping.json"
14
+ },
15
+ "model_config": {
16
+ "model": "GPT4o",
17
+ "api_key": "${ANTHROPIC_API_KEY}"
18
+ }
19
+ }
data/templates/voting_prompts.json ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "system_prompt": {
3
+ "required_variables": [
4
+ "task_description",
5
+ "platform_name_list",
6
+ "multilayer_object_name_list"
7
+ ],
8
+ "info": "Main system prompt for task feasibility evaluation",
9
+ "content": "Please evaluate the feasibility of the following task:\n\nTask: {task_description}\n\nWe want to evaluate if the given task is feasible for such a robot: Its ability involves: navigate, pick up any objects and place objects anywhere fitable on the platform.\n\nI'll provide images of relevant platforms and objects. Based on these images, please assess whether this task can be completed successfully.\n\nAssessment criteria:\n1. Are all required objects present in the scene?\n2. Is there sufficient free space on the target platform for placement?\n3. Are the spatial relationships between objects as required by the task achievable?\n4. Would completing the task create any unstable or physically impossible arrangements?\n\nPlease only output a single line: \"Feasible\", \"Partially feasible\", or \"Not feasible\" based on the task's feasibility.\n\nExplanation is not required.\n\nThis task involves the following platforms and multilayer objects:\n\nplatform: {platform_name_list}\nmultilayer object: {multilayer_object_name_list}\n\nTheir pictures are as follows:"
10
+ },
11
+ "platform_introduction": {
12
+ "required_variables": ["platform_name", "child_name_list", "image_count"],
13
+ "info": "Introduction text for platform images",
14
+ "content": "This image(s) show the platform {platform_name} (in different view angles), with the items on it are marked with colored number circles and guidelines. The items are: {child_name_list}"
15
+ },
16
+ "multilayer_introduction": {
17
+ "required_variables": [],
18
+ "info": "Introduction text for multilayer object images",
19
+ "content": "The following images show each layer of the multilayer object, with the items on it are marked with colored number circles and guidelines."
20
+ },
21
+ "multilayer_layer_description": {
22
+ "required_variables": ["platform_name", "child_name_list", "is_top_layer"],
23
+ "info": "Description for each layer of multilayer object",
24
+ "content": "This image shows the platform {platform_name}, with the items on it are marked with colored number circles and guidelines. {is_top_layer} The items are: {child_name_list}"
25
+ },
26
+
27
+ "outcome_based_task_evaluation": {
28
+ "system_prompt_template": {
29
+ "prompt_type": "task_feasibility_evaluation",
30
+ "required_variables": [
31
+ "task_description",
32
+ "platform_name",
33
+ "multilayer_object_name"
34
+ ],
35
+ "content": "Please evaluate the feasibility of the following task:\n\nTask: {task_description}\n\nWe want to evaluate if the given task is feasible for such a robot: Its ability involves: navigate, pick up any objects and place objects anywhere fitable on the platform.\n\nI'll provide images of relevant platforms and objects. Based on these images, please assess whether this task can be completed successfully.\n\nAssessment criteria:\n1. Are all required objects present in the scene?\n2. Is there sufficient free space on the target platform for placement?\n3. Are the spatial relationships between objects as required by the task achievable?\n4. Would completing the task create any unstable or physically impossible arrangements?\n\nPlease only output a single line: \"Feasible\", \"Partially feasible\", or \"Not feasible\" based on the task's feasibility.\n\nExplanation is not required.\n\nThis task involves the following platforms and multilayer objects:\n\nplatform: {platform_name}\nmultilayer object: {multilayer_object_name}\n\nTheir pictures are as follows:"
36
+ },
37
+
38
+ "platform_description_template": {
39
+ "prompt_type": "platform_description",
40
+ "required_variables": [
41
+ "platform_name",
42
+ "child_name_list",
43
+ "n_platform_img_list"
44
+ ],
45
+ "content": "This image(s) show the platform{platform_name} (in different view angles), with the items on it are marked with colored number circles and guidlines. the items are: {child_name_list}"
46
+ },
47
+
48
+ "multilayer_object_intro": {
49
+ "prompt_type": "multilayer_object_intro",
50
+ "required_variables": [],
51
+ "content": "The following images show each layer of the multilayer object, with the items on it are marked with colored number circles and guidlines."
52
+ },
53
+
54
+ "multilayer_platform_description_template": {
55
+ "prompt_type": "multilayer_platform_description",
56
+ "required_variables": [
57
+ "platform_name",
58
+ "child_name_list",
59
+ "is_top_layer"
60
+ ],
61
+ "content": "This image shows the platform{platform_name}, with the items on it are marked with colored number circles and guidlines. {is_top_layer}. the items are: {child_name_list}"
62
+ }
63
+ },
64
+
65
+ "image_generation_config": {
66
+ "view_settings": {
67
+ "view": "human_full",
68
+ "mark_object": true,
69
+ "mark_freespace": false,
70
+ "focus_ratio": 0.6
71
+ },
72
+ "file_naming": {
73
+ "single_image": "{save_path}{platform_name}.png",
74
+ "multiple_images": "{save_path}{platform_name}_{image_index}_out_of_{total_images}.png"
75
+ }
76
+ },
77
+
78
+ "response_format": {
79
+ "expected_responses": ["Feasible", "Partially feasible", "Not feasible"],
80
+ "output_format": "single_line_only",
81
+ "explanation_required": false
82
+ },
83
+
84
+ "task_components": {
85
+ "platform_reference": "PLATFORM0",
86
+ "multilayer_object_reference": "MULTILAYER-OBJECT0",
87
+ "layer_indicator": {
88
+ "top_layer_text": "And this is the top layer.",
89
+ "other_layer_text": ""
90
+ }
91
+ }
92
+ }
demo/app.py ADDED
@@ -0,0 +1,292 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ ManiTaskGen — first public demo (Gradio, no VLM, CPU-only).
3
+
4
+ Visitors can:
5
+ - click "Try the built-in example", or
6
+ - upload their own scene pack (`scene.zip`, Habitat/ReplicaCAD-style layout),
7
+
8
+ and get process-based tasks + outcome-based task candidates generated by the
9
+ original ManiTaskGen generators. No API key is required and no VLM is called:
10
+ outcome candidates are exported with `voting_status: "not_run"`.
11
+
12
+ Launch from the repository root:
13
+ python demo/app.py
14
+ """
15
+
16
+ import os
17
+ import sys
18
+ import time
19
+ import shutil
20
+ import uuid
21
+
22
+ DEMO_DIR = os.path.dirname(os.path.abspath(__file__))
23
+ REPO_ROOT = os.path.dirname(DEMO_DIR)
24
+ sys.path.insert(0, REPO_ROOT)
25
+ sys.path.insert(0, DEMO_DIR)
26
+ os.chdir(REPO_ROOT) # mesh paths inside packs are resolved against CWD
27
+
28
+ import gradio as gr # noqa: E402
29
+
30
+ import pipeline # noqa: E402
31
+ from pipeline import ( # noqa: E402
32
+ BUILTIN_ENTRY,
33
+ generate_builtin,
34
+ generate_from_pack,
35
+ )
36
+ from scene_pack import ( # noqa: E402
37
+ ScenePackError,
38
+ check_pack_assets,
39
+ extract_zip,
40
+ find_entry_scene,
41
+ scene_id_from_entry,
42
+ )
43
+
44
+ EXAMPLE_ZIP = os.path.join(DEMO_DIR, "assets", "example_scene.zip")
45
+ UPLOAD_ROOT = os.path.join(REPO_ROOT, "output", "demo_uploads")
46
+ MAX_DISPLAY = 5 # max tasks shown per category in the UI
47
+
48
+ TITLE = "# ManiTaskGen · Task Generation Demo"
49
+ DESCRIPTION = (
50
+ "Upload a scene pack (or try the built-in example) and ManiTaskGen "
51
+ "generates **process-based tasks** (step-by-step move instructions) and "
52
+ "**outcome-based task candidates** (goal-state instructions from "
53
+ "ManiTaskOT-200 templates).\n\n"
54
+ "🔒 **No API key needed · no VLM is called · runs on free CPU** — "
55
+ "candidates are shown *unvoted* (`voting_status: not_run`)."
56
+ )
57
+
58
+
59
+ # ---------------------------------------------------------------------------
60
+ # Formatting helpers
61
+ # ---------------------------------------------------------------------------
62
+
63
+ def format_process_md(records) -> str:
64
+ if not records:
65
+ return "_No process-based tasks could be generated for this scene._"
66
+ lines = []
67
+ for i, rec in enumerate(records[:MAX_DISPLAY], 1):
68
+ lines.append(f"**{i}.** {rec['instruction']}")
69
+ if rec.get("goal"):
70
+ lines.append(f" &nbsp;&nbsp;🎯 goal: `{rec['goal'][0]}`")
71
+ ents = rec.get("entities") or {}
72
+ items = ", ".join(ents.get("items", []))
73
+ dests = ", ".join(ents.get("destinations", []))
74
+ if items or dests:
75
+ lines.append(
76
+ f" &nbsp;&nbsp;📦 objects: {items or '—'} · "
77
+ f"surfaces: {dests or '—'}"
78
+ )
79
+ if len(records) > MAX_DISPLAY:
80
+ lines.append(f"\n*… {len(records) - MAX_DISPLAY} more in the download.*")
81
+ return "\n".join(lines)
82
+
83
+
84
+ def format_outcome_md(records) -> str:
85
+ if not records:
86
+ return (
87
+ "_No outcome-based templates could be bound to this scene. "
88
+ "Outcome tasks need platforms with objects on them; categories "
89
+ "come from object names before the first `_` (e.g. `book_red_0` "
90
+ "→ book)._"
91
+ )
92
+ lines = []
93
+ for i, rec in enumerate(records[:MAX_DISPLAY], 1):
94
+ ents = rec.get("bound_entities") or {}
95
+ surfaces = ", ".join(ents.get("platforms", []))
96
+ layers = ", ".join(ents.get("multilayer_objects", []))
97
+ lines.append(f"**{i}.** {rec['instruction']}")
98
+ meta = []
99
+ if rec.get("pattern_id") is not None:
100
+ meta.append(f"template #{rec['pattern_id']}")
101
+ if surfaces:
102
+ meta.append(f"platforms: {surfaces}")
103
+ if layers:
104
+ meta.append(f"multilayer: {layers}")
105
+ meta.append("voting: not run")
106
+ if meta:
107
+ lines.append(f" &nbsp;&nbsp;🔎 {' · '.join(meta)}")
108
+ if len(records) > MAX_DISPLAY:
109
+ lines.append(f"\n*… {len(records) - MAX_DISPLAY} more in the download.*")
110
+ return "\n".join(lines)
111
+
112
+
113
+ def _cleanup_old_uploads(keep=20):
114
+ try:
115
+ if not os.path.isdir(UPLOAD_ROOT):
116
+ return
117
+ dirs = sorted(
118
+ (os.path.join(UPLOAD_ROOT, d) for d in os.listdir(UPLOAD_ROOT)),
119
+ key=os.path.getmtime,
120
+ )
121
+ for old in dirs[:-keep]:
122
+ shutil.rmtree(old, ignore_errors=True)
123
+ except Exception:
124
+ pass
125
+
126
+
127
+ # ---------------------------------------------------------------------------
128
+ # Gradio handlers
129
+ # ---------------------------------------------------------------------------
130
+
131
+ def _finish(result, t_start) -> tuple:
132
+ status = [
133
+ f"✅ **Done in {time.perf_counter() - t_start:.1f}s** "
134
+ f"(scene: `{result.scene_id}`, source: {result.source})",
135
+ f"- Process-based tasks: **{len(result.process_tasks)}** "
136
+ f"(generated in {result.timings.get('process_based', '?')}s)",
137
+ f"- Outcome-based candidates: **{len(result.outcome_candidates)}** "
138
+ f"(generated in {result.timings.get('outcome_based', '?')}s, no VLM voting)",
139
+ ]
140
+ for w in result.warnings:
141
+ status.append(f"- ⚠️ {w}")
142
+ return (
143
+ "\n".join(status),
144
+ format_process_md(result.process_tasks),
145
+ format_outcome_md(result.outcome_candidates),
146
+ result.jsonl_path,
147
+ )
148
+
149
+
150
+ def on_generate_builtin(max_process_tasks, process_task_length, outcome_per_pattern):
151
+ t0 = time.perf_counter()
152
+ try:
153
+ result = generate_builtin(
154
+ max_process_tasks=int(max_process_tasks),
155
+ process_task_length=int(process_task_length),
156
+ outcome_per_pattern=int(outcome_per_pattern),
157
+ )
158
+ except Exception as e: # surfacing real errors to visitors
159
+ raise gr.Error(f"Generation failed: {e}")
160
+ return _finish(result, t0)
161
+
162
+
163
+ def on_generate_upload(file, max_process_tasks, process_task_length, outcome_per_pattern):
164
+ t0 = time.perf_counter()
165
+ if file is None:
166
+ raise gr.Error("Please upload a scene.zip first, or try the built-in example.")
167
+ upload_path = file if isinstance(file, str) else file.name
168
+ run_id = uuid.uuid4().hex[:12]
169
+ work_dir = os.path.join(UPLOAD_ROOT, run_id)
170
+ os.makedirs(work_dir, exist_ok=True)
171
+ try:
172
+ pack_dir = extract_zip(upload_path, os.path.join(work_dir, "unpacked"))
173
+ entry = find_entry_scene(pack_dir)
174
+ check_pack_assets(pack_dir, entry)
175
+ result = generate_from_pack(
176
+ pack_dir,
177
+ entry,
178
+ work_dir=os.path.join(work_dir, "run"),
179
+ max_process_tasks=int(max_process_tasks),
180
+ process_task_length=int(process_task_length),
181
+ outcome_per_pattern=int(outcome_per_pattern),
182
+ )
183
+ except ScenePackError as e:
184
+ raise gr.Error(f"Invalid scene pack: {e}")
185
+ except FileNotFoundError as e:
186
+ raise gr.Error(f"Missing asset in scene pack: {e}")
187
+ except Exception as e:
188
+ raise gr.Error(f"Generation failed: {e}")
189
+ finally:
190
+ _cleanup_old_uploads()
191
+ return _finish(result, t0)
192
+
193
+
194
+ # ---------------------------------------------------------------------------
195
+ # UI
196
+ # ---------------------------------------------------------------------------
197
+
198
+ def build_ui():
199
+ with gr.Blocks(title="ManiTaskGen Demo") as ui:
200
+ gr.Markdown(TITLE)
201
+ gr.Markdown(DESCRIPTION)
202
+
203
+ with gr.Row():
204
+ with gr.Column(scale=1):
205
+ gr.Markdown("### 1 · Choose a scene")
206
+ with gr.Accordion("Use your own scene", open=True):
207
+ upload = gr.File(
208
+ label="Upload scene.zip (Habitat/ReplicaCAD-style pack)",
209
+ file_types=[".zip"],
210
+ type="filepath",
211
+ )
212
+ gr.Markdown(
213
+ "The ZIP should contain a `*.scene_instance.json` "
214
+ "(e.g. `configs/scenes/...`), its meshes and configs — "
215
+ "see the pack format in the README."
216
+ )
217
+ with gr.Accordion("Built-in example", open=False):
218
+ gr.Markdown(
219
+ "A small synthetic 'demo studio' (desk, low table, "
220
+ "3-layer shelf, counter + 12 small items). Tiny, "
221
+ "license-free, great for a first try."
222
+ )
223
+ example_zip = gr.File(
224
+ label="Download example_scene.zip",
225
+ value=EXAMPLE_ZIP,
226
+ interactive=False,
227
+ )
228
+ builtin_btn = gr.Button("✨ Try the built-in example", variant="primary")
229
+
230
+ with gr.Accordion("Generation options", open=False):
231
+ max_process_tasks = gr.Slider(
232
+ 5, 50, value=20, step=1,
233
+ label="Process-based tasks to generate",
234
+ )
235
+ process_task_length = gr.Slider(
236
+ 1, 5, value=3, step=1,
237
+ label="Max steps per process task",
238
+ )
239
+ outcome_per_pattern = gr.Slider(
240
+ 1, 5, value=3, step=1,
241
+ label="Outcome candidates per template",
242
+ )
243
+ upload_btn = gr.Button("🚀 Generate from my scene.zip", variant="primary")
244
+
245
+ with gr.Column(scale=2):
246
+ gr.Markdown("### 2 · Results")
247
+ status_md = gr.Markdown("Waiting for a scene…")
248
+ with gr.Group():
249
+ gr.Markdown("#### 📋 Process-based tasks (step-by-step)")
250
+ process_md = gr.Markdown("_Not generated yet._")
251
+ with gr.Group():
252
+ gr.Markdown(
253
+ "#### 🎯 Outcome-based task candidates · No VLM voting"
254
+ )
255
+ outcome_md = gr.Markdown("_Not generated yet._")
256
+ jsonl_out = gr.File(label="Download results (tasks.jsonl)")
257
+
258
+ builtin_btn.click(
259
+ on_generate_builtin,
260
+ inputs=[max_process_tasks, process_task_length, outcome_per_pattern],
261
+ outputs=[status_md, process_md, outcome_md, jsonl_out],
262
+ )
263
+ upload_btn.click(
264
+ on_generate_upload,
265
+ inputs=[upload, max_process_tasks, process_task_length, outcome_per_pattern],
266
+ outputs=[status_md, process_md, outcome_md, jsonl_out],
267
+ )
268
+
269
+ gr.Markdown(
270
+ "Docs: pack format & how to modify a scene → see repository README "
271
+ "(demo section). Process tasks reuse the ManiTaskGen scene-graph "
272
+ "planner; outcome candidates instantiate ManiTaskOT-200 templates "
273
+ "on the scene graph. Both run fully offline."
274
+ )
275
+ return ui
276
+
277
+
278
+ def main():
279
+ # Pre-build the built-in scene graph once so the first click is fast.
280
+ try:
281
+ pipeline._get_builtin_graph()
282
+ except Exception as e:
283
+ print(f"[demo] warning: failed to pre-build built-in graph: {e}")
284
+ build_ui().queue(max_size=8).launch(
285
+ server_name="0.0.0.0",
286
+ server_port=int(os.environ.get("GRADIO_SERVER_PORT", "7860")),
287
+ show_error=True,
288
+ )
289
+
290
+
291
+ if __name__ == "__main__":
292
+ main()
demo/assets/example_scene.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e842776486e9062dcd268f6bf552ff7589216c6b3bf67dc149e7ca9fb96b03e5
3
+ size 17521
demo/assets/example_scene/README.md ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Demo Studio scene pack
2
+
3
+ ManiTaskGen scene pack (Habitat/ReplicaCAD-style layout, primitive geometry,
4
+ freely redistributable).
5
+
6
+ - Entry scene file: `configs/scenes/demo_studio.scene_instance.json`
7
+ - Stage/background mesh: `stages/demo_room.glb` (8m x 8m floor slab)
8
+ - Object meshes: `objects/<template>.glb`
9
+ - Per-template configs: `configs/objects/<template>.object_config.json`
10
+
11
+ ## Coordinates
12
+
13
+ Positions in `scene_instance.json` follow the Habitat convention (Y-up,
14
+ rotation = quaternion [w, x, y, z]). Meshes are stored Y-up, matching
15
+ ReplicaCAD assets. The engine pipeline converts both to Z-up internally.
16
+
17
+ ## Structure
18
+
19
+ | Template | Kind | Placed at (engine x, y) | Notes |
20
+ | --- | --- | --- | --- |
21
+ | desk | table | (-1.5, -1.0) | top surface 0.75 m |
22
+ | table | low table | (0.0, 0.9) | top surface 0.45 m |
23
+ | shelf | bookshelf (3 boards) | (1.6, -1.2) | multilayer: 0.30/0.75/1.20 m |
24
+ | counter | solid block | (2.0, 1.5) | top surface 0.90 m |
25
+
26
+ Small items (laptop, book_red x3, book_blue, book_green, mug x2, bowl,
27
+ remote, cereal_box, plant_pot, toaster) are placed on top of the furniture.
28
+
29
+ ## How to modify and re-upload
30
+
31
+ 1. Unzip this archive.
32
+ 2. Move / remove / rename an object:
33
+ - edit its `translation` (Habitat coords) or delete its entry in
34
+ `configs/scenes/demo_studio.scene_instance.json`;
35
+ - if you delete a template, also delete `objects/<template>.glb` and
36
+ `configs/objects/<template>.object_config.json`.
37
+ 3. Re-zip the folder (keep the layout above) and upload the ZIP to the demo.
38
+
39
+ Tasks referencing a removed object will disappear; the remaining results
40
+ always reflect the uploaded scene.
demo/assets/example_scene/configs/objects/book_blue.object_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "render_asset": "../../objects/book_blue.glb",
3
+ "mass": 0.5,
4
+ "COM": [
5
+ 0,
6
+ 0,
7
+ 0
8
+ ],
9
+ "join_collision_meshes": false
10
+ }
demo/assets/example_scene/configs/objects/book_green.object_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "render_asset": "../../objects/book_green.glb",
3
+ "mass": 0.5,
4
+ "COM": [
5
+ 0,
6
+ 0,
7
+ 0
8
+ ],
9
+ "join_collision_meshes": false
10
+ }
demo/assets/example_scene/configs/objects/book_red.object_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "render_asset": "../../objects/book_red.glb",
3
+ "mass": 0.5,
4
+ "COM": [
5
+ 0,
6
+ 0,
7
+ 0
8
+ ],
9
+ "join_collision_meshes": false
10
+ }
demo/assets/example_scene/configs/objects/bowl.object_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "render_asset": "../../objects/bowl.glb",
3
+ "mass": 0.5,
4
+ "COM": [
5
+ 0,
6
+ 0,
7
+ 0
8
+ ],
9
+ "join_collision_meshes": false
10
+ }
demo/assets/example_scene/configs/objects/cereal_box.object_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "render_asset": "../../objects/cereal_box.glb",
3
+ "mass": 0.5,
4
+ "COM": [
5
+ 0,
6
+ 0,
7
+ 0
8
+ ],
9
+ "join_collision_meshes": false
10
+ }
demo/assets/example_scene/configs/objects/counter.object_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "render_asset": "../../objects/counter.glb",
3
+ "mass": 0.5,
4
+ "COM": [
5
+ 0,
6
+ 0,
7
+ 0
8
+ ],
9
+ "join_collision_meshes": false
10
+ }
demo/assets/example_scene/configs/objects/desk.object_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "render_asset": "../../objects/desk.glb",
3
+ "mass": 0.5,
4
+ "COM": [
5
+ 0,
6
+ 0,
7
+ 0
8
+ ],
9
+ "join_collision_meshes": false
10
+ }
demo/assets/example_scene/configs/objects/laptop.object_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "render_asset": "../../objects/laptop.glb",
3
+ "mass": 0.5,
4
+ "COM": [
5
+ 0,
6
+ 0,
7
+ 0
8
+ ],
9
+ "join_collision_meshes": false
10
+ }
demo/assets/example_scene/configs/objects/mug.object_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "render_asset": "../../objects/mug.glb",
3
+ "mass": 0.5,
4
+ "COM": [
5
+ 0,
6
+ 0,
7
+ 0
8
+ ],
9
+ "join_collision_meshes": false
10
+ }
demo/assets/example_scene/configs/objects/plant_pot.object_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "render_asset": "../../objects/plant_pot.glb",
3
+ "mass": 0.5,
4
+ "COM": [
5
+ 0,
6
+ 0,
7
+ 0
8
+ ],
9
+ "join_collision_meshes": false
10
+ }
demo/assets/example_scene/configs/objects/remote.object_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "render_asset": "../../objects/remote.glb",
3
+ "mass": 0.5,
4
+ "COM": [
5
+ 0,
6
+ 0,
7
+ 0
8
+ ],
9
+ "join_collision_meshes": false
10
+ }
demo/assets/example_scene/configs/objects/shelf.object_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "render_asset": "../../objects/shelf.glb",
3
+ "mass": 0.5,
4
+ "COM": [
5
+ 0,
6
+ 0,
7
+ 0
8
+ ],
9
+ "join_collision_meshes": false
10
+ }
demo/assets/example_scene/configs/objects/table.object_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "render_asset": "../../objects/table.glb",
3
+ "mass": 0.5,
4
+ "COM": [
5
+ 0,
6
+ 0,
7
+ 0
8
+ ],
9
+ "join_collision_meshes": false
10
+ }
demo/assets/example_scene/configs/objects/toaster.object_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "render_asset": "../../objects/toaster.glb",
3
+ "mass": 0.5,
4
+ "COM": [
5
+ 0,
6
+ 0,
7
+ 0
8
+ ],
9
+ "join_collision_meshes": false
10
+ }
demo/assets/example_scene/configs/scenes/demo_studio.scene_instance.json ADDED
@@ -0,0 +1,262 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "stage_instance": {
3
+ "template_name": "stages/demo_room"
4
+ },
5
+ "object_instances": [
6
+ {
7
+ "template_name": "objects/desk",
8
+ "motion_type": "STATIC",
9
+ "translation": [
10
+ -1.5,
11
+ 0.0,
12
+ 1.0
13
+ ],
14
+ "rotation": [
15
+ 1.0,
16
+ 0.0,
17
+ 0.0,
18
+ 0.0
19
+ ]
20
+ },
21
+ {
22
+ "template_name": "objects/table",
23
+ "motion_type": "STATIC",
24
+ "translation": [
25
+ 0.0,
26
+ 0.0,
27
+ -0.9
28
+ ],
29
+ "rotation": [
30
+ 1.0,
31
+ 0.0,
32
+ 0.0,
33
+ 0.0
34
+ ]
35
+ },
36
+ {
37
+ "template_name": "objects/shelf",
38
+ "motion_type": "STATIC",
39
+ "translation": [
40
+ 1.6,
41
+ 0.0,
42
+ 1.2
43
+ ],
44
+ "rotation": [
45
+ 1.0,
46
+ 0.0,
47
+ 0.0,
48
+ 0.0
49
+ ]
50
+ },
51
+ {
52
+ "template_name": "objects/counter",
53
+ "motion_type": "STATIC",
54
+ "translation": [
55
+ 2.0,
56
+ 0.0,
57
+ -1.5
58
+ ],
59
+ "rotation": [
60
+ 1.0,
61
+ 0.0,
62
+ 0.0,
63
+ 0.0
64
+ ]
65
+ },
66
+ {
67
+ "template_name": "objects/laptop",
68
+ "motion_type": "DYNAMIC",
69
+ "translation": [
70
+ -1.75,
71
+ 0.75,
72
+ 1.0
73
+ ],
74
+ "rotation": [
75
+ 1.0,
76
+ 0.0,
77
+ 0.0,
78
+ 0.0
79
+ ]
80
+ },
81
+ {
82
+ "template_name": "objects/book_red",
83
+ "motion_type": "DYNAMIC",
84
+ "translation": [
85
+ -1.2,
86
+ 0.75,
87
+ 1.15
88
+ ],
89
+ "rotation": [
90
+ 1.0,
91
+ 0.0,
92
+ 0.0,
93
+ 0.0
94
+ ]
95
+ },
96
+ {
97
+ "template_name": "objects/book_red",
98
+ "motion_type": "DYNAMIC",
99
+ "translation": [
100
+ -1.2,
101
+ 0.75,
102
+ 0.85
103
+ ],
104
+ "rotation": [
105
+ 1.0,
106
+ 0.0,
107
+ 0.0,
108
+ 0.0
109
+ ]
110
+ },
111
+ {
112
+ "template_name": "objects/mug",
113
+ "motion_type": "DYNAMIC",
114
+ "translation": [
115
+ -1.45,
116
+ 0.75,
117
+ 0.8
118
+ ],
119
+ "rotation": [
120
+ 1.0,
121
+ 0.0,
122
+ 0.0,
123
+ 0.0
124
+ ]
125
+ },
126
+ {
127
+ "template_name": "objects/bowl",
128
+ "motion_type": "DYNAMIC",
129
+ "translation": [
130
+ -0.15,
131
+ 0.45,
132
+ -0.9
133
+ ],
134
+ "rotation": [
135
+ 1.0,
136
+ 0.0,
137
+ 0.0,
138
+ 0.0
139
+ ]
140
+ },
141
+ {
142
+ "template_name": "objects/remote",
143
+ "motion_type": "DYNAMIC",
144
+ "translation": [
145
+ 0.2,
146
+ 0.45,
147
+ -1.0
148
+ ],
149
+ "rotation": [
150
+ 1.0,
151
+ 0.0,
152
+ 0.0,
153
+ 0.0
154
+ ]
155
+ },
156
+ {
157
+ "template_name": "objects/book_green",
158
+ "motion_type": "DYNAMIC",
159
+ "translation": [
160
+ 1.4000000000000001,
161
+ 0.3,
162
+ 1.2
163
+ ],
164
+ "rotation": [
165
+ 1.0,
166
+ 0.0,
167
+ 0.0,
168
+ 0.0
169
+ ]
170
+ },
171
+ {
172
+ "template_name": "objects/cereal_box",
173
+ "motion_type": "DYNAMIC",
174
+ "translation": [
175
+ 1.8,
176
+ 0.3,
177
+ 1.2
178
+ ],
179
+ "rotation": [
180
+ 1.0,
181
+ 0.0,
182
+ 0.0,
183
+ 0.0
184
+ ]
185
+ },
186
+ {
187
+ "template_name": "objects/book_blue",
188
+ "motion_type": "DYNAMIC",
189
+ "translation": [
190
+ 1.4500000000000002,
191
+ 0.75,
192
+ 1.2
193
+ ],
194
+ "rotation": [
195
+ 1.0,
196
+ 0.0,
197
+ 0.0,
198
+ 0.0
199
+ ]
200
+ },
201
+ {
202
+ "template_name": "objects/plant_pot",
203
+ "motion_type": "DYNAMIC",
204
+ "translation": [
205
+ 1.8,
206
+ 0.75,
207
+ 1.2
208
+ ],
209
+ "rotation": [
210
+ 1.0,
211
+ 0.0,
212
+ 0.0,
213
+ 0.0
214
+ ]
215
+ },
216
+ {
217
+ "template_name": "objects/mug",
218
+ "motion_type": "DYNAMIC",
219
+ "translation": [
220
+ 1.6,
221
+ 1.2,
222
+ 1.2
223
+ ],
224
+ "rotation": [
225
+ 1.0,
226
+ 0.0,
227
+ 0.0,
228
+ 0.0
229
+ ]
230
+ },
231
+ {
232
+ "template_name": "objects/toaster",
233
+ "motion_type": "DYNAMIC",
234
+ "translation": [
235
+ 1.8,
236
+ 0.9,
237
+ -1.5
238
+ ],
239
+ "rotation": [
240
+ 1.0,
241
+ 0.0,
242
+ 0.0,
243
+ 0.0
244
+ ]
245
+ },
246
+ {
247
+ "template_name": "objects/book_red",
248
+ "motion_type": "DYNAMIC",
249
+ "translation": [
250
+ 2.3,
251
+ 0.9,
252
+ -1.5
253
+ ],
254
+ "rotation": [
255
+ 1.0,
256
+ 0.0,
257
+ 0.0,
258
+ 0.0
259
+ ]
260
+ }
261
+ ]
262
+ }
demo/assets/example_scene/objects/book_blue.glb ADDED
Binary file (1.04 kB). View file
 
demo/assets/example_scene/objects/book_green.glb ADDED
Binary file (1.04 kB). View file
 
demo/assets/example_scene/objects/book_red.glb ADDED
Binary file (1.04 kB). View file
 
demo/assets/example_scene/objects/bowl.glb ADDED
Binary file (3.16 kB). View file
 
demo/assets/example_scene/objects/cereal_box.glb ADDED
Binary file (1.04 kB). View file
 
demo/assets/example_scene/objects/counter.glb ADDED
Binary file (1 kB). View file
 
demo/assets/example_scene/objects/desk.glb ADDED
Binary file (1.95 kB). View file
 
demo/assets/example_scene/objects/laptop.glb ADDED
Binary file (1.04 kB). View file
 
demo/assets/example_scene/objects/mug.glb ADDED
Binary file (3.16 kB). View file
 
demo/assets/example_scene/objects/plant_pot.glb ADDED
Binary file (3.16 kB). View file
 
demo/assets/example_scene/objects/remote.glb ADDED
Binary file (1.04 kB). View file
 
demo/assets/example_scene/objects/shelf.glb ADDED
Binary file (1.96 kB). View file
 
demo/assets/example_scene/objects/table.glb ADDED
Binary file (1.93 kB). View file
 
demo/assets/example_scene/objects/toaster.glb ADDED
Binary file (1.04 kB). View file
 
demo/assets/example_scene/stages/demo_room.glb ADDED
Binary file (976 Bytes). View file
 
demo/build_example_scene.py ADDED
@@ -0,0 +1,342 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Build the built-in example scene pack (`example_scene.zip`) for the
3
+ ManiTaskGen Gradio demo.
4
+
5
+ The pack mirrors the on-disk layout of a Habitat/ReplicaCAD dataset root,
6
+ which is exactly what `ReplicaSceneParser` (src/preprocessing/maniskill_parser.py)
7
+ consumes:
8
+
9
+ example_scene.zip
10
+ ├── configs/scenes/demo_studio.scene_instance.json # entry scene file
11
+ ├── configs/objects/<template>.object_config.json # render asset config
12
+ ├── objects/<template>.glb # object meshes
13
+ └── stages/demo_room.glb # background stage mesh
14
+
15
+ All geometry is generated here from primitive boxes/cylinders, so the pack is
16
+ tiny (<100 KB) and freely redistributable (no third-party assets, no license
17
+ restrictions).
18
+
19
+ Mesh up-axis note: the scene-graph pipeline converts loaded GLB geometry from
20
+ Y-up to Z-up (`create_object_list` in scene_parser.py applies a fixed
21
+ transform). We therefore design furniture in engine coordinates (Z-up) and
22
+ pre-convert vertices to Y-up when saving, so objects stand upright after the
23
+ pipeline's fixed transform.
24
+
25
+ Run from the repo root:
26
+ python demo/build_example_scene.py
27
+ """
28
+
29
+ import json
30
+ import os
31
+ import sys
32
+ import zipfile
33
+
34
+ import numpy as np
35
+ import trimesh
36
+
37
+ REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
38
+ PACK_DIR = os.path.join(REPO_ROOT, "demo", "assets", "example_scene")
39
+ ZIP_PATH = os.path.join(REPO_ROOT, "demo", "assets", "example_scene.zip")
40
+
41
+
42
+ def eng_to_glb(vertices: np.ndarray) -> np.ndarray:
43
+ """Engine coords (Z-up) -> GLB coords (Y-up), inverse of the pipeline's
44
+ fixed Y-up->Z-up transform (new_x=x, new_y=-z, new_z=y)."""
45
+ v = np.asarray(vertices, dtype=np.float64)
46
+ out = np.empty_like(v)
47
+ out[:, 0] = v[:, 0]
48
+ out[:, 1] = v[:, 2] # glb Y (up) = engine Z (up)
49
+ out[:, 2] = -v[:, 1] # glb Z = -engine Y
50
+ return out
51
+
52
+
53
+ def save_glb(mesh: trimesh.Trimesh, rel_path: str) -> None:
54
+ path = os.path.join(PACK_DIR, rel_path)
55
+ os.makedirs(os.path.dirname(path), exist_ok=True)
56
+ mesh.vertices = eng_to_glb(mesh.vertices)
57
+ mesh.export(path)
58
+ print(f" wrote {rel_path} ({os.path.getsize(path)} bytes)")
59
+
60
+
61
+ def box(length: float, width: float, height: float) -> trimesh.Trimesh:
62
+ return trimesh.creation.box(extents=[length, width, height])
63
+
64
+
65
+ def box_at(center_eng, length, width, height) -> trimesh.Trimesh:
66
+ m = box(length, width, height)
67
+ m.apply_translation(np.asarray(center_eng, dtype=np.float64))
68
+ return m
69
+
70
+
71
+ def cyl_at(center_eng, radius, height, sections=32) -> trimesh.Trimesh:
72
+ m = trimesh.creation.cylinder(radius=radius, height=height, sections=sections)
73
+ m.apply_translation(np.asarray(center_eng, dtype=np.float64))
74
+ return m
75
+
76
+
77
+ def concat(meshes) -> trimesh.Trimesh:
78
+ return trimesh.util.concatenate(list(meshes))
79
+
80
+
81
+ def build_stage() -> None:
82
+ """A single floor slab, 8m x 8m, top surface at engine z = 0."""
83
+ slab = box_at([0.0, 0.0, -0.05], 8.0, 8.0, 0.10)
84
+ save_glb(slab, "stages/demo_room.glb")
85
+
86
+
87
+ # ---------------------------------------------------------------------------
88
+ # Furniture (origin at bottom-center, engine z = 0 when placed on the floor)
89
+ # ---------------------------------------------------------------------------
90
+
91
+ def build_desk() -> None:
92
+ """Desk: top surface at 0.75m, 1.2m x 0.7m."""
93
+ parts = []
94
+ top_z = 0.75
95
+ t = 0.04
96
+ parts.append(box_at([0, 0, top_z - t / 2], 1.2, 0.7, t))
97
+ leg_h = top_z - t
98
+ for sx in (-1, 1):
99
+ for sy in (-1, 1):
100
+ parts.append(
101
+ box_at([sx * 0.55, sy * 0.30, leg_h / 2], 0.05, 0.05, leg_h)
102
+ )
103
+ save_glb(concat(parts), "objects/desk.glb")
104
+
105
+
106
+ def build_table() -> None:
107
+ """Low coffee table: top surface at 0.45m, 0.8m x 0.5m."""
108
+ parts = []
109
+ top_z = 0.45
110
+ t = 0.03
111
+ parts.append(box_at([0, 0, top_z - t / 2], 0.8, 0.5, t))
112
+ leg_h = top_z - t
113
+ for sx in (-1, 1):
114
+ for sy in (-1, 1):
115
+ parts.append(
116
+ box_at([sx * 0.35, sy * 0.20, leg_h / 2], 0.04, 0.04, leg_h)
117
+ )
118
+ save_glb(concat(parts), "objects/table.glb")
119
+
120
+
121
+ def build_shelf() -> None:
122
+ """Bookshelf with 3 boards: a multilayer object.
123
+
124
+ Board top surfaces at 0.30m / 0.75m / 1.20m, each 0.8m x 0.3m.
125
+ """
126
+ parts = []
127
+ w, d = 0.8, 0.3
128
+ board_t = 0.03
129
+ board_tops = [0.30, 0.75, 1.20]
130
+ side_h = board_tops[-1] + 0.02
131
+ for sy in (-1, 1):
132
+ parts.append(box_at([0, sy * (d / 2 - 0.01), side_h / 2], w, 0.02, side_h))
133
+ for z_top in board_tops:
134
+ parts.append(box_at([0, 0, z_top - board_t / 2], w, d, board_t))
135
+ save_glb(concat(parts), "objects/shelf.glb")
136
+
137
+
138
+ def build_counter() -> None:
139
+ """Solid counter block: 1.0m x 0.6m, top surface at 0.9m."""
140
+ save_glb(box_at([0, 0, 0.45], 1.0, 0.6, 0.9), "objects/counter.glb")
141
+
142
+
143
+ # ---------------------------------------------------------------------------
144
+ # Small items (origin at bottom-center; placed with centroid z = surface height)
145
+ # ---------------------------------------------------------------------------
146
+
147
+ def build_small_items() -> None:
148
+ save_glb(
149
+ box_at([0, 0, 0.011], 0.32, 0.22, 0.022), "objects/laptop.glb"
150
+ )
151
+ # books
152
+ save_glb(box_at([0, 0, 0.015], 0.21, 0.15, 0.03), "objects/book_red.glb")
153
+ save_glb(box_at([0, 0, 0.015], 0.21, 0.15, 0.03), "objects/book_blue.glb")
154
+ save_glb(box_at([0, 0, 0.015], 0.21, 0.15, 0.03), "objects/book_green.glb")
155
+ # mug: cylinder, r=0.04, h=0.10 (z from 0 to 0.10)
156
+ save_glb(cyl_at([0, 0, 0.05], 0.04, 0.10), "objects/mug.glb")
157
+ # plant pot: r=0.07, h=0.14
158
+ save_glb(cyl_at([0, 0, 0.07], 0.07, 0.14), "objects/plant_pot.glb")
159
+ # cereal box
160
+ save_glb(box_at([0, 0, 0.15], 0.20, 0.08, 0.30), "objects/cereal_box.glb")
161
+ # bowl: r=0.09, h=0.07
162
+ save_glb(cyl_at([0, 0, 0.035], 0.09, 0.07), "objects/bowl.glb")
163
+ # remote
164
+ save_glb(box_at([0, 0, 0.01], 0.15, 0.06, 0.02), "objects/remote.glb")
165
+ # toaster
166
+ save_glb(box_at([0, 0, 0.095], 0.26, 0.18, 0.19), "objects/toaster.glb")
167
+
168
+
169
+ def write_object_configs() -> None:
170
+ cfg_dir = os.path.join(PACK_DIR, "configs", "objects")
171
+ os.makedirs(cfg_dir, exist_ok=True)
172
+ for template in [
173
+ "desk", "table", "shelf", "counter", "laptop",
174
+ "book_red", "book_blue", "book_green", "mug",
175
+ "plant_pot", "cereal_box", "bowl", "remote", "toaster",
176
+ ]:
177
+ cfg = {
178
+ "render_asset": f"../../objects/{template}.glb",
179
+ "mass": 0.5,
180
+ "COM": [0, 0, 0],
181
+ "join_collision_meshes": False,
182
+ }
183
+ with open(os.path.join(cfg_dir, f"{template}.object_config.json"), "w") as f:
184
+ json.dump(cfg, f, indent=2)
185
+
186
+
187
+ def q_identity():
188
+ return [1.0, 0.0, 0.0, 0.0] # [w, x, y, z]
189
+
190
+
191
+ def eng_to_hab(x, y, z):
192
+ """Engine (Z-up) -> habitat (Y-up): hab = (x, z, -y)."""
193
+ return [float(x), float(z), float(-y)]
194
+
195
+
196
+ def obj(template: str, motion: str, eng_pos, eng_rot_z_deg: float = 0.0) -> dict:
197
+ """Instance entry. eng_pos is the object-origin position in engine coords.
198
+
199
+ The parser rotates habitat-space quaternions by +90° about X (then removes
200
+ 90° from the euler x component), so a yaw rotation of `a` about engine Z
201
+ corresponds to habitat quaternion (cosa/2, 0, 0, sina/2) -> corrected
202
+ identity... We keep everything axis-aligned (yaw=0) for determinism.
203
+ """
204
+ del eng_rot_z_deg
205
+ return {
206
+ "template_name": f"objects/{template}",
207
+ "motion_type": motion,
208
+ "translation": eng_to_hab(*eng_pos),
209
+ "rotation": q_identity(),
210
+ }
211
+
212
+
213
+ def write_scene_instance() -> None:
214
+ """Place furniture and items. Engine coords: +Z up.
215
+
216
+ Desk at (-1.5, -1.0), table at (0, 0.9), shelf at (1.6, -1.2),
217
+ counter at (2.0, 1.5).
218
+ """
219
+ instances = []
220
+ desk_pos = (-1.5, -1.0, 0.0)
221
+ desk_top = 0.75
222
+ table_pos = (0.0, 0.9, 0.0)
223
+ table_top = 0.45
224
+ shelf_pos = (1.6, -1.2, 0.0)
225
+ shelf_board_tops = [0.30, 0.75, 1.20]
226
+ counter_pos = (2.0, 1.5, 0.0)
227
+ counter_top = 0.9
228
+
229
+ # furniture
230
+ instances.append(obj("desk", "STATIC", desk_pos))
231
+ instances.append(obj("table", "STATIC", table_pos))
232
+ instances.append(obj("shelf", "STATIC", shelf_pos))
233
+ instances.append(obj("counter", "STATIC", counter_pos))
234
+
235
+ # items on the desk (top at 0.75)
236
+ instances.append(obj("laptop", "DYNAMIC", (desk_pos[0] - 0.25, desk_pos[1] + 0.0, desk_top)))
237
+ instances.append(obj("book_red", "DYNAMIC", (desk_pos[0] + 0.30, desk_pos[1] - 0.15, desk_top)))
238
+ instances.append(obj("book_red", "DYNAMIC", (desk_pos[0] + 0.30, desk_pos[1] + 0.15, desk_top)))
239
+ instances.append(obj("mug", "DYNAMIC", (desk_pos[0] + 0.05, desk_pos[1] + 0.20, desk_top)))
240
+
241
+ # items on the low table (top at 0.45)
242
+ instances.append(obj("bowl", "DYNAMIC", (table_pos[0] - 0.15, table_pos[1], table_top)))
243
+ instances.append(obj("remote", "DYNAMIC", (table_pos[0] + 0.20, table_pos[1] + 0.10, table_top)))
244
+
245
+ # items on the shelf boards
246
+ instances.append(obj("book_green", "DYNAMIC", (shelf_pos[0] - 0.20, shelf_pos[1], shelf_board_tops[0])))
247
+ instances.append(obj("cereal_box", "DYNAMIC", (shelf_pos[0] + 0.20, shelf_pos[1], shelf_board_tops[0])))
248
+ instances.append(obj("book_blue", "DYNAMIC", (shelf_pos[0] - 0.15, shelf_pos[1], shelf_board_tops[1])))
249
+ instances.append(obj("plant_pot", "DYNAMIC", (shelf_pos[0] + 0.20, shelf_pos[1], shelf_board_tops[1])))
250
+ instances.append(obj("mug", "DYNAMIC", (shelf_pos[0], shelf_pos[1], shelf_board_tops[2])))
251
+
252
+ # items on the counter (top at 0.9)
253
+ instances.append(obj("toaster", "DYNAMIC", (counter_pos[0] - 0.20, counter_pos[1], counter_top)))
254
+ instances.append(obj("book_red", "DYNAMIC", (counter_pos[0] + 0.30, counter_pos[1], counter_top)))
255
+
256
+ scene = {
257
+ "stage_instance": {"template_name": "stages/demo_room"},
258
+ "object_instances": instances,
259
+ }
260
+ path = os.path.join(PACK_DIR, "configs", "scenes", "demo_studio.scene_instance.json")
261
+ os.makedirs(os.path.dirname(path), exist_ok=True)
262
+ with open(path, "w") as f:
263
+ json.dump(scene, f, indent=2)
264
+ print(f" wrote scene instance with {len(instances)} objects")
265
+
266
+
267
+ PACK_README = """# Demo Studio scene pack
268
+
269
+ ManiTaskGen scene pack (Habitat/ReplicaCAD-style layout, primitive geometry,
270
+ freely redistributable).
271
+
272
+ - Entry scene file: `configs/scenes/demo_studio.scene_instance.json`
273
+ - Stage/background mesh: `stages/demo_room.glb` (8m x 8m floor slab)
274
+ - Object meshes: `objects/<template>.glb`
275
+ - Per-template configs: `configs/objects/<template>.object_config.json`
276
+
277
+ ## Coordinates
278
+
279
+ Positions in `scene_instance.json` follow the Habitat convention (Y-up,
280
+ rotation = quaternion [w, x, y, z]). Meshes are stored Y-up, matching
281
+ ReplicaCAD assets. The engine pipeline converts both to Z-up internally.
282
+
283
+ ## Structure
284
+
285
+ | Template | Kind | Placed at (engine x, y) | Notes |
286
+ | --- | --- | --- | --- |
287
+ | desk | table | (-1.5, -1.0) | top surface 0.75 m |
288
+ | table | low table | (0.0, 0.9) | top surface 0.45 m |
289
+ | shelf | bookshelf (3 boards) | (1.6, -1.2) | multilayer: 0.30/0.75/1.20 m |
290
+ | counter | solid block | (2.0, 1.5) | top surface 0.90 m |
291
+
292
+ Small items (laptop, book_red x3, book_blue, book_green, mug x2, bowl,
293
+ remote, cereal_box, plant_pot, toaster) are placed on top of the furniture.
294
+
295
+ ## How to modify and re-upload
296
+
297
+ 1. Unzip this archive.
298
+ 2. Move / remove / rename an object:
299
+ - edit its `translation` (Habitat coords) or delete its entry in
300
+ `configs/scenes/demo_studio.scene_instance.json`;
301
+ - if you delete a template, also delete `objects/<template>.glb` and
302
+ `configs/objects/<template>.object_config.json`.
303
+ 3. Re-zip the folder (keep the layout above) and upload the ZIP to the demo.
304
+
305
+ Tasks referencing a removed object will disappear; the remaining results
306
+ always reflect the uploaded scene.
307
+ """
308
+
309
+
310
+ def write_pack_readme() -> None:
311
+ with open(os.path.join(PACK_DIR, "README.md"), "w") as f:
312
+ f.write(PACK_README)
313
+
314
+
315
+ def main() -> None:
316
+ print(f"Building example scene pack in {PACK_DIR}")
317
+ os.makedirs(PACK_DIR, exist_ok=True)
318
+ build_stage()
319
+ build_desk()
320
+ build_table()
321
+ build_shelf()
322
+ build_counter()
323
+ build_small_items()
324
+ write_object_configs()
325
+ write_scene_instance()
326
+ write_pack_readme()
327
+
328
+ # zip it up (store small files with deflate)
329
+ if os.path.exists(ZIP_PATH):
330
+ os.remove(ZIP_PATH)
331
+ with zipfile.ZipFile(ZIP_PATH, "w", zipfile.ZIP_DEFLATED) as zf:
332
+ for root, _, files in os.walk(PACK_DIR):
333
+ for name in sorted(files):
334
+ full = os.path.join(root, name)
335
+ rel = os.path.relpath(full, PACK_DIR)
336
+ zf.write(full, arcname=rel)
337
+ size = os.path.getsize(ZIP_PATH)
338
+ print(f"Wrote {ZIP_PATH} ({size} bytes)")
339
+
340
+
341
+ if __name__ == "__main__":
342
+ sys.exit(main())
demo/pipeline.py ADDED
@@ -0,0 +1,346 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Generation pipeline for the ManiTaskGen Gradio demo.
3
+
4
+ Reuses the repository's existing implementations end to end:
5
+
6
+ - Scene parsing: ``src/preprocessing/maniskill_parser.ReplicaSceneParser``
7
+ - Scene graph: ``src/core/gen_scene_graph.gen_multi_layer_graph_with_free_space``
8
+ - Process tasks: ``src/core/process_based_task_generation.TaskGeneration``
9
+ - Outcome tasks: ``src/core/outcome_based_task_generation.OutcomeBasedTaskGenerator``
10
+
11
+ No VLM is called anywhere in this module: object renaming is skipped (empty
12
+ rename dict) and outcome candidates are exported directly with
13
+ ``voting_status: "not_run"``.
14
+
15
+ The built-in example's scene graph is cached at startup; every generation call
16
+ re-runs the original generators. Uploaded scenes are parsed in their own fresh
17
+ temp directory (no caching), so results always reflect the uploaded scene.
18
+ """
19
+
20
+ import json
21
+ import os
22
+ import re
23
+ import sys
24
+ import threading
25
+ import time
26
+
27
+ REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
28
+ if REPO_ROOT not in sys.path:
29
+ sys.path.insert(0, REPO_ROOT)
30
+
31
+ os.environ.setdefault("KMP_DUPLICATE_LIB_OK", "True")
32
+ os.environ.setdefault("MPLBACKEND", "Agg")
33
+
34
+ from src.utils.config_manager import init_config, get_config # noqa: E402
35
+ from src.preprocessing import RawSceneParserFactory # noqa: E402
36
+ from src.core import gen_scene_graph # noqa: E402
37
+ from src.core.process_based_task_generation import TaskGeneration # noqa: E402
38
+ from src.core.outcome_based_task_generation import ( # noqa: E402
39
+ OutcomeBasedTaskGenerator,
40
+ )
41
+
42
+ from scene_pack import ScenePackError, scene_id_from_entry # noqa: E402
43
+
44
+ BUILTIN_PACK_DIR = os.path.join(
45
+ REPO_ROOT, "demo", "assets", "example_scene"
46
+ )
47
+ BUILTIN_ENTRY = os.path.join(
48
+ BUILTIN_PACK_DIR, "configs", "scenes", "demo_studio.scene_instance.json"
49
+ )
50
+ PATTERN_FILE = os.path.join(REPO_ROOT, "data", "templates", "manitask_ot200.txt")
51
+
52
+ # Serialise generation: the global ConfigManager is a process-wide singleton,
53
+ # and reusing one scene graph keeps memory usage predictable on free Spaces.
54
+ # RLock so that generate_from_pack can hold it across parse + graph + tasks
55
+ # (run_generation re-acquires it internally).
56
+ _GENERATION_LOCK = threading.RLock()
57
+
58
+ _builtin_cache = {}
59
+
60
+
61
+ class GenerationResult:
62
+ def __init__(self):
63
+ self.scene_id = None
64
+ self.source = None # "builtin" or "upload"
65
+ self.process_tasks = [] # list of export dicts
66
+ self.outcome_candidates = [] # list of export dicts
67
+ self.timings = {}
68
+ self.warnings = []
69
+ self.jsonl_path = None
70
+ self.stats = {}
71
+
72
+
73
+ def _init_global_config():
74
+ """Initialise the global ConfigManager from the default config file."""
75
+ init_config(os.path.join(REPO_ROOT, "config", "default_config.yml"))
76
+ cfg = get_config()
77
+ # VLM-free demo defaults
78
+ cfg.use_renaming_engine = False
79
+ cfg.process_based_task.use_level1_tasks = False
80
+
81
+
82
+ def _apply_pack_config(pack_dir: str):
83
+ """Point the global config at an unpacked scene pack (paths absolute)."""
84
+ cfg = get_config()
85
+ saved = {
86
+ "dataset_root_path": cfg.dataset_root_path,
87
+ "object_config_path": cfg.object_config_path,
88
+ "stage_path_prefix": cfg.stage_path_prefix,
89
+ "urdf_path_prefix": cfg.urdf_path_prefix,
90
+ "not_desired_objects": cfg.raw_scene.not_desired_objects,
91
+ "desired_objects": cfg.raw_scene.desired_objects,
92
+ "not_desired_articulations": cfg.raw_scene.not_desired_articulations,
93
+ "desired_articulations": cfg.raw_scene.desired_articulations,
94
+ }
95
+ cfg.dataset_root_path = os.path.abspath(pack_dir)
96
+ cfg.object_config_path = os.path.abspath(
97
+ os.path.join(pack_dir, "configs", "objects")
98
+ )
99
+ cfg.stage_path_prefix = os.path.abspath(pack_dir)
100
+ cfg.urdf_path_prefix = os.path.abspath(os.path.join(pack_dir, "urdf"))
101
+ # Do not silently drop any objects for uploaded scenes.
102
+ cfg.raw_scene.not_desired_objects = []
103
+ cfg.raw_scene.desired_objects = []
104
+ cfg.raw_scene.not_desired_articulations = []
105
+ cfg.raw_scene.desired_articulations = []
106
+ return saved
107
+
108
+
109
+ def _restore_pack_config(saved):
110
+ cfg = get_config()
111
+ for key, value in saved.items():
112
+ if key.startswith(("not_desired", "desired")):
113
+ setattr(cfg.raw_scene, key, value)
114
+ else:
115
+ setattr(cfg, key, value)
116
+
117
+
118
+ def _parse_pack(pack_dir: str, entry_path: str, work_dir: str) -> str:
119
+ """Run the existing ReplicaSceneParser on a pack; return parsed JSON path."""
120
+ os.makedirs(work_dir, exist_ok=True)
121
+ parsed_path = os.path.join(work_dir, "scene_parsed.json")
122
+ saved = _apply_pack_config(pack_dir)
123
+ try:
124
+ parser = RawSceneParserFactory.create_parser("replica")
125
+ parser.parse_scene(entry_path, parsed_path)
126
+ finally:
127
+ _restore_pack_config(saved)
128
+ return parsed_path
129
+
130
+
131
+ def build_scene_graph(pack_dir: str, entry_path: str, work_dir: str):
132
+ """Parse a pack and build its scene graph (existing repo code)."""
133
+ parsed_path = _parse_pack(pack_dir, entry_path, work_dir)
134
+ with open(parsed_path, "r") as f:
135
+ parsed = json.load(f)
136
+ graph = gen_scene_graph.gen_multi_layer_graph_with_free_space(parsed)
137
+ return graph, parsed_path
138
+
139
+
140
+ def _get_builtin_graph():
141
+ """Build (once) and cache the built-in example's scene graph."""
142
+ if "graph" not in _builtin_cache:
143
+ graph, parsed_path = build_scene_graph(
144
+ BUILTIN_PACK_DIR,
145
+ BUILTIN_ENTRY,
146
+ work_dir=os.path.join(REPO_ROOT, "output", "demo_builtin"),
147
+ )
148
+ _builtin_cache["graph"] = graph
149
+ _builtin_cache["parsed_path"] = parsed_path
150
+ return _builtin_cache["graph"]
151
+
152
+
153
+ # ---------------------------------------------------------------------------
154
+ # Task generation + export
155
+ # ---------------------------------------------------------------------------
156
+
157
+ def _process_task_records(task_gen) -> list:
158
+ records = []
159
+ for chain in task_gen.tasks:
160
+ if chain is None or not getattr(chain, "subtask_list", None):
161
+ continue
162
+ steps, goals, types, items, destinations = [], [], [], set(), set()
163
+ for st in chain.subtask_list:
164
+ try:
165
+ steps.append(st.__repr_rough__())
166
+ except Exception:
167
+ steps.append(str(st))
168
+ try:
169
+ goals.append(st.goal_primitive_expression.to_pddl_goal())
170
+ except Exception:
171
+ goals.append(None)
172
+ try:
173
+ types.append(st.type.name)
174
+ except Exception:
175
+ types.append(None)
176
+ item_name = getattr(getattr(st, "item", None), "name", None)
177
+ dest_name = getattr(getattr(st, "destination", None), "name", None)
178
+ if item_name:
179
+ items.add(item_name)
180
+ if dest_name:
181
+ destinations.add(dest_name)
182
+ records.append(
183
+ {
184
+ "task_category": "process_based",
185
+ "instruction": ", THEN ".join(steps),
186
+ "steps": steps,
187
+ "goal": [g for g in goals if g],
188
+ "task_types": types,
189
+ "entities": {
190
+ "items": sorted(items),
191
+ "destinations": sorted(destinations),
192
+ },
193
+ }
194
+ )
195
+ return records
196
+
197
+
198
+ def _outcome_task_records(generator) -> list:
199
+ pattern_index = {id(p): i for i, p in enumerate(generator.task_pattern_list)}
200
+ records = []
201
+ for task in generator.task_list:
202
+ if task.task_description is None:
203
+ continue
204
+ if "[PLATFORM" in task.task_description or re_unreplaced(
205
+ task.task_description
206
+ ):
207
+ # Unreplaced template slots should not be exported.
208
+ continue
209
+ platforms = [p.platform_name for p in task.platform_list or []]
210
+ mlos = [
211
+ m.multilayer_object_name for m in task.multi_layer_object_list or []
212
+ ]
213
+ records.append(
214
+ {
215
+ "task_category": "outcome_candidate",
216
+ "instruction": task.task_description,
217
+ "pattern_id": pattern_index.get(id(task.task_pattern)),
218
+ "pattern_text": task.task_pattern.task_pattern,
219
+ "bound_entities": {
220
+ "platforms": platforms,
221
+ "multilayer_objects": mlos,
222
+ },
223
+ "voting_status": "not_run",
224
+ }
225
+ )
226
+ return records
227
+
228
+
229
+ def re_unreplaced(text: str) -> bool:
230
+ """Detect unreplaced template slots like [SUB-PLATFORM-OBJECTS00]."""
231
+ leftovers = re.findall(r"\[[A-Z0-9\-_]+\]", text)
232
+ # "[ROOM]" is a literal part of some pattern texts, keep it.
233
+ leftovers = [x for x in leftovers if x != "[ROOM]"]
234
+ return bool(leftovers)
235
+
236
+
237
+ def run_generation(
238
+ source: str,
239
+ graph,
240
+ scene_id: str,
241
+ work_dir: str,
242
+ max_process_tasks: int = 20,
243
+ process_task_length: int = 3,
244
+ outcome_per_pattern: int = 3,
245
+ process_seed: int = None,
246
+ outcome_seed: int = None,
247
+ ) -> GenerationResult:
248
+ """Run both generators on ``graph`` and export results.
249
+
250
+ Every call re-runs the original generators (the graph may be cached for
251
+ the built-in example, but generation itself is always fresh).
252
+ """
253
+ import random
254
+
255
+ result = GenerationResult()
256
+ result.source = source
257
+ result.scene_id = scene_id
258
+
259
+ with _GENERATION_LOCK:
260
+ if process_seed is not None:
261
+ random.seed(process_seed)
262
+ t0 = time.perf_counter()
263
+ task_gen = TaskGeneration(graph)
264
+ task_gen.generate_task(
265
+ task_length=process_task_length, max_task_num=max_process_tasks
266
+ )
267
+ t1 = time.perf_counter()
268
+ result.process_tasks = _process_task_records(task_gen)
269
+ result.timings["process_based"] = round(t1 - t0, 2)
270
+
271
+ if outcome_seed is not None:
272
+ random.seed(outcome_seed)
273
+ t2 = time.perf_counter()
274
+ obt_gen = OutcomeBasedTaskGenerator(scene_graph=graph)
275
+ if not os.path.isfile(PATTERN_FILE):
276
+ raise ScenePackError(
277
+ f"ManiTaskOT-200 pattern file not found: {PATTERN_FILE}"
278
+ )
279
+ obt_gen.load_task_patterns(PATTERN_FILE)
280
+ obt_gen.generate_task_with_all_patterns(task_num=outcome_per_pattern)
281
+ t3 = time.perf_counter()
282
+ result.outcome_candidates = _outcome_task_records(obt_gen)
283
+ result.timings["outcome_based"] = round(t3 - t2, 2)
284
+
285
+ if not result.outcome_candidates:
286
+ result.warnings.append(
287
+ "No outcome-based templates could be bound to this scene. "
288
+ "Outcome tasks need platforms with objects on them (categories "
289
+ "are derived from object names before the first '_', e.g. "
290
+ "'book_red_0' -> 'book'). Process-based tasks may still be "
291
+ "available above."
292
+ )
293
+
294
+ # ---- export tasks.jsonl ----
295
+ os.makedirs(work_dir, exist_ok=True)
296
+ result.jsonl_path = os.path.join(work_dir, "tasks.jsonl")
297
+ with open(result.jsonl_path, "w", encoding="utf-8") as f:
298
+ for i, rec in enumerate(result.process_tasks):
299
+ rec = {"task_id": f"{scene_id}_process_{i:03d}", **rec}
300
+ f.write(json.dumps(rec, ensure_ascii=False) + "\n")
301
+ for i, rec in enumerate(result.outcome_candidates):
302
+ rec = {"task_id": f"{scene_id}_outcome_{i:03d}", **rec}
303
+ f.write(json.dumps(rec, ensure_ascii=False) + "\n")
304
+
305
+ result.stats = {
306
+ "scene_id": scene_id,
307
+ "source": source,
308
+ "process_count": len(result.process_tasks),
309
+ "outcome_count": len(result.outcome_candidates),
310
+ "timings_seconds": result.timings,
311
+ }
312
+ return result
313
+
314
+
315
+ def generate_from_pack(
316
+ pack_dir: str,
317
+ entry_path: str,
318
+ work_dir: str,
319
+ **options,
320
+ ) -> GenerationResult:
321
+ """Full pipeline for an uploaded pack: parse + graph + tasks (no cache)."""
322
+ # Hold the lock across the whole upload pipeline: parsing mutates the
323
+ # global ConfigManager (pack-specific paths), so it must not interleave
324
+ # with another request.
325
+ with _GENERATION_LOCK:
326
+ graph, _ = build_scene_graph(pack_dir, entry_path, work_dir)
327
+ scene_id = scene_id_from_entry(entry_path)
328
+ return run_generation(
329
+ source="upload",
330
+ graph=graph,
331
+ scene_id=scene_id,
332
+ work_dir=work_dir,
333
+ **options,
334
+ )
335
+
336
+
337
+ def generate_builtin(**options) -> GenerationResult:
338
+ """Generation from the built-in example (cached graph, fresh generation)."""
339
+ graph = _get_builtin_graph()
340
+ scene_id = scene_id_from_entry(BUILTIN_ENTRY)
341
+ work_dir = os.path.join(
342
+ REPO_ROOT, "output", "demo_runs", "builtin", str(int(time.time() * 1000))
343
+ )
344
+ return run_generation(
345
+ source="builtin", graph=graph, scene_id=scene_id, work_dir=work_dir, **options
346
+ )
demo/requirements.txt ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Minimal dependencies to run the Gradio demo (demo/app.py).
2
+ # No VLM SDKs, no torch, no GPU libraries are required.
3
+ # Install with: pip install -r demo/requirements.txt
4
+ # (mirrors the repository-root requirements.txt used by HF Spaces)
5
+
6
+ gradio>=4.44.0,<5
7
+ huggingface_hub<1.0 # gradio 4.x needs the legacy HfFolder API
8
+ pydantic>=2.9,<2.10 # 2.10+ emits JSON-schema bools that break gradio 4.x
9
+ fastapi==0.111.1 # newer starlette/fastapi break gradio 4.x templating
10
+
11
+ # Setuptools pin: sapien still imports pkg_resources (removed in setuptools>=81)
12
+ setuptools<81
13
+
14
+ # ManiTaskGen core (scene parsing, scene graph, task generation)
15
+ sapien==3.0.0b1
16
+ trimesh>=3.9.0,<5
17
+ scipy>=1.7.0
18
+ shapely==2.0.6
19
+ rtree>=1.0.0
20
+ transforms3d==0.4.2
21
+ sympy
22
+ glog>=0.3.1
23
+ colorama
24
+ jsonschema
25
+ numpy>=1.21.0
26
+ pillow>=8.0.0
27
+ matplotlib>=3.3.0
28
+ opencv-python-headless>=4.4.0.46
29
+ PyYAML
demo/scene_pack.py ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Scene-pack handling for the ManiTaskGen demo.
3
+
4
+ A *scene pack* is a ZIP archive laid out like a Habitat/ReplicaCAD dataset
5
+ root — the exact input format consumed by ``ReplicaSceneParser``
6
+ (src/preprocessing/maniskill_parser.py):
7
+
8
+ scene.zip
9
+ ├── configs/scenes/<name>.scene_instance.json # entry scene file
10
+ ├── configs/objects/<template>.object_config.json
11
+ ├── objects/<template>.glb
12
+ ├── objects/convex/... (optional)
13
+ ├── stages/<stage>.glb
14
+ └── urdf/... (optional, only for articulated objects)
15
+
16
+ This module unpacks uploads safely (zip-slip / zip-bomb protection), locates
17
+ the entry scene file, verifies that all mesh/config assets referenced by the
18
+ scene actually exist inside the pack, and reports the specific missing files.
19
+ """
20
+
21
+ import json
22
+ import os
23
+ import posixpath
24
+ import zipfile
25
+
26
+ # Safety limits for uploaded archives
27
+ MAX_UNCOMPRESSED_BYTES = 1.5 * 1024**3 # 1.5 GiB total when unpacked
28
+ MAX_FILES = 8000
29
+ ALLOWED_SUFFIXES = {
30
+ ".json", ".glb", ".gltf", ".obj", ".ply", ".urdf", ".dae", ".mtl",
31
+ ".png", ".jpg", ".jpeg", ".bin", ".txt", ".md", ".yml", ".yaml",
32
+ }
33
+
34
+
35
+ class ScenePackError(Exception):
36
+ """User-facing error raised for invalid scene packs."""
37
+
38
+
39
+ def _is_unsafe_member(name: str) -> bool:
40
+ name = name.replace("\\", "/")
41
+ if name.startswith("/") or (len(name) > 1 and name[1] == ":"):
42
+ return True
43
+ parts = name.split("/")
44
+ return any(p == ".." for p in parts)
45
+
46
+
47
+ def extract_zip(zip_path: str, dest_dir: str) -> str:
48
+ """Safely extract ``zip_path`` into ``dest_dir``; return the extracted root.
49
+
50
+ The extracted root is ``dest_dir`` itself if the archive has a single top
51
+ level entry, otherwise ``dest_dir`` is the root.
52
+ """
53
+ if not os.path.isfile(zip_path):
54
+ raise ScenePackError("Uploaded file not found.")
55
+
56
+ try:
57
+ with zipfile.ZipFile(zip_path) as zf:
58
+ infos = zf.infolist()
59
+ if len(infos) > MAX_FILES:
60
+ raise ScenePackError(
61
+ f"Archive contains too many files ({len(infos)} > {MAX_FILES})."
62
+ )
63
+ total = sum(info.file_size for info in infos)
64
+ if total > MAX_UNCOMPRESSED_BYTES:
65
+ raise ScenePackError(
66
+ f"Archive is too large when unpacked "
67
+ f"({total / 1024**3:.2f} GiB > 1.5 GiB)."
68
+ )
69
+ for info in infos:
70
+ if info.is_dir():
71
+ continue
72
+ if _is_unsafe_member(info.filename):
73
+ raise ScenePackError(
74
+ f"Archive contains an unsafe path: {info.filename}"
75
+ )
76
+ suffix = os.path.splitext(info.filename)[1].lower()
77
+ if suffix and suffix not in ALLOWED_SUFFIXES:
78
+ raise ScenePackError(
79
+ f"Archive contains a file type not allowed for scene "
80
+ f"packs: {info.filename}"
81
+ )
82
+ os.makedirs(dest_dir, exist_ok=True)
83
+ for info in infos:
84
+ if info.is_dir():
85
+ os.makedirs(
86
+ os.path.join(dest_dir, info.filename), exist_ok=True
87
+ )
88
+ continue
89
+ target = os.path.join(dest_dir, info.filename)
90
+ os.makedirs(os.path.dirname(target), exist_ok=True)
91
+ with zf.open(info) as src, open(target, "wb") as dst:
92
+ while True:
93
+ chunk = src.read(1024 * 1024)
94
+ if not chunk:
95
+ break
96
+ dst.write(chunk)
97
+ except zipfile.BadZipFile:
98
+ raise ScenePackError("The uploaded file is not a valid ZIP archive.")
99
+
100
+ return _strip_single_root(dest_dir)
101
+
102
+
103
+ def _strip_single_root(dest_dir: str) -> str:
104
+ """If everything lives under a single top-level folder, use it as root."""
105
+ entries = [e for e in os.listdir(dest_dir) if e != "__MACOSX"]
106
+ if len(entries) == 1 and os.path.isdir(os.path.join(dest_dir, entries[0])):
107
+ return os.path.join(dest_dir, entries[0])
108
+ return dest_dir
109
+
110
+
111
+ def find_entry_scene(pack_dir: str) -> str:
112
+ """Locate the entry scene_instance.json inside an unpacked pack."""
113
+ candidates = []
114
+ preferred_dir = os.path.join(pack_dir, "configs", "scenes")
115
+ if os.path.isdir(preferred_dir):
116
+ for name in sorted(os.listdir(preferred_dir)):
117
+ if name.endswith(".scene_instance.json"):
118
+ candidates.append(os.path.join(preferred_dir, name))
119
+ if not candidates:
120
+ for root, _, files in os.walk(pack_dir):
121
+ for name in sorted(files):
122
+ if name.endswith(".scene_instance.json"):
123
+ candidates.append(os.path.join(root, name))
124
+ if not candidates:
125
+ for fallback in ("scene.json", "scene_instance.json"):
126
+ p = os.path.join(pack_dir, fallback)
127
+ if os.path.isfile(p):
128
+ candidates.append(p)
129
+ if not candidates:
130
+ raise ScenePackError(
131
+ "No scene entry file found. The archive must contain a "
132
+ "`*.scene_instance.json` (Habitat-style), preferably at "
133
+ "`configs/scenes/`."
134
+ )
135
+ return candidates[0]
136
+
137
+
138
+ def _resolve(base: str, rel: str) -> str:
139
+ rel = rel.replace("\\", "/")
140
+ return os.path.normpath(os.path.join(base, rel))
141
+
142
+
143
+ def check_pack_assets(pack_dir: str, entry_path: str) -> None:
144
+ """Verify that every asset referenced by the entry scene exists.
145
+
146
+ Raises ScenePackError listing the missing files; returns the list of
147
+ object templates that are missing required configs otherwise-collected
148
+ warnings (unused for now).
149
+ """
150
+ with open(entry_path, "r") as f:
151
+ scene = json.load(f)
152
+
153
+ configs_dir = os.path.join(pack_dir, "configs", "objects")
154
+ missing = []
155
+
156
+ stage = scene.get("stage_instance") or {}
157
+ stage_template = stage.get("template_name")
158
+ if stage_template:
159
+ stage_path = _resolve(pack_dir, f"{stage_template}.glb")
160
+ if not os.path.isfile(stage_path):
161
+ missing.append(stage_path)
162
+
163
+ for obj in scene.get("object_instances", []) or []:
164
+ template = (obj.get("template_name") or "").split("/")[-1]
165
+ cfg_path = os.path.join(configs_dir, f"{template}.object_config.json")
166
+ if not os.path.isfile(cfg_path):
167
+ missing.append(cfg_path)
168
+ continue
169
+ with open(cfg_path, "r") as f:
170
+ cfg = json.load(f)
171
+ if not cfg.get("render_asset"):
172
+ raise ScenePackError(
173
+ f"Object config for '{template}' has no 'render_asset': "
174
+ f"{cfg_path}"
175
+ )
176
+ for key in ("render_asset", "collision_asset"):
177
+ asset = cfg.get(key)
178
+ if not asset:
179
+ continue
180
+ asset_path = _resolve(configs_dir, asset)
181
+ if not os.path.isfile(asset_path):
182
+ missing.append(asset_path)
183
+
184
+ for art in scene.get("articulated_object_instances", []) or []:
185
+ template = (art.get("template_name") or "").split("/")[-1]
186
+ base = posixpath.basename(template)
187
+ urdf_path = os.path.join(pack_dir, "urdf", base, f"{base}.urdf")
188
+ if not os.path.isfile(urdf_path):
189
+ missing.append(urdf_path)
190
+
191
+ if missing:
192
+ shown = "\n".join(
193
+ f" - {os.path.relpath(m, pack_dir)}" for m in missing[:12]
194
+ )
195
+ more = (
196
+ f"\n ... and {len(missing) - 12} more" if len(missing) > 12 else ""
197
+ )
198
+ raise ScenePackError(
199
+ "Missing assets referenced by the scene ("
200
+ f"{len(missing)} file(s) not found in the pack):\n{shown}{more}"
201
+ )
202
+
203
+
204
+ def scene_id_from_entry(entry_path: str) -> str:
205
+ name = os.path.basename(entry_path)
206
+ for suffix in (".scene_instance.json", ".json"):
207
+ if name.endswith(suffix):
208
+ name = name[: -len(suffix)]
209
+ break
210
+ return name
docs/AI2THOR_DATASET.md ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AI2THOR (HSSD) 场景:下载与渲染
2
+
3
+ ## 已下载内容
4
+
5
+ `data/datasets/ai2thor/`(约 1.4GB,选择性下载自 HF `haosulab/AI2THOR` 的 15.6GB zip,
6
+ 未下载全量,磁盘峰值 ~2.5GB):
7
+
8
+ | 目录 | 内容 |
9
+ |---|---|
10
+ | `ai2thor-hab/assets/stages/iTHOR` | 150 个 stage(厨房 1-30 / 客厅 201-230 / 卧室 301-330 / 浴室 401-430) |
11
+ | `ai2thor-hab/assets/stages/RoboTHOR` | 76 个 stage(FloorPlan_Train*) |
12
+ | `ai2thor-hab/assets/stages/ArchitecTHOR` | 11 个 stage |
13
+ | `ai2thor-hab/assets/stages/ProcTHOR` | 采样 40 个 stage(全量 12013 个共 16.6GB,可用 `scripts/download_ai2thor_hf.py` 调 PROC_SAMPLE 增量下载) |
14
+ | `ai2thor-hab/configs/` | 三小系列全部场景/物体/stage 配置 + ProcTHOR 采样 |
15
+ | `ai2thorhab-uncompressed/` | 5445 个未压缩物体 GLB + 5386 个物体配置(SAPIEN 需要未压缩版;`ai2thor-hab/assets/objects` 是 Draco 压缩版未下载) |
16
+
17
+ 另已软链 `~/.maniskill/data/scene_datasets/ai2thor` → 本目录,ManiSkill 官方环境可直接使用(ProcTHOR 为采样)。
18
+
19
+ ## 渲染(无需显示器)
20
+
21
+ ```bash
22
+ # 一个代表场景/系列(7 张 2x2 室内全景拼图 + 俯视图)
23
+ python scripts/render_ai2thor.py --demo
24
+
25
+ # 任意场景
26
+ python scripts/render_ai2thor.py --scene data/datasets/ai2thor/ai2thor-hab/configs/scenes/iTHOR/FloorPlan219_physics.scene_instance.json
27
+
28
+ # 光追 + OptiX 降噪
29
+ python scripts/render_ai2thor.py --demo --shader rt --denoiser optix
30
+
31
+ # 列出本地已有场景
32
+ python scripts/render_ai2thor.py --list
33
+ ```
34
+
35
+ 输出:`output/cache/ai2thor/{tag}.png`(室内四向 2x2 拼图)、`{tag}_f0/f90/f180/f270.png`(单方向)、`{tag}_top.png`(俯视)、`{tag}.parsed.json`(管线标准解析格式,可喂给 `take_photo.py` 用自定义位姿拍摄)。
36
+
37
+ 复用既有链路:`ReplicaSceneParser`(config: `config/ai2thor_config.yml`)→ parsed json → `SapienSceneManager.load_objects_from_json`。iTHOR/RoboTHOR/ArchitecTHOR 与 ReplicaCAD 完全同约定(X-90° 旋转 + (x,-z,y) 平移);**ProcTHOR stage 额外需要绕 Y 轴 -90°**(脚本已自动处理,与 ManiSkill 官方 ai2thor scene builder 一致)。
38
+
39
+ ## 已知坑(均已处理)
40
+
41
+ 1. **HSSD 资产的 GLTF 缺陷**:部分 GLB 有 `TEXCOORD_1` 而无 `TEXCOORD_0`。svulkan2 是懒解析(`take_picture()` 时才报错)且**失败会毒化 Vulkan 设备**(DeviceLost,进程内不可恢复)。→ `render_ai2thor.py` 内置纯 Python 的 GLB 静态体检+就地手术修复(原始文件保留为 `*.orig`,报告见 `output/cache/ai2thor/glb_lint_report.json`)。
42
+ 2. **封闭房间**:外部/航拍视角只能看到屋顶 → 脚本用室内全景(相机在物体中位数位置、地板+1.5m)。
43
+ 3. **大房子 AABB 中心可能在空区**:ProcTHOR 拼图相机取物体中位数位置而非包围盒中心。
44
+ 4. 物体无 `collision_asset`(AI2THOR 数据集不含碰撞)→ `visualize_scene_sapien.py` 的碰撞加载已加 try/except 回退为纯视觉加载(对 ReplicaCAD 向后兼容,回归测试通过)。
45
+
46
+ ## 其他可用场景(`python -m mani_skill.utils.download_asset -l scene`)
47
+
48
+ | UID | 说明 | 与本管线关系 |
49
+ |---|---|---|
50
+ | `ReplicaCAD` | 已有(1.6G) | ✅ 已跑通 |
51
+ | `AI2THOR` | HSSD 四系列 | ✅ 本文 |
52
+ | `ReplicaCADRearrange` (1.4G) | ReplicaCAD 之上的 rearrange 任务集(spawn_data/task_plans/train episodes:set_table/tidy_house/prepare_groceries) | episode 格式非 scene_instance.json,需新解析器才能变成场景 |
53
+ | `RoboCasa` (3.7G) | robosuite/MJCF 生态:YAML 厨房布局 + objaverse 物体 74k 个 | 格式完全不同,不兼容 habitat parser;物体 GLB 或可单独取用 |
54
+
55
+ `objects` 类别另有 ~200 个 partnet_mobility 铰接物体、`task_assets` 有 YCB 等,均非整场景。
docs/API_REFERENCE.md ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # API Reference
2
+
3
+ This document provides comprehensive documentation for reusable code components, utility libraries, and internal data structures used in ManiTaskGen.
4
+
5
+ ## Overview
6
+
7
+ * Geometry Processing Libraries
8
+ * VLM usage
9
+
10
+ ## Geometry Processing Libraries
11
+
12
+ ### Basic Geometries (`basic_geometries`)
13
+
14
+ ``src/geometry/basic_geometries.py`` provides fundamental geometric computation functionality in the codebase and is applied throughout various modules.
15
+
16
+ For detailed implementation, see [basic_geometry.md](basic_geometry.md)
17
+
18
+ ### Concave Processor (`concave_processor`)
19
+
20
+ The Concave Processor is responsible for handling and processing concave shapes when encountered concave affordable platforms (e.g. L-shaped kitchen counters) in 3D scenes.
21
+
22
+ For detailed implementation, see [concave_processor.md](concave_processor.md)
23
+
24
+ ### Convex Hull Processor (`convex_hull_processor`)
25
+
26
+ In the codebase, the bounding volumes of platforms and objects are simplified into 2D convex hulls in the XOY plane and corresponding cylindrical shapes with these hulls as bases. The Convex Hull Processor maintains the necessary computations for this process.
27
+
28
+
29
+ For detailed implementation, see [convex_hull_processor.md](convex_hull_processor.md)
30
+
31
+ ### Object Mesh Processor (`object_mesh_processor`)
32
+
33
+ The Object Mesh Processor is responsible for handling and processing 3D object meshes when building scene graphs and generating tasks.
34
+
35
+ For detailed implementation, see [object_mesh_processor.md](object_mesh_processor.md)
36
+
37
+ ## VLM Usage
38
+
39
+ ### VLM Agent Interface (`vlm_agent_interface`)
40
+
41
+ The VLM Agent Interface provides the mechanism for interacting with Vision Language Models (VLMs) in the codebase. Currently, the repository calls VLMs by hardcoding the OpenRouter API interface within the VLMEvalKit code.
42
+
43
+ For detailed implementation, see [calling_vlm.md](calling_vlm.md)
docs/Config Short Explanations.md ADDED
@@ -0,0 +1,565 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Configuration Parameters Documentation
2
+
3
+ This document describes all available configuration parameters in the task generation system.
4
+
5
+
6
+ ## Running
7
+
8
+
9
+ run_
10
+
11
+ ## Table of Contents
12
+
13
+ - [Configuration Parameters Documentation](#configuration-parameters-documentation)
14
+ - [Running](#running)
15
+ - [Table of Contents](#table-of-contents)
16
+ - [Raw Scene Configuration (RawSceneConfig)](#raw-scene-configuration-rawsceneconfig)
17
+ - [SAPIEN Configuration (SapienConfig)](#sapien-configuration-sapienconfig)
18
+ - [Path Configuration](#path-configuration)
19
+ - [Rendering Configuration](#rendering-configuration)
20
+ - [Lighting Configuration](#lighting-configuration)
21
+ - [Material and Adjustment Configuration](#material-and-adjustment-configuration)
22
+ - [Shading Configuration](#shading-configuration)
23
+ - [File Configuration](#file-configuration)
24
+ - [Scene Type Configuration (SceneType)](#scene-type-configuration-scenetype)
25
+ - [Basic Geometry Configuration (BasicGeometryConfig)](#basic-geometry-configuration-basicgeometryconfig)
26
+ - [Image Renderer Configuration (ImageRendererConfig)](#image-renderer-configuration-imagerendererconfig)
27
+ - [Basic Rendering Parameters](#basic-rendering-parameters)
28
+ - [Camera Configuration](#camera-configuration)
29
+ - [Image Parameters](#image-parameters)
30
+ - [Optimization Parameters](#optimization-parameters)
31
+ - [Color Configuration](#color-configuration)
32
+ - [Concave Processor Configuration (ConcaveProcessorConfig)](#concave-processor-configuration-concaveprocessorconfig)
33
+ - [Ground Coverage Configuration (GroundCoverageConfig)](#ground-coverage-configuration-groundcoverageconfig)
34
+ - [Task Primitive Configuration (TaskPrimitiveConfig)](#task-primitive-configuration-taskprimitiveconfig)
35
+ - [Atomic Task Configuration (AtomicTaskConfig)](#atomic-task-configuration-atomictaskconfig)
36
+ - [Scene Configuration (SceneConfig)](#scene-configuration-sceneconfig)
37
+ - [OpenRouter Configuration (OpenRouterConfig)](#openrouter-configuration-openrouterconfig)
38
+ - [Mesh Processor Configuration (MeshProcessorConfig)](#mesh-processor-configuration-meshprocessorconfig)
39
+ - [VLM Interactor Configuration (VlmInteractorConfig)](#vlm-interactor-configuration-vlminteractorconfig)
40
+ - [Scene Element Configuration (SceneElementConfig)](#scene-element-configuration-sceneelementconfig)
41
+ - [Rectangle Query Configuration (RectangleQueryConfig)](#rectangle-query-configuration-rectanglequeryconfig)
42
+ - [Benchmark Executor Configuration (BenchmarkExecutorConfig)](#benchmark-executor-configuration-benchmarkexecutorconfig)
43
+ - [Basic Configuration](#basic-configuration)
44
+ - [File Path Configuration](#file-path-configuration)
45
+ - [Camera and Rotation Configuration](#camera-and-rotation-configuration)
46
+ - [Task Execution Configuration](#task-execution-configuration)
47
+ - [Feature Switches](#feature-switches)
48
+ - [Task Interaction Configuration (TaskInteractionConfig)](#task-interaction-configuration-taskinteractionconfig)
49
+ - [Configuration Manager](#configuration-manager)
50
+ - [Key Methods](#key-methods)
51
+ - [Utility Functions](#utility-functions)
52
+ - [Global Configuration](#global-configuration)
53
+ - [Core Feature Switches](#core-feature-switches)
54
+ - [File Path Configuration](#file-path-configuration-1)
55
+ - [Runtime Mode Configuration](#runtime-mode-configuration)
56
+ - [Task Configuration](#task-configuration)
57
+ - [Usage Examples](#usage-examples)
58
+ - [Configuration File Format](#configuration-file-format)
59
+ - [SAPIEN Configuration (SapienConfig)](#sapien-configuration-sapienconfig-1)
60
+ - [YAML Format](#yaml-format)
61
+ - [JSON Format](#json-format)
62
+
63
+ ## Raw Scene Configuration (RawSceneConfig)
64
+
65
+ ```
66
+
67
+ class RawSceneConfig:
68
+ dataset_root_path: str = (
69
+ "/mnt/windows_e/workplace/task_generation/replica_dataset" # Path to the Replica dataset root directory
70
+ )
71
+ object_config_path: str = (
72
+ "/mnt/windows_e/workplace/task_generation/replica_dataset/configs" # Path to the object configuration
73
+ )
74
+
75
+ desired_objects: List[str] = field(default_factory=lambda: None)
76
+ not_desired_objects: List[str] = field(
77
+ default_factory=lambda: [
78
+ "frl_apartment_handbag",
79
+ "frl_apartment_cushion_01",
80
+ "frl_apartment_monitor",
81
+ "frl_apartment_cloth_01",
82
+ "frl_apartment_cloth_02",
83
+ "frl_apartment_cloth_03",
84
+ "frl_apartment_cloth",
85
+ "frl_apartment_umbrella",
86
+ "frl_apartment_tv_screen",
87
+ "frl_apartment_indoor_plant_01",
88
+ "frl_apartment_monitor_stand",
89
+ "frl_apartment_setupbox",
90
+ "frl_apartment_beanbag",
91
+ "frl_apartment_bike_01",
92
+ "frl_apartment_bike_02",
93
+ "frl_apartment_indoor_plant_02",
94
+ "frl_apartment_picture_01",
95
+ "frl_apartment_towel",
96
+ "frl_apartment_rug_01",
97
+ "frl_apartment_rug_02",
98
+ "frl_apartment_rug_03",
99
+ "frl_apartment_mat",
100
+ "frl_apartment_tv_object",
101
+ ]
102
+ )
103
+ desired_articulations: List[str] = field(default_factory=lambda: None)
104
+ not_desired_articulations: List[str] = field(default_factory=lambda: None)
105
+
106
+ ```
107
+
108
+ Controls the loading and processing of raw scene data.
109
+
110
+ | Parameter | Type | Default Value | Description |
111
+ | --------------------------- | ----------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
112
+ | `dataset_root_path` | `str` | `/mnt/windows_e/workplace/task_generation/replica_dataset` | Path to the Replica dataset root directory |
113
+ | `object_config_path` | `str` | `/mnt/windows_e/workplace/task_generation/replica_dataset/configs` | Path to the object configuration |
114
+ | `desired_objects` | `List[str]` | `None` | List of desired objects to load. If it's set, only the objects in the list will be loaded to the scene. |
115
+ | `not_desired_objects` | `List[str]` | [See code] | List of objects to exclude, includes various furniture and decorative items |
116
+ | `desired_articulations` | `List[str]` | `None` | List of desired articulated objects |
117
+ | `not_desired_articulations` | `List[str]` | `None` | List of articulated objects to exclude |
118
+
119
+ ## SAPIEN Configuration (SapienConfig)
120
+
121
+ Configuration parameters for the SAPIEN physics simulation engine.
122
+
123
+ ### Path Configuration
124
+ | Parameter | Type | Default Value | Description |
125
+ | ----------------------- | ----- | ------------------------------------------------------------ | --------------------------------- |
126
+ | `dataset_root_path` | `str` | `/mnt/windows_e/workplace/task_generation/replica_dataset` | SAPIEN dataset root directory |
127
+ | `visual_path_prefix` | `str` | `/mnt/windows_e/workplace/task_generation/replica_dataset/objects` | Path prefix for visual objects |
128
+ | `collision_path_prefix` | `str` | `/mnt/windows_e/workplace/task_generation/replica_dataset/objects/convex` | Path prefix for collision objects |
129
+ | `urdf_path_prefix` | `str` | `/mnt/windows_e/workplace/task_generation/replica_dataset/urdf` | Path prefix for URDF files |
130
+
131
+ ### Rendering Configuration
132
+ | Parameter | Type | Default Value | Description |
133
+ | ---------------------- | ------- | ------------- | -------------------- |
134
+ | `camera_shader` | `str` | `"default"` | Camera shader type |
135
+ | `ray_tracing_denoiser` | `str` | `"none"` | Ray tracing denoiser |
136
+ | `time_step` | `float` | `0.01` | Simulation time step |
137
+ | `ground_altitude` | `float` | `0.0` | Ground altitude |
138
+
139
+ ### Lighting Configuration
140
+ | Parameter | Type | Default Value | Description |
141
+ | ------------------- | ------------- | ----------------- | ------------------------------- |
142
+ | `ambient_light` | `List[float]` | `[0.5, 0.5, 0.5]` | Ambient light color |
143
+ | `directional_light` | `List[Dict]` | [See code] | Directional light configuration |
144
+ | `point_lights` | `List[Dict]` | [See code] | Point light configuration list |
145
+
146
+ ### Material and Adjustment Configuration
147
+ | Parameter | Type | Default Value | Description |
148
+ | -------------------------- | ---------------- | ------------- | ---------------------------------- |
149
+ | `default_material` | `Dict[str, Any]` | [See code] | Default material properties |
150
+ | `cushion_z_offset` | `float` | `0.1` | Z offset for cushions |
151
+ | `urdf_z_adjustment_offset` | `float` | `0.005` | Z adjustment offset for URDF files |
152
+ | `rotation_offset_x` | `int` | `90` | Rotation offset in degrees |
153
+ | `correction_rotation_x` | `int` | `-90` | Correction rotation in degrees |
154
+
155
+ ### Shading Configuration
156
+ | Parameter | Type | Default Value | Description |
157
+ | -------------------------- | ----------- | ------------- | ------------------------------- |
158
+ | `excluded_shading_objects` | `List[str]` | `["book_03"]` | Objects to exclude from shading |
159
+ | `default_shading_mode` | `int` | `1` | Default shading mode |
160
+
161
+ ### File Configuration
162
+ | Parameter | Type | Default Value | Description |
163
+ | --------------------- | ----- | ----------------------------- | ------------------------ |
164
+ | `default_json_file` | `str` | `"replica_apt_0_parsed.json"` | Default JSON file name |
165
+ | `default_output_file` | `str` | `"entities_apt_0.json"` | Default output file name |
166
+
167
+ ## Scene Type Configuration (SceneType)
168
+
169
+ Defines scene type related behavior parameters.
170
+
171
+ | Parameter | Type | Default Value | Description |
172
+ | --------------------------- | ------ | ------------- | --------------------------------------------------------- |
173
+ | `NEED_COLLISION_ADJUSTMENT` | `bool` | `True` | Whether to use collision detection for gravity adjustment |
174
+ | `RGBD_SCENE` | `bool` | `False` | Whether to use RGBD scene (treats all objects as cuboids) |
175
+
176
+ ## Basic Geometry Configuration (BasicGeometryConfig)
177
+
178
+ Configuration parameters for basic geometry calculations.
179
+
180
+ | Parameter | Type | Default Value | Description |
181
+ | --------- | ------- | ------------- | --------------------------------------------- |
182
+ | `EPS` | `float` | `1e-5` | Precision threshold for geometry calculations |
183
+
184
+ ## Image Renderer Configuration (ImageRendererConfig)
185
+
186
+ Configuration parameters related to image rendering.
187
+
188
+ ### Basic Rendering Parameters
189
+ | Parameter | Type | Default Value | Description |
190
+ | --------------------- | ------------- | --------------------------------------- | -------------------------------- |
191
+ | `EPS` | `float` | `1e-6` | Rendering precision threshold |
192
+ | `default_fovy` | `float` | `np.deg2rad(60.0)` | Default field of view in radians |
193
+ | `default_fovy_range` | `List[float]` | `[np.deg2rad(10.0), np.deg2rad(100.0)]` | Field of view range |
194
+ | `default_focus_ratio` | `float` | `0.5` | Default focus ratio |
195
+ | `default_near` | `float` | `0.1` | Near clipping plane distance |
196
+ | `default_far` | `float` | `100.0` | Far clipping plane distance |
197
+
198
+ ### Camera Configuration
199
+ | Parameter | Type | Default Value | Description |
200
+ | ------------------- | ------------- | ------------------------- | ----------------------------- |
201
+ | `default_camera_xy` | `List[float]` | `[0.0, 0.0]` | Default camera XY position |
202
+ | `z_range` | `List[float]` | `[0.2, 2.5]` | Camera Z-axis range |
203
+ | `roll_range` | `List[float]` | `[-np.pi/900, np.pi/900]` | Roll angle range (very small) |
204
+
205
+ ### Image Parameters
206
+ | Parameter | Type | Default Value | Description |
207
+ | ------------------ | ------- | ------------- | ----------------------- |
208
+ | `width` | `int` | `1920` | Image width |
209
+ | `height` | `int` | `1080` | Image height |
210
+ | `font_size` | `int` | `48` | Font size |
211
+ | `number_font_size` | `int` | `40` | Number font size |
212
+ | `trans_visiblity` | `float` | `0.2` | Transparency visibility |
213
+
214
+ ### Optimization Parameters
215
+ | Parameter | Type | Default Value | Description |
216
+ | -------------------------------- | ------- | ------------- | ------------------------------------- |
217
+ | `default_scipy_minimize_ftol` | `float` | `1e-3` | SciPy optimization function tolerance |
218
+ | `default_scipy_minimize_maxiter` | `int` | `250` | SciPy optimization maximum iterations |
219
+
220
+ ### Color Configuration
221
+ | Parameter | Type | Default Value | Description |
222
+ | -------------------------- | ---------------------------- | ------------- | ----------------------------------------------------- |
223
+ | `high_contrast_color_list` | `List[Tuple[int, int, int]]` | [See code] | High contrast color list with 27 different RGB colors |
224
+
225
+ ## Concave Processor Configuration (ConcaveProcessorConfig)
226
+
227
+ Configuration parameters for processing concave geometries.
228
+
229
+ | Parameter | Type | Default Value | Description |
230
+ | --------------------- | ------- | ------------- | ----------------------------------------------------------- |
231
+ | `eps` | `float` | `1e-4` | Precision threshold |
232
+ | `min_polygon_area` | `float` | `0.1` | Minimum polygon area threshold |
233
+ | `target_aspect_ratio` | `float` | `1.8` | Target aspect ratio |
234
+ | `max_target_strips` | `int` | `4` | Maximum target strips |
235
+ | `merge_tolerance` | `float` | `0.01` | Merging tolerance |
236
+ | `concave_threshold` | `float` | `0.2` | Concavity threshold for determining if a polygon is concave |
237
+ | `concave_min_area` | `float` | `1e-5` | Minimum concave polygon area threshold |
238
+
239
+ ## Ground Coverage Configuration (GroundCoverageConfig)
240
+
241
+ Configuration parameters for ground coverage analysis.
242
+
243
+ | Parameter | Type | Default Value | Description |
244
+ | --------------- | ------------- | ------------------------ | ------------------------------------------ |
245
+ | `eps` | `float` | `1e-3` | Precision threshold |
246
+ | `resolution` | `float` | `0.01` | Grid resolution in meters |
247
+ | `min_rect_size` | `float` | `0.4` | Minimum rectangle size |
248
+ | `global_bounds` | `List[float]` | `[-5.0, 5.0, -5.0, 5.0]` | Global bounds (min_x, max_x, min_y, max_y) |
249
+ | `z_range` | `List[float]` | `[0.2, 1]` | Z-axis range |
250
+
251
+ ## Task Primitive Configuration (TaskPrimitiveConfig)
252
+
253
+ Configuration parameters for task primitives.
254
+
255
+ | Parameter | Type | Default Value | Description |
256
+ | -------------------- | ----------- | ------------------------------------------------------ | ------------------------------------------- |
257
+ | `default_action` | `str` | `"move"` | Default action type |
258
+ | `support_directions` | `List[str]` | [See code] | List of supported directions (9 directions) |
259
+ | `support_relations` | `List[str]` | `["at", "on", "in", "around", "between", "freespace"]` | List of supported spatial relations |
260
+
261
+ ## Atomic Task Configuration (AtomicTaskConfig)
262
+
263
+ Configuration parameters for atomic tasks.
264
+
265
+ | Parameter | Type | Default Value | Description |
266
+ | ----------------- | ----- | ------------- | -------------------------------- |
267
+ | `max_task_length` | `int` | `5` | Maximum length of an atomic task |
268
+ | `max_task_num` | `int` | `1000` | Maximum number of atomic tasks |
269
+
270
+ ## Scene Configuration (SceneConfig)
271
+
272
+ Scene-related configuration parameters.
273
+
274
+ | Parameter | Type | Default Value | Description |
275
+ | ------------------------- | ------------- | ------------------------ | ------------------------------------- |
276
+ | `global_bounds` | `List[float]` | `[-5.0, 5.0, -5.0, 5.0]` | Global bounds |
277
+ | `safety_margin` | `float` | `0.1` | Safety margin |
278
+ | `collision_check_enabled` | `bool` | `True` | Whether to enable collision detection |
279
+
280
+ ## OpenRouter Configuration (OpenRouterConfig)
281
+
282
+ Configuration parameters for OpenRouter API.
283
+
284
+ | Parameter | Type | Default Value | Description |
285
+ | --------- | ----- | ------------------------------------------------ | ------------------ |
286
+ | `api_key` | `str` | `"Bearer sk-or-v1-YOUR_OPENROUTER_API_KEY_HERE"` | OpenRouter API key |
287
+ | `model` | `str` | `"google/gemini-2.5-flash-lite-preview-06-17"` | Model name to use |
288
+
289
+ ## Mesh Processor Configuration (MeshProcessorConfig)
290
+
291
+ Configuration parameters for mesh processing.
292
+
293
+ | Parameter | Type | Default Value | Description |
294
+ | --------------------- | ------- | ------------- | -------------------------------------- |
295
+ | `min_size` | `float` | `0.0025` | Minimum size |
296
+ | `relative_size_ratio` | `float` | `0.25` | Relative size ratio |
297
+ | `EPS` | `float` | `1e-6` | Precision threshold |
298
+ | `coverage_threshold` | `float` | `0.6` | Coverage threshold |
299
+ | `height_threshold` | `float` | `0.01` | Minimum height threshold for platforms |
300
+
301
+ ## VLM Interactor Configuration (VlmInteractorConfig)
302
+
303
+ Configuration parameters for Vision-Language Model interactor.
304
+
305
+ | Parameter | Type | Default Value | Description |
306
+ | ----------------------- | ----- | ------------- | ------------------------- |
307
+ | `MAX_INTERACTION_COUNT` | `int` | `20` | Maximum interaction count |
308
+
309
+ ## Scene Element Configuration (SceneElementConfig)
310
+
311
+ Configuration parameters for scene element processing.
312
+
313
+ | Parameter | Type | Default Value | Description |
314
+ | ------------------------- | ------- | ------------- | -------------------------------- |
315
+ | `contact_eps` | `float` | `5e-2` | Contact precision threshold |
316
+ | `bbox_eps` | `float` | `4e-1` | Bounding box precision threshold |
317
+ | `ground_level_correction` | `float` | `1e-4` | Ground level correction |
318
+
319
+ ## Rectangle Query Configuration (RectangleQueryConfig)
320
+
321
+ Configuration parameters for rectangle queries.
322
+
323
+ | Parameter | Type | Default Value | Description |
324
+ | --------- | ------- | ------------- | ------------------- |
325
+ | `EPS` | `float` | `1e-3` | Precision threshold |
326
+
327
+ ## Benchmark Executor Configuration (BenchmarkExecutorConfig)
328
+
329
+ Configuration parameters for benchmark executor.
330
+
331
+ ### Basic Configuration
332
+ | Parameter | Type | Default Value | Description |
333
+ | ----------------------------- | ----- | ------------- | ------------------------------------ |
334
+ | `max_interaction_count` | `int` | `20` | Maximum interaction count |
335
+ | `picture_width` | `int` | `1366` | Picture width |
336
+ | `picture_height` | `int` | `768` | Picture height |
337
+ | `intermediate_task_max_score` | `int` | `4` | Maximum score for intermediate tasks |
338
+
339
+ ### File Path Configuration
340
+ | Parameter | Type | Default Value | Description |
341
+ | -------------------------- | --------------- | ------------------------------------------------ | ---------------------------- |
342
+ | `prompt_templates_path` | `str` | `"src/utils/prompts/benchmark_prompts.json"` | Prompt templates path |
343
+ | `reflection_prompts_path` | `str` | `"src/utils/prompts/reflection_prompts.json"` | Reflection prompts path |
344
+ | `image_save_base_path` | `str` | `"image4interact/"` | Base path for saving images |
345
+ | `reflection_txt_load_path` | `Optional[str]` | `"./load_reflection.txt"` | Reflection text loading path |
346
+ | `reflection_txt_save_path` | `Optional[str]` | `"./save_reflection.txt"` | Reflection text saving path |
347
+
348
+ ### Camera and Rotation Configuration
349
+ | Parameter | Type | Default Value | Description |
350
+ | ---------------------------- | ------- | ------------- | ---------------------------------------- |
351
+ | `default_standing_direction` | `int` | `0` | Default standing direction |
352
+ | `rotation_step` | `int` | `2` | Rotation step |
353
+ | `max_rotation_attempts` | `int` | `4` | Maximum rotation attempts |
354
+ | `default_fovy_deg_min` | `float` | `40.0` | Default minimum field of view in degrees |
355
+ | `default_fovy_deg_max` | `float` | `60.0` | Default maximum field of view in degrees |
356
+ | `focus_ratio` | `float` | `0.6` | Focus ratio |
357
+
358
+ ### Task Execution Configuration
359
+ | Parameter | Type | Default Value | Description |
360
+ | -------------------------- | ------- | ------------- | ----------------------------------- |
361
+ | `task_timeout_seconds` | `float` | `300.0` | Task timeout in seconds |
362
+ | `enable_detailed_logging` | `bool` | `False` | Whether to enable detailed logging |
363
+ | `save_interaction_history` | `bool` | `True` | Whether to save interaction history |
364
+ | `validate_actions` | `bool` | `True` | Whether to validate actions |
365
+ | `allow_invalid_actions` | `bool` | `False` | Whether to allow invalid actions |
366
+
367
+ ### Feature Switches
368
+ | Parameter | Type | Default Value | Description |
369
+ | --------------------------------- | ------ | ------------- | ------------------------------------------------- |
370
+ | `auto_rotate_enabled` | `bool` | `True` | Whether to enable auto rotation |
371
+ | `visibility_check_enabled` | `bool` | `True` | Whether to enable visibility check |
372
+ | `object_naming_for_interaction` | `bool` | `True` | Whether to enable object naming for interaction |
373
+ | `platform_naming_for_interaction` | `bool` | `True` | Whether to enable platform naming for interaction |
374
+
375
+ ## Task Interaction Configuration (TaskInteractionConfig)
376
+
377
+ Task interaction specific configuration parameters.
378
+
379
+ | Parameter | Type | Default Value | Description |
380
+ | -------------------------------- | ------ | ------------- | ----------------------------------------- |
381
+ | `enable_hint_prompts` | `bool` | `True` | Whether to enable hint prompts |
382
+ | `enable_ambiguous_item_handling` | `bool` | `True` | Whether to enable ambiguous item handling |
383
+ | `enable_reflection_prompts` | `bool` | `True` | Whether to enable reflection prompts |
384
+
385
+ ## Configuration Manager
386
+
387
+ The `ConfigManager` class provides methods to load, save, and manage configurations.
388
+
389
+ ### Key Methods
390
+
391
+ | Method | Description |
392
+ | ------------------------------- | ----------------------------------------------------- |
393
+ | `load_config(config_file_path)` | Load configuration from file (supports YAML and JSON) |
394
+ | `load_from_yaml(config_path)` | Load configuration from YAML file |
395
+ | `load_from_json(config_path)` | Load configuration from JSON file |
396
+ | `update_from_args(args)` | Update configuration from command line arguments |
397
+ | `save_to_yaml(config_path)` | Save current configuration to YAML file |
398
+ | `save_to_json(config_path)` | Save current configuration to JSON file |
399
+ | `print_config()` | Print current configuration |
400
+
401
+ ### Utility Functions
402
+
403
+ | Function | Return Type | Description |
404
+ | --------------------------------- | ------------------------- | -------------------------------------------------------- |
405
+ | `get_config()` | `AppConfig` | Get global configuration |
406
+ | `get_config_manager()` | `ConfigManager` | Get the global config manager instance |
407
+ | `get_ground_coverage_config()` | `GroundCoverageConfig` | Get ground coverage configuration |
408
+ | `get_image_renderer_config()` | `ImageRendererConfig` | Get image renderer configuration |
409
+ | `get_concave_processor_config()` | `ConcaveProcessorConfig` | Get concave processor configuration |
410
+ | `get_atomic_task_config()` | `AtomicTaskConfig` | Get atomic task configuration |
411
+ | `get_scene_config()` | `SceneConfig` | Get scene configuration |
412
+ | `get_scene_type_config()` | `SceneType` | Get scene type configuration |
413
+ | `get_basic_geometry_config()` | `BasicGeometryConfig` | Get basic geometry configuration |
414
+ | `get_openrouter_config()` | `OpenRouterConfig` | Get OpenRouter configuration |
415
+ | `get_mesh_processor_config()` | `MeshProcessorConfig` | Get mesh processor configuration |
416
+ | `get_vlm_interactor_config()` | `VlmInteractorConfig` | Get VLM interactor configuration |
417
+ | `get_scene_element_config()` | `SceneElementConfig` | Get scene element configuration |
418
+ | `get_rectangle_query_config()` | `RectangleQueryConfig` | Get rectangle query configuration |
419
+ | `get_raw_scene_config()` | `RawSceneConfig` | Get raw scene configuration |
420
+ | `get_sapien_config()` | `SapienConfig` | Get SAPIEN configuration |
421
+ | `get_benchmark_executor_config()` | `BenchmarkExecutorConfig` | Get benchmark executor configuration |
422
+ | `get_task_interaction_config()` | `TaskInteractionConfig` | Get task interaction configuration |
423
+ | `init_config(config_file_path)` | `None` | Initialize global configuration manager with config file |
424
+
425
+ ## Global Configuration
426
+
427
+ Global application configuration parameters.
428
+
429
+ ### Core Feature Switches
430
+ | Parameter | Type | Default Value | Description |
431
+ | --------------------- | ------ | ------------- | -------------------------------------------------- |
432
+ | `adjust_with_gravity` | `bool` | `True` | Whether to adjust gravity (may affect object pose) |
433
+ | `use_renaming_engine` | `bool` | `False` | Whether to use renaming engine |
434
+ | `bbox_only` | `bool` | `False` | Whether to use bounding box only |
435
+ | `cache_enabled` | `bool` | `True` | Whether to enable caching |
436
+
437
+ ### File Path Configuration
438
+ | Parameter | Type | Default Value | Description |
439
+ | --------------------------- | --------------- | --------------------------------- | ------------------------------------ |
440
+ | `input_json_path` | `Optional[str]` | [See code] | Scene file path |
441
+ | `output_json_path` | `Optional[str]` | `"./replica_apt_0_parsed.json"` | Output file path |
442
+ | `entity_json_path` | `Optional[str]` | `"./replica_apt_0_entities.json"` | Entity file path |
443
+ | `output_dir` | `str` | `"./output/"` | Output directory for results |
444
+ | `scene_graph_pkl_load_path` | `Optional[str]` | `"./scene_graph.pkl"` | Scene graph pickle file loading path |
445
+ | `scene_graph_pkl_save_path` | `Optional[str]` | `"./scene_graph.pkl"` | Scene graph pickle file saving path |
446
+ | `atomic_task_pkl_load_path` | `Optional[str]` | `None` | Atomic task pickle file loading path |
447
+ | `atomic_task_pkl_save_path` | `Optional[str]` | `None` | Atomic task pickle file saving path |
448
+ | `image4rename_path` | `Optional[str]` | `"./image4rename/"` | Image for renaming path |
449
+ | `image4interaction_path` | `Optional[str]` | `"./image4interaction/"` | Image for interaction path |
450
+ | `rename_dict_path` | `Optional[str]` | `"./rename_dict.json"` | Renaming dictionary path |
451
+ | `reflection_txt_load_path` | `Optional[str]` | `"./load_reflection.txt"` | Reflection text loading path |
452
+ | `reflection_txt_save_path` | `Optional[str]` | `"./save_reflection.txt"` | Reflection text saving path |
453
+ | `result_file_path` | `Optional[str]` | `"./result.txt"` | Result file saving path |
454
+
455
+ ### Runtime Mode Configuration
456
+ | Parameter | Type | Default Value | Description |
457
+ | ------------- | --------------- | ------------- | ------------------------------------ |
458
+ | `mode` | `str` | `"manual"` | Runtime mode ("online" or "offline") |
459
+ | `model_name` | `str` | `"human"` | Model name |
460
+ | `log_level` | `str` | `"INFO"` | Log level |
461
+ | `random_seed` | `Optional[int]` | `None` | Random seed |
462
+
463
+ ### Task Configuration
464
+ | Parameter | Type | Default Value | Description |
465
+ | ----------------------- | ------ | ------------- | --------------------------------- |
466
+ | `task_num` | `int` | `5` | Number of tasks to generate |
467
+ | `generate_mistake_note` | `bool` | `False` | Whether to generate mistake notes |
468
+ | `use_mistake_note` | `int` | `0` | Whether to use mistake notes |
469
+ | `use_lv3_task` | `bool` | `False` | Whether to use level 3 tasks |
470
+
471
+ ## Usage Examples
472
+
473
+ ```python
474
+ from config_manager import get_config, ConfigManager, init_config
475
+
476
+ # Initialize configuration with file
477
+ init_config("config.yaml")
478
+
479
+ # Get global configuration
480
+ config = get_config()
481
+
482
+ # Access specific configurations
483
+ image_config = config.image_renderer
484
+ sapien_config = config.sapien
485
+
486
+ # Modify configuration
487
+ config.task_num = 10
488
+ config.image_renderer.width = 1280
489
+ config.image_renderer.height = 720
490
+
491
+ # Load configuration from file
492
+ config_manager = ConfigManager("config.yaml")
493
+
494
+ # Save configuration
495
+ config_manager.save_to_yaml("output_config.yaml")
496
+ config_manager.save_to_json("output_config.json")
497
+
498
+ # Print current configuration
499
+ config_manager.print_config()
500
+ ```
501
+
502
+ ## Configuration File Format
503
+
504
+ Supports both YAML and JSON format configuration files. Example:
505
+
506
+ ## SAPIEN Configuration (SapienConfig)
507
+
508
+ | Parameter | Type | Description |
509
+ | ------------------- | ------------ | ------------------------------------------------------------ |
510
+ | `dataset_root_path` | `str` | SAPIEN dataset root directory |
511
+ | `point_lights` | `List[Dict]` | <details><summary>Point light configurations</summary>Array of 10 point light objects with position and color properties</details> |
512
+
513
+ <details>
514
+ <summary>Point Lights Default Configuration</summary>
515
+
516
+ ```python
517
+ [
518
+ {"position": [1.989, -5.822, 1], "color": [0.5, 0.5, 0.5]},
519
+ {"position": [2.15, -5.9, 1.0], "color": [0.4, 0.4, 0.4]},
520
+ # ... additional 8 point lights
521
+ ]
522
+ ```
523
+ </details>
524
+
525
+
526
+
527
+
528
+
529
+ ### YAML Format
530
+ ```yaml
531
+ image_renderer:
532
+ width: 1280
533
+ height: 720
534
+ default_fovy: 1.047
535
+
536
+ task_num: 10
537
+ mode: "offline"
538
+ log_level: "DEBUG"
539
+
540
+ ground_coverage:
541
+ resolution: 0.02
542
+ min_rect_size: 0.5
543
+
544
+ sapien:
545
+ time_step: 0.02
546
+ camera_shader: "rt"
547
+ ```
548
+
549
+ ### JSON Format
550
+ ```json
551
+ {
552
+ "image_renderer": {
553
+ "width": 1280,
554
+ "height": 720,
555
+ "default_fovy": 1.047
556
+ },
557
+ "task_num": 10,
558
+ "mode": "offline",
559
+ "log_level": "DEBUG",
560
+ "ground_coverage": {
561
+ "resolution": 0.02,
562
+ "min_rect_size": 0.5
563
+ }
564
+ }
565
+ ```
docs/FULL_CONFIG_REFERENCE.md ADDED
@@ -0,0 +1 @@
 
 
1
+ (To be updated)
docs/HABITAT_DATASETS.md ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Habitat 格式场景数据集:搜索结果与下载
2
+
3
+ 联网搜索(HF 数据集库 + 组织枚举 + 结构勘察)的结论:**habitat 组合格式(`scene_instance.json`,stage+object_instances)的公开可下载数据集只有两个家族**——ReplicaCAD 和 HSSD。其余常见 3D 室内数据集(HM3D/MP3D/Replica/Gibson/ScanNet/3D-FRONT/RoboCasa/Holodeck)要么是扫描单网格、要么是其他引擎格式、要么需要生成器。
4
+
5
+ ## 本次新下载的两个数据集
6
+
7
+ ### 1. `hssd/hssd-hab`(HSSD 原版,12.07GB,2025-02 更新)✅ 已全部下载并验证
8
+
9
+ 下载完整性:objects 56,228 / urdf 18,075 / stages 336 / scenes 168+161+168 / semantics 170 全部到位(多进程分片下载,见 `scripts/_dl_shard.py`)。
10
+
11
+ **人工设计的 211 个高真实感场景**(对比 ProcTHOR 程序生成更接近真实室内),18000+ 真实物体模型。这是 ManiSkill 镜像 `haosulab/AI2THOR` 的上游完整版。
12
+
13
+ | 目录 | 内容 |
14
+ |---|---|
15
+ | `scenes/` + `scenes-uncluttered/` + `scenes-articulated/` | 497 个 scene_instance(普通/去杂物/含铰接体 三种变体) |
16
+ | `stages/` | 168 个 stage glb(JPEG 纹理,SAPIEN 直接可渲染) |
17
+ | `objects/`(16 进制分片 + decomposed/openings/x) | ~18k 物体:glb + **collider.glb + object_config**(parser 的 collision_asset 键原生支持!) |
18
+ | `urdf/` | 1519 个铰接物体(抽屉柜/门等) |
19
+ | `semantics/`, `metadata/`, `scene_filter_files/` | 语义词典、物体统计、receptacle 过滤 |
20
+
21
+ **渲染管线**(`scripts/render_hssd.py`,复用 ManiTaskGen parser + Sapien)处理了四个 HSSD 特有难点:
22
+
23
+ 1. **KTX2/BasisU 纹理**:物体 glb 用 KTX2 纹理,svulkan2 不解码(渲染成无纹理白色)。→ `scripts/ktx2_tools/ktx2_node_decode.mjs`(wasm 版官方 basisu 转码器 + pngjs)批量转码为 PNG,`scripts/hssd_assets.py` 就地重写 GLB(原文件留 `.texorig`)。⚠️ 必须在任何渲染前完成——svulkan2 懒解析失败会**毒化 Vulkan 设备**(进程内无法恢复)。
24
+ 2. **non_uniform_scale**:86% 实例带非单位缩放(同一 hash 还有多种缩放复用),而 SAPIEN ActorBuilder 无 scale API。→ 把缩放烘焙进 GLB 根节点 scale,按 `(hash, scale)` 生成变体文件(`hssd_view/configs/objects/{hash}.sc_*.glb`)。
25
+ 3. **分片命名**:物体按 `objects/{hash首字符}/{hash}` 分片,且 parser 会把 template_name 剥成 basename 做平面查找。→ `data/datasets/hssd_view/configs/objects/` 平面视图目录(符号链接 + 变体)。
26
+ 4. **字段差异**:motion_type 小写、铰接体用 `base_type`、rotation 可能缺失。→ sanitize 统一补齐。
27
+
28
+ ```bash
29
+ python scripts/render_hssd.py # 默认场景
30
+ python scripts/render_hssd.py --demo # 三个场景
31
+ python scripts/render_hssd.py --scene data/datasets/hssd-hab/scenes/102344022.scene_instance.json
32
+ python scripts/render_hssd.py --scene data/datasets/hssd-hab/scenes-articulated/102343992.scene_instance.json # 含 24 个铰接体
33
+ python scripts/render_hssd.py --list # 场景清单
34
+ ```
35
+ 配置:`config/hssd_config.yml`。输出:`output/cache/hssd/`(2×2 室内全景拼图 + 四向 + 俯视 + parsed.json)。
36
+
37
+ **铰接版场景**(`scenes-articulated/`):HSSD 的 urdf 主链接以模型名命名(非 "body"),因此按全链接+冻结关节加载(与 `take_photo.py --full-articulation` 同机制);铰接体通常在别的房间,全景拼图看不到时可用 parsed.json 的位姿近拍(样例:`output/cache/hssd/articulated_closeup.png`)。
38
+
39
+ ### 2. `ai-habitat/ReplicaCAD_baked_lighting`(0.84GB)✅
40
+
41
+ 官方"烘焙光照"版 ReplicaCAD:**84 个 Baked_sc{0-4}_staging_{00-20} 变体场景**——家具全部并入 stage 网格并烘焙了全局光照(Photorealistic 版),每场景保留 6 个 URDF 铰接体(冰箱/橱柜/门等)。**渲染质量显著优于人工打光的普通版**(对照 `output/cache/baked/` vs `output/cache/verify2/`)。
42
+
43
+ ```bash
44
+ python scripts/render_baked.py [--demo|--list|--scene <json>]
45
+ ```
46
+ 配置:`config/replica_baked_config.yml`。两个适配点已自动化:URDF 里逗号分隔的数值属性归一化(`fix_urdf_commas`)、类别目录→模板名目录符号链接(`ensure_urdf_compat`)。
47
+
48
+ ## 下载工具
49
+
50
+ - `scripts/download_habitat_datasets.py`:snapshot_download 全量(hssd 12GB 较慢,~6文件/s)
51
+ - `scripts/_dl_shard.py`:按 objects 分片多进程并行(本机 7 进程 ≈ 4-5MB/s,本次实际使用)
52
+ - 失效系统代理 `10.66.66.1:8888` 必须 unset;HF token 在 `~/.cache/huggingface/token`(hssd-models 是 gated 的,无需它——未压缩版我们用不上)
53
+
54
+ ## 其他勘察结论(不下载的原因)
55
+
56
+ | 数据集 | 结论 |
57
+ |---|---|
58
+ | `hssd/hssd-models` (38GB) | hssd-hab 的未压缩纹理版;**gated**(需网页接受 CC BY-NC 协议)且我们已用 KTX2 转码解决 |
59
+ | `hssd/hssd-sstk` | 是 3D-FRONT 的 scenestate(fpModel),非 habitat ���式 |
60
+ | `hytang/VLN_scene_datasets` (2026-09) | hm3d.zip/mp3d.zip 扫描单网格 + VLN episode |
61
+ | `ai-habitat/hab3_bench_assets`、`hssd-partnr-ci` | HSSD 的小型子集 |
62
+ | `ai-habitat/OVMM_objects` | habitat 格式物体库(非场景),可作未来补充 |
63
+ | RoboCasa / 3D-FRONT / Holodeck | MJCF / 自有 JSON / 需本地生成,均不兼容现有 parser |
docs/INSTALLATION.md ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ManiTaskGen Installation Instructions
2
+
3
+
4
+ This document provides instructions for installing and setting up the ManiTaskGen environment.
5
+
6
+
7
+
8
+ ## Create and activate Conda environment
9
+
10
+ ```shell
11
+ conda create -n manitaskgen python=3.10.16
12
+ conda activate manitaskgen
13
+ ```
14
+
15
+ ## Clone the repository
16
+
17
+ ```shell
18
+ git clone https://github.com/bbbbbMatrix/ManiTaskGen.git
19
+ cd ManiTaskGen
20
+ cd src/vlm_interaction
21
+ git clone https://github.com/ManiacWallnut/VLMEvalKit.git
22
+ cd ../..
23
+ ```
24
+
25
+ ## Install dependencies and requirements
26
+
27
+ ```shell
28
+ bash install.sh
29
+ ```
30
+
31
+
32
+
33
+
34
+ ## Download datasets
35
+
36
+
37
+
38
+ ### AI2THOR and ReplicaCAD
39
+
40
+
41
+
42
+ ```shell
43
+ cd data
44
+ mkdir datasets
45
+ cd datasets
46
+
47
+ python -m mani_skill.utils.download_asset AI2THOR
48
+ cp -r /path/to/.maniskill/data/scene_datasets/ai2thor .
49
+
50
+
51
+ python -m mani_skill.utils.download_asset ReplicaCAD
52
+ cp -r /path/to/.maniskill/data/scene_datasets/replica_cad_dataset .
53
+ cd ../..
54
+ ```
55
+
56
+ Note that the dataset will be downloaded to the subfolder of maniskill module, and the absolute path will be shown after the dataset downloading command is finished.
57
+
58
+
59
+ If you have issues when downloading with maniskill, The datasets can also be downloaded from their repository on hugging-face website:
60
+
61
+ ``https://huggingface.co/datasets/haosulab/AI2THOR``
62
+
63
+ ``https://huggingface.co/datasets/haosulab/ReplicaCAD``
64
+
65
+
66
+ ### SUNRGBD
67
+
68
+ Download from the official website: https://rgbd.cs.princeton.edu/
69
+
70
+ ## Setting Up VLM APIs
71
+
72
+ We use [OpenRouter](https://openrouter.ai/) API to access both open-source and closed-source VLMs. To benchmark VLM agents, you need to set up your OpenRouter API key and model address in the configuration file or command line arguments.
73
+
74
+ Modify config in the ``common:openrouter:api_key`` column with your API key. There are multiple places in the project that call VLM for different purposes,
75
+ requiring modifications in different parts of the config. Please refer to [ReadMe.md](./ReadMe.md) for details.
76
+
77
+
78
+ For more details on using the OpenRouter API, refer to the OpenRouter [official documentation](https://openrouter.ai/docs/quickstart).
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+