This repository provides a streamlined pipeline for room layout estimation in AR, optimized for Magic Leap 2. By integrating lightweight 2D boundary segmentation (ST-RoomNet), refined 2D and 3D line generation, and user-centric rendering, the system delivers robust performance and intuitive interaction. Clutter is reduced and structural clarity is enhanced, resulting in a comfortable, user-friendly experience. Future directions include exploring long-range depth sensing, advanced room layout models, and improved AR interfaces.
- Clone this repository to your local machine.
- Install dependencies with:
pip install -r requirements.txt
- Open and run
test.ipynb
to see the entire process demonstrated with an example dataset. - This notebook walks through:
- Initializing the environment
- Loading images and metadata
- Estimating layouts
- Rendering results for inspection
For real-world usage on Magic Leap 2, follow these steps:
-
Start the Monitoring Script
Runrun_monitor.bat
to begin monitoring for new images. This script continuously checks for fresh data coming from the Magic Leap 2 device. -
Run the Data-Capture Script
Executenewtxt.py
in parallel. This script handles capturing new images from the device. -
Automatic Indexing
Each newly captured image is automatically assigned an index inindex.json
located under thereceived_data
folder, alongside:- The color image
- The depth image
- Associated metadata
-
Rendering
Once the new images and metadata are received, the room layout estimation and rendering pipeline will process them for visualization.
- Run
run_monitor.bat
andnewtxt.py
as explained above. - Manually add an index in
index.json
. - Important Note: Because Unity uses a left-hand coordinate convention, there are slight differences in how lines are rendered here (for real time case) compared to the methodes shown in Section 2 (for verification case, all right-hand assumptions used). Nonetheless, the final outcomes have been verified to be correct during real-world rendering.
Enjoy exploring room layout estimation for AR/MR applications!