Skip to content

Commit 19ff9be

Browse files
authored
Updates to the NuRec documentation to address installation problems (#9386)
* nurec docs update * changed usdz path
1 parent c1ba734 commit 19ff9be

File tree

1 file changed

+40
-27
lines changed

1 file changed

+40
-27
lines changed

Docs/nvidia_nurec.md

Lines changed: 40 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
# Use NVIDIA Neural Reconstruction with CARLA
33

44
NVIDIA Neural Reconstruction (NuRec) refers to the reconstruction and rendering models and services from NVIDIA that support the seamless ingestion of real-world
5-
data converted to a simulated environment suitable for training and testing Physical AI Agents, including robotics and autononomous driving systems.
5+
data converted to a simulated environment suitable for training and testing Physical AI Agents, including robotics and autonomous driving systems.
66

77
With NuRec, developers can convert recorded camera and LIDAR data into 3D scenes. NuRec uses multiple AI networks to create
88
interactive 3D test environments where developers can modify the scene and see how the world reacts. Developers can change scenarios,
9-
add synthetic objects, and apply randomizations — such as a child following a bouncing ball into the road — making the initial scenarios
9+
add synthetic objects, and apply randomization — such as a child following a bouncing ball into the road — making the initial scenarios
1010
even more challenging. With the NuRec gRPC API, developers can bring rendering services directly to their simulation platform of choice, for example, CARLA.
1111

1212
The NuRec gRPC API serves as a conduit of data and rendering between the CARLA replay and the NuRec container, where the scenes are reconstructed and rendered. You can load pre-trained scenes from the NVIDIA Physical AI Dataset for Autonomous Vehicles and define your scenes using the NuRec gRPC API in a python script (`replay_recording.py`). The diagram below further illustrates the relationship between NuRec and CARLA.
@@ -35,12 +35,12 @@ To use neural rendering in your CARLA simulations, use the NVIDIA Neural Reconst
3535

3636
### Prerequisites
3737

38-
Before you get started, make sure you have satisifed the following prerequisites:
38+
Before you get started, make sure you have satisfied the following prerequisites:
3939

4040
- Ubuntu 22.04
41-
- [CARLA 0.9.16 or newer package installed](https://carla.readthedocs.io/en/latest/download/) (use the Nightly Build before the 0.9.16 release)
41+
- [Recent CARLA Nightly build package installed](https://carla.readthedocs.io/en/latest/download/)
4242
- [CUDA 12.8 or higher](https://developer.nvidia.com/cuda-downloads)
43-
- Python 3.10+
43+
- Python 3.10 (Python 3.11 and up not currently supported)
4444

4545
### Hugging face account
4646

@@ -57,9 +57,17 @@ The installation downloads some sample datasets from Hugging Face. To complete t
5757

5858
## Setup
5959

60+
In the following instructions, a CARLA_ROOT environment variable is used to locate the root directory of the CARLA package you have installed as a prerequisite. You should set this variable in your terminal or add the following line to your `.bashrc` profile:
61+
62+
```sh
63+
export CARLA_ROOT=/path/to/carla/package
64+
```
65+
66+
If you prefer not to set the CARLA_ROOT variable, replace `${CARLA_ROOT}` with the path to the CARLA package root folder in the following instructions.
67+
6068
### Prerequisite installation
6169

62-
The install script will attempt to install the following Ubuntu dependencies. To avoid installation problems, we recommend installing these dependencie before running the NuRec install.
70+
The install script will attempt to install the following Ubuntu dependencies. To avoid installation problems, we recommend installing these dependency before running the NuRec install.
6371

6472
**Docker**: The NuRec tool uses Docker images, therefore you need Docker installed on your system. The following packages are recommended:
6573

@@ -108,16 +116,20 @@ source vecarla/bin/activate # Activate the venv
108116

109117
Remember to activate the virtual environment in each new terminal session you open.
110118

111-
### Run the Installer Script
119+
!!! note
120+
Bear in mind that the virtual environment will be created in the folder where you run this command. In order to source the environment, you must be in the same directory where you ran this command. Once the *venv* is activated, you can then navigate to other directories as required. We recommend creating the *venv* in the `${CARLA_ROOT}` directory or the `${CARLA_ROOT}/PythonAPI/examples/nurec` directory.
121+
122+
### Run the installer Script
112123

113-
To get started quickly and easily with the curated sample set from the [NVIDIA PhysicalAI-Autonomous-Vehicles-NuRec dataset](https://huggingface.co/datasets/nvidia/PhysicalAI-Autonomous-Vehicles-NuRec), navigate to the CARLA root directory on your machine and run the following launch script:
124+
To get started quickly and easily with the curated sample set from the [NVIDIA PhysicalAI-Autonomous-Vehicles-NuRec dataset](https://huggingface.co/datasets/nvidia/PhysicalAI-Autonomous-Vehicles-NuRec), navigate to the CARLA root directory on your machine and run the NuRec installation script:
114125

115126
```bash
116-
cd <CARLA_ROOT>
117-
./PythonAPI/examples/nvidia/nurec/install_nurec.sh
127+
source vecarla/bin/activate # Activate the venv
128+
cd ${CARLA_ROOT}/PythonAPI/examples/nvidia/nurec/
129+
./install_nurec.sh
118130
```
119131

120-
The script helps you set your HuggingFace access token (if there isn't one already), sets the required environment variables for the NuRec container, pulls the curated sample dataset from HuggingFace, and installs the required Python packages.
132+
You will be asked to enter your HuggingFace token on the command line, ensure to have it at hand. The script installs the needed prerequisites and Python packages, sets the required environment variables for the NuRec container and downloads the curated sample dataset from HuggingFace.
121133

122134
The script will install the following Python packages:
123135

@@ -133,14 +145,18 @@ The script will install the following Python packages:
133145

134146
### Example datasets
135147

136-
The NuRec tool can make use of a large collection of pre-trained neural reconstruction datasets, the installer will download the collection from the [NVIDIA PhysicalAI-Autonomous-Vehicles-NuRec dataset on HuggingFace](https://huggingface.co/datasets/nvidia/PhysicalAI-Autonomous-Vehicles-NuRec). The dataset is ~200Gb in size so ensure that you have adequate hard drive space.
148+
The NuRec tool can make use of a large collection of pre-trained neural reconstruction datasets, the installer will download the collection from the [NVIDIA PhysicalAI-Autonomous-Vehicles-NuRec dataset on HuggingFace](https://huggingface.co/datasets/nvidia/PhysicalAI-Autonomous-Vehicles-NuRec). **The dataset is 1.52 terabytes in size so you must ensure that you have adequate hard drive space**. The script will download the dataset into a folder named *PhysicalAI-Autonomous-Vehicles-NuRec* in the `${CARLA_ROOT}/PythonAPI/examples/nvidia/nurec/` directory.
149+
150+
!!! note
151+
If you have previously run the installation script and encountered a problem, you may need to move or delete the *PhysicalAI-Autonomous-Vehicles-NuRec* folder. The script will assume the data is previously downloaded if this folder already exists.
137152

138153
### Python environment
139154

140-
If you are using a specific Python environtment, you should install the required Python packages by running the following command from the CARLA directory on your machine:
155+
If you are using a specific Python environment, you should install the required Python packages by running the following command:
141156

142-
```
143-
pip install -r requirements.txt
157+
```sh
158+
source vecarla/bin/activate # Activate the venv
159+
python3 -m pip install -r ${CARLA_ROOT}/PythonAPI/carla/requirements.txt
144160
```
145161

146162
### Set up your environment variables
@@ -159,25 +175,20 @@ The replay script uses two environment variables — `NUREC_IMAGE` and `CUDA_VIS
159175
160176
## Run the CARLA NuRec Replays
161177
162-
**1. Start the CARLA Server:** From the directory where your CARLA package exists, run the following command:
178+
**1. Launch the CARLA Server:** From the directory where your CARLA package exists, run the following command:
163179
164-
```
180+
```sh
181+
cd ${CARLA_ROOT}
165182
./CarlaUE4.sh
166183
```
167184

168-
**2. Replay a NuRec Scenario:** Once the CARLA server is running, open a new terminal window and navigate to the directory where your CARLA package exists, then replay a NuRec scenario with the `example_nurec_replay_save_images.py` script. We recommend using the NuRec version 25.07 datasets, which you will find in the `CARLA_ROOT/PythonAPI/examples/nvidia/nurec/PhysicalAI-Autonomous-Vehicles-NuRec/sample_set/25.07_release` directory.
185+
**2. Replay a NuRec Scenario:** Once the CARLA server is running, open a new terminal window and navigate to the directory where your CARLA package exists, then replay a NuRec scenario with the `example_nurec_replay_save_images.py` script. We recommend using the NuRec version 25.07 datasets, which you will find in the `${CARLA_ROOT}/PythonAPI/examples/nvidia/nurec/PhysicalAI-Autonomous-Vehicles-NuRec/sample_set/25.07_release` directory. Choose one of the example USD datasets from the *PhysicalAI-Autonomous-Vehicles-NuRec* directory to experiment with and copy the path and filename for the following command. To run the example, insert the path and filename of the example you chose into the following command and execute it:
169186

170-
* **Multi-camera replay:** The example script provides a complete, multi-view visualization system, ideal for understanding how to integrate various camera types and create comprehensive monitoring setups. When you run it, it replays simulations with multiple NuRec cameras (front, left cross, right cross) in different camera positions in a Pygame display grid. It also supports additional perspectives pulled from standard CARLA cameras attached to the ego vehicle and multiple camera feeds with different framerates and resolutions.
171-
172-
!!! note
173-
If you are using a virtual environment for Python version consistency, remember to activate the virtual environment with: `source vecarla/bin/activate`
174187

175188
```sh
176189
source vecarla/bin/activate # Omit if you are not using a venv
177-
cd PythonAPI/examples/nvidia/
178-
python example_nurec_replay_save_images.py --usdz-filename \
179-
PhysicalAI-Autonomous-Vehicles-NuRec/sample_set/25.07 \
180-
_release/026d6a39-bd8f-4175-bc61-fe50ed0403a3/026d6a39-bd8f-4175-bc61-fe50ed0403a3.usdz #--move-spectator --saveimages
190+
cd ${CARLA_ROOT}/PythonAPI/examples/nvidia/nurec/
191+
python3 example_nurec_replay_save_images.py --usdz-filename <path_to_example>/<usd_filename>.usdz #--move-spectator --saveimages
181192

182193
```
183194

@@ -187,7 +198,9 @@ _release/026d6a39-bd8f-4175-bc61-fe50ed0403a3/026d6a39-bd8f-4175-bc61-fe50ed0403
187198
* `--saveimages`: images rendered by NuRec cameras and CARLA cameras will be saved in a default directory named `data` created in the execution location of the script
188199
* `--output-dir`: specify the directory for the output images when using the `--saveimages` flag
189200

190-
* **Custom camera parameters:** If you need to replicate specific camera hardware or match real-world camera calibrations, you can specify the camera configuration in the YAML configuration file. You will find the camera configurations in the `carla_example_camera_config.yml` file in the same directory as the example scripts. Modify this file and re-launch the example script above. You can change the target YAML file on line 173 of the `example_nurec_replay_save_images.py` script:
201+
* **Multi-camera replay:** The example script provides a complete, multi-view visualization system, ideal for understanding how to integrate various camera types and create comprehensive monitoring setups. When you run it, it replays simulations with multiple NuRec cameras (front, left cross, right cross) in different camera positions in a Pygame display grid. It also supports additional perspectives pulled from standard CARLA cameras attached to the ego vehicle and multiple camera feeds with different framerates and resolutions.
202+
203+
* **Custom camera parameters:** If you want to replicate specific camera hardware or experiment with different camera configurations, you can specify the camera configuration in the YAML configuration file. You will find the camera configurations in the `carla_example_camera_config.yml` file in the same directory as the example scripts. Modify this file and re-launch the example script above. You can change the target YAML file on line 173 of the `example_nurec_replay_save_images.py` script:
191204

192205
```py
193206
# Add cameras using the new flexible add_camera method

0 commit comments

Comments
 (0)