This PoC is based on Ubuntu 22.04, The machine is supposed to have x86-based CPU and NVIDIA GPU (optional).
If you don't have Python3, install it. If you want to setup in a virtual environment for python, install virtualenv.
$ sudo apt install python virtualenv- Firstly, visit the official Unity website and install Unity Hub. Or, run the following commands from that website.
$ wget -qO - https://hub.unity3d.com/linux/keys/public | gpg --dearmor | sudo tee /usr/share/keyrings/Unity_Technologies_ApS.gpg > /dev/null
$ sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/Unity_Technologies_ApS.gpg] https://hub.unity3d.com/linux/repos/deb stable main" > /etc/apt/sources.list.d/unityhub.list'
$ sudo apt update
$ sudo apt-get install unityhub- Then, visit the Unity archive and install Unity 2020.03.
$ git clone [email protected]:GT-Craft/Map_Streaming_SemanticExtraction.git
$ cd Map_Streaming_SemanticExtraction
$ virtualenv ./venv --python=python3
$ . ./venv/bin/activate
(venv) $ ./setup_cpu.sh # for non-GPU user
(venv) $ ./setup_cu118.sh # for Nvidia-GPU user with CUDA 11
(venv) $ pip install -r requirements.txtSince it takes long to train models, we provide pretrained models. You can skip this, or please refer README in the streaming and segmentation repo.
$ mkdir pretrained_models # under Map_Streaming_semanticExtraction
Download road and building from our shared drive.
Then, put them under the created directory pretrained_models.
You need to change the project/dataset directory in the scripts/config.json.
{
"PROJECT_DIR" : "YOUR_PROJECT_PATH/Map_Streaming_SemanticExtraction/",
"DATASET_DIR" : "YOUR_DATASET_PATH/Massachusett_Dataset/"
}
- Streaming Map and Elevation (can skip): This requires the MS map account and key for APIs. We describe how to set it up in README of the streaming and segmentation repo.
- Elevation Matrix Visualization: As we prepared the sample data, you can run
cd scripts && python elevation_visualizer.py - Road and Building Segmentation:
cd scripts && python road_buidling_segmentation.py - Training models (can skip): after setting the dataset directory,
cd scripts && python train_building.pyfor building segmentation model.cd scripts && python train_road.pyfor road segmentation model. - Validate trained models: you can validate the trained models on your target area with ground truth data. You can directly run
cd scripts && python validate_road_building.pywith sample data.
We prepared the post-processed road and building masks, elevation matrix, and map image under Assets/MapData. Thus, you can directly run this PoC.
$ git clone [email protected]:GT-Craft/VirtualSceneGeneration.gitAfter cloning the repository, you need to add it on Unity Hub with Unity 2020.
When starting the project, there is a PoC scene under Assets/Scenes. Open and run it.
After running the scene, when pressing 'r' key, it exports the scene in a USD file, and it can take some time.
As we attached the USD file of that scene in this repo, GeneratedScene.usd, you can open it in other USD-supporting software such as Blender.


