## Installation & Dependencies
You can create a conda environment called `diff`, by run following [bat file](./create_env.bat) on windows.
## Dataset
You can get top down render pictures from [3D-FRONT](https://tianchi.aliyun.com/specials/promotion/alibaba-3d-scene-dataset) and ours dataset
### Convert 3D-FRONT 
You need to convert 3D-FRONT data format into ours datat format.
1. Clone [3D-FRONT-ToolBox](https://github.com/3D-FRONT-FUTURE/3D-FRONT-ToolBox)
2. Copy [trans_3d_front.py](./trans_3d_front.py) to 3D-FRONT-ToolBox root directory
3. Download 3D-FRONT data from [webpage](https://tianchi.aliyun.com/specials/promotion/alibaba-3d-scene-dataset)
4. Modify `scene_dir` and `simple_json_path` in [trans_3d_front.py](./trans_3d_front.py)
5. run `python ./trans_3d_front.py`
Then you can get our data format in `simple_json_path` directory.

### Prepare dataset
You can get top-down view 2D pictures, obb, segment, text describes data by run `python ./layout_batch_gen.py`

## Train
### Frame condition training
This code runs on single machine with multi-GPU.
```commandline
python frame_cond_train.py
```
### Frame condition training
```commandline
python text_cond_train.py
```
### Yolo obb training
```commandline
python ./yolo/train_obb.py
```
### Yolo segment training
```commandline
python ./yolo/train_seg.py
```
## Interface And Evaluation Metrics
You can run interface on gradio web page.
```commandline
python gradio_demo.py
```
To evaluate FID, KID, POR, PIoU from rendered 2D images of generated and reference scenes, you can run:
```commandline
python frame_cond_batch_gen.py
```
