Views
No views yet

1git clone https://github.com/VAST-AI-Research/MIDI-3D.git
2cd MIDI-3D1conda create -n midi python=3.10
2conda activate midi1# pytorch (select correct CUDA version)
2pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
3
4# other dependencies
5pip install -r requirements.txtpytorch3d package.pip install git+https://github.com/huanngzh/MV-AdapterEnsure the version of gradio isgradio==4.44.1. If the installation of mvadapter causes the gradio version to be updated, be sure to reinstall gradio.
pretrained_weights/MIDI-3D.python gradio_demo.pyscripts/grounding_sam.py. The following example command will produce a segmentation map in the ./segmentation.png.python -m scripts.grounding_sam --image assets/example_data/Cartoon-Style/04_rgb.png --labels lamp sofa table dog --output ./scripts/inference_midi.py. The following command will save the generated 3D scene output.glb in the output dir.python -m scripts.inference_midi --rgb assets/example_data/Cartoon-Style/00_rgb.png --seg assets/example_data/Cartoon-Style/00_seg.png --output-dir "./"--do-image-padding to the running scripts of MIDI.It may require about 30G of VRAM. PRs to optimize VRAM requirements are welcome!
python -m scripts.image_to_textured_scene --rgb_image assets/example_data/Cartoon-Style/01_rgb.png --seg_image assets/example_data/Cartoon-Style/01_seg.png --seed 42 --output output1data/3d-front
2├── 3D-FRONT-RENDER # rendered views
3│ ├── 0a8d471a-2587-458a-9214-586e003e9cf9 # house
4│ │ ├── Hallway-1213 # room
5│ │ ...
6├── 3D-FRONT-SCENE # 3d models (glb)
7│ ├── 0a8d471a-2587-458a-9214-586e003e9cf9 # house
8│ │ ├── Hallway-1213 # room
9│ │ │ ├── Table_e9b6f54f-1d29-47bf-ba38-db51856d3aa5_1.glb # object
10│ │ │ ...
11├── 3D-FRONT-SURFACE # point cloud (npy)
12│ ├── 0a8d471a-2587-458a-9214-586e003e9cf9 # house
13│ │ ├── Hallway-1213 # room
14│ │ │ ├── Table_e9b6f54f-1d29-47bf-ba38-db51856d3aa5_1.npy # object
15│ │ │ ...
16├── valid_room_ids.json # scene list
17├── valid_furniture_ids.json # object list
18├── midi_room_ids.json # scene list (subset used in midi)
19└── midi_furniture_ids.json # object list (subset used in midi)midi_room_ids.json as the testset, and the others as training set.Due to company reasons, we cannot open source our base model, which MIDI is finetuned from. We only provide the code for further fine-tuning the parameter weights of our open-sourced MIDI.
midi/systems/system_midi.py. Before training, you may need to modify some parameters about dataset paths in configs/train/finetune-midi.yaml.python launch.py --config configs/train/finetune-midi.yaml --train --gpu 0,1,2,3,4,5,6,7The key code can be found intest_stepofmidi/systems/system_midi.pyandmidi/utils/metrics.py.
1from huggingface_hub import snapshot_download
2
3REPO_ID = "VAST-AI/MIDI-3D"
4local_dir = "pretrained_weights/MIDI-3D"
5snapshot_download(repo_id=REPO_ID, local_dir=local_dir)data/3d-front directory, and then you can run the following script to evaluate MIDI on 3D-Front dataset. It will save the results in outputs/image2scene/test-3dfront/save, including generated 3D scenes and metrics.python launch.py --config configs/test/3dfront.yaml --test --gpu 0, # --gpu 0,1,2,3,4,5,6,7,data/3d-front, you should modify the config configs/test/3dfront.yaml, filling in the correct dataset path.@inproceedings{huang2025midi,
title={Midi: Multi-instance diffusion for single image to 3d scene generation},
author={Huang, Zehuan and Guo, Yuan-Chen and An, Xingqiao and Yang, Yunhan and Li, Yangguang and Zou, Zi-Xin and Liang, Ding and Liu, Xihui and Cao, Yan-Pei and Sheng, Lu},
booktitle={Proceedings of the Computer Vision and Pattern Recognition Conference},
pages={23646--23657},
year={2025}
}