Skip to content

Commit e06900f

Browse files
HochCCxinjie.wang
andauthored
feat(pipe): Add layout generation by text desc pipe and release v0.1.3. (#33)
* feat(pipe): Add layout generation pipe. * tag v0.1.3 * chore: update assets * update --------- Co-authored-by: xinjie.wang <xinjie.wang@gpu-4090-dev015.hogpu.cc>
1 parent e05095f commit e06900f

28 files changed

Lines changed: 2369 additions & 64 deletions

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,18 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0).
66

7+
## [0.1.3] - 2025-08-19
8+
### Feature
9+
- Release `layout-cli` 🏞️ Layout(Interactive 3D Worlds) Generation, generate interactive 3D scene from task description.
10+
11+
12+
## [0.1.2] - 2025-07-31
13+
### Feature
14+
- Release `scene3d-cli` 🌍 3D Scene Generation, generate a color mesh and 3DGS scene from text description.
15+
- Release docker file and docker image.
16+
717

8-
## [0.1.1] - 2025-07-xx
18+
## [0.1.1] - 2025-07-11
919
### Feature
1020
- Added intelligent quality checkers and auto-retry pipeline for `image-to-3d` and `text-to-3d`.
1121
- Added unit tests for quality checkers.

README.md

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
```sh
3131
git clone https://github.com/HorizonRobotics/EmbodiedGen.git
3232
cd EmbodiedGen
33-
git checkout v0.1.2
33+
git checkout v0.1.3
3434
git submodule update --init --recursive --progress
3535
conda create -n embodiedgen python=3.10.13 -y # recommended to use a new env.
3636
conda activate embodiedgen
@@ -194,8 +194,6 @@ CUDA_VISIBLE_DEVICES=0 scene3d-cli \
194194

195195
### 💬 Generate Layout from task description
196196

197-
🚧 *Coming Soon*
198-
199197
<table>
200198
<tr>
201199
<td><img src="apps/assets/layout1.gif" alt="layout1" width="360"/></td>
@@ -207,6 +205,47 @@ CUDA_VISIBLE_DEVICES=0 scene3d-cli \
207205
</tr>
208206
</table>
209207

208+
Text-to-image model based on SD3.5 Medium, usage requires agreement to the [model license](https://huggingface.co/stabilityai/stable-diffusion-3.5-medium). All models auto-downloaded at the first run.
209+
210+
You can generate any desired room as background using `scene3d-cli`. As each scene takes approximately 30 minutes to generate, we recommend pre-generating them for efficiency and adding them to `outputs/bg_scenes/scene_list.txt`.
211+
212+
We provided some sample background assets created with `scene3d-cli`. Download them(~4G) using `hf download xinjjj/scene3d-bg --repo-type dataset --local-dir outputs`.
213+
214+
Generating one interactive 3D scene from task description with `layout-cli` takes approximately 30 minutes.
215+
```sh
216+
layout-cli --task_descs "Place the pen in the mug on the desk" "Put the fruit on the table on the plate" \
217+
--bg_list "outputs/bg_scenes/scene_list.txt" --output_root "outputs/layouts_gen" --insert_robot
218+
```
219+
220+
<table>
221+
<tr>
222+
<td><img src="apps/assets/Iscene_demo1.gif" alt="Iscene_demo1" width="300"/></td>
223+
<td><img src="apps/assets/Iscene_demo2.gif" alt="Iscene_demo2" width="450"/></td>
224+
</tr>
225+
</table>
226+
227+
Run multiple tasks defined in `task_list.txt` in the backend.
228+
Remove `--insert_robot` if you don't consider the robot pose in layout generation.
229+
```sh
230+
CUDA_VISIBLE_DEVICES=0 nohup layout-cli \
231+
--task_descs "apps/assets/example_layout/task_list.txt" \
232+
--bg_list "outputs/bg_scenes/scene_list.txt" \
233+
--output_root "outputs/layouts_gens" --insert_robot > layouts_gens.log &
234+
```
235+
236+
Using `compose_layout.py`, you can recompose the layout of the generated interactive 3D scenes. (Support for texture editing and augmentation will be added later.)
237+
```sh
238+
python embodied_gen/scripts/compose_layout.py \
239+
--layout_path "outputs/layouts_gens/task_0000/layout.json" \
240+
--output_dir "outputs/layouts_gens/task_0000/recompose" --insert_robot
241+
```
242+
243+
We provide `sim-cli`, that allows users to easily load generated layouts into an interactive 3D simulation using the SAPIEN engine (will support for more simulators in future updates).
244+
245+
```sh
246+
sim-cli --layout_path "outputs/layouts_gens/task_0000/recompose/layout.json" \
247+
--output_dir "outputs/layouts_gens/task_0000/recompose/sapien_render" --robot_name "franka"
248+
```
210249

211250
### 🖼️ Real-to-Sim Digital Twin
212251

apps/assets/Iscene_demo1.gif

471 KB
Loading

apps/assets/Iscene_demo2.gif

875 KB
Loading
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Place the pen in the mug on the desk
2+
Get the pen from the table and put it inside the cup
3+
Put the fruit on the table on the plate
4+
Put the apples on the table on the plate
5+
Put the spoon on the plate in the table
6+
Put the green lid on the desk
7+
Put the pen on the tray
8+
Move the plate forward
9+
Move the lamp to the left
10+
Pick up the cup and put on the middle of the table
11+
Close the laptop
12+
Close the red jar with the lid on the table
13+
Pick the cloth and shove it in the box
14+
Pick up the marker from the table and put it in the bowl
15+
Pick up the charger and move it slightly to the left
16+
Move the jar to the left side of the desk
17+
Pick the rubik's cube on the top of the desk
18+
Move the mug to the right

apps/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def build_covariance_from_scaling_rotation(
189189
lighting_css = """
190190
<style>
191191
#lighter_mesh canvas {
192-
filter: brightness(1.8) !important;
192+
filter: brightness(1.9) !important;
193193
}
194194
</style>
195195
"""

embodied_gen/models/gs_model.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,15 @@ class RenderResult:
5151

5252
def __post_init__(self):
5353
if isinstance(self.rgb, torch.Tensor):
54-
rgb = self.rgb.detach().cpu().numpy()
55-
rgb = (rgb * 255).astype(np.uint8)
56-
self.rgb = cv2.cvtColor(rgb, cv2.COLOR_BGR2RGB)
54+
rgb = (self.rgb * 255).to(torch.uint8)
55+
self.rgb = rgb.cpu().numpy()[..., ::-1]
5756
if isinstance(self.depth, torch.Tensor):
58-
self.depth = self.depth.detach().cpu().numpy()
57+
self.depth = self.depth.cpu().numpy()
5958
if isinstance(self.opacity, torch.Tensor):
60-
opacity = self.opacity.detach().cpu().numpy()
61-
opacity = (opacity * 255).astype(np.uint8)
62-
self.opacity = cv2.cvtColor(opacity, cv2.COLOR_GRAY2RGB)
59+
opacity = (self.opacity * 255).to(torch.uint8)
60+
self.opacity = opacity.cpu().numpy()
6361
mask = np.where(self.opacity > self.mask_threshold, 255, 0)
64-
self.mask = mask[..., 0:1].astype(np.uint8)
62+
self.mask = mask.astype(np.uint8)
6563
self.rgba = np.concatenate([self.rgb, self.mask], axis=-1)
6664

6765

0 commit comments

Comments
 (0)