How to Convert Floorplans to 3D Scenes with Plan2Scene

Oct 20, 2023 | Data Science

Are you intrigued by the fascinating world of 3D modeling? Would you like to transform your 2D floorplans into lifelike 3D scenes? Well, you’re in the right place! In this guide, we’ll walk through the steps required to use the Plan2Scene framework effectively. Trust me, it’s much simpler than navigating a maze!

Understanding the Plan2Scene Framework

Imagine if a talented architect could magically turn a drawing of a house (the floorplan) into a stunning, three-dimensional model right before your eyes. That’s precisely what Plan2Scene does! It takes flat images and photos and turns them into realistic 3D meshes, allowing you to walk through your virtual living spaces.

Setting Up Your Environment

Before diving into the heart of the process, you need to set up your development environment properly. Follow these steps:

  • Create a Conda Environment: Set up your environment as described in the conda setup guide.
  • Install Texture Synthesis:
    • Set up the command line library from Embark Studios texture-synthesis.
    • You can download the pre-built binary here or build it from source.
    • Download the seam mask here.
    • Rename the configuration file and update the paths to the texture synthesis binary.

Preparing Your Data

The process begins with collecting and processing data. Here’s how you set it up:

  • Download the Rent3D++ Dataset: Copy it to the [PROJECT_ROOT]/data directory. You can get it here.
  • Select Ground Truth Reference Crops: This involves running several Python scripts to generate reference crops for training. Run the following commands one by one in your terminal:
python codes/scripts/plan2scene/preprocessing/generate_reference_crops.py .data/processed/gt_reference/train .data/input/photo_assignments/train train
python codes/scripts/plan2scene/preprocessing/generate_reference_crops.py .data/processed/gt_reference/val .data/input/photo_assignments/val val
python codes/scripts/plan2scene/preprocessing/generate_reference_crops.py .data/processed/gt_reference/test .data/input/photo_assignments/test test

Running Inference on the Dataset

Now comes the fun part—running inference! Here’s how you do it efficiently:

  • Fill Room Embeddings: Use the following command, adjusting the drop value as necessary:
python codes/scripts/plan2scene/preprocessing/fill_room_embeddings.py .data/processed/texture_gen/test drop_0.0 test --drop 0.0
  • Propagate Textures: This command will help propagate the textures to unobserved surfaces.
python codes/scripts/plan2scene/texture_prop/gnn_texture_prop.py .data/processed/gnn_proptest/drop_0.0 .data/processed/vgg_crop_select/test/drop_0.0 test GNN_PROP_CONF_PATH GNN_PROP_CHECKPOINT_PATH --keep-existing-predictions --drop 0.0

Previewing and Rendering Your Output

After successfully running the inference, you’ll want to visualize the results:

  • Correcting Textures: Use the following command to correct seams of predicted textures:
python codes/scripts/plan2scene/postprocessing/seam_correct_textures.py .data/processed/gnn_proptest/drop_0.0/tileable_texture_crops .data/processed/gnn_proptest/drop_0.0/texture_crops test --drop 0.0
  • Embedding Textures: Generate the .scene.json files using the embed_textures.py script.
python codes/scripts/plan2scene/postprocessing/embed_textures.py .data/processed/gnn_proptest/drop_0.0/archs .data/processed/gnn_proptest/drop_0.0/tileable_texture_crops test --drop 0.0

Troubleshooting Common Issues

If you run into snags along the way, don’t fret! Here are some troubleshooting tips:

  • Environment Issues: Ensure you have installed all dependencies as per the setup instructions.
  • Missing Data Files: Double-check that all datasets are in their respective directories.
  • Correct Paths: Ensure all paths in configuration files point to the right binaries and directories.
  • Model Initialization: If your results aren’t as expected, revisit the model training instructions to make sure everything is set correctly.

For additional insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Conclusion

By following these steps, you can effortlessly turn floorplans into stunning 3D models with Plan2Scene. Remember, patience is key! As you get accustomed to the workflows, this process will become as second nature as the back of your hand.

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox