You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Docs/nvidia_nurec.md
+40-27Lines changed: 40 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,11 @@
2
2
# Use NVIDIA Neural Reconstruction with CARLA
3
3
4
4
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.
6
6
7
7
With NuRec, developers can convert recorded camera and LIDAR data into 3D scenes. NuRec uses multiple AI networks to create
8
8
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
10
10
even more challenging. With the NuRec gRPC API, developers can bring rendering services directly to their simulation platform of choice, for example, CARLA.
11
11
12
12
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
35
35
36
36
### Prerequisites
37
37
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:
39
39
40
40
- 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)
-[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)
44
44
45
45
### Hugging face account
46
46
@@ -57,9 +57,17 @@ The installation downloads some sample datasets from Hugging Face. To complete t
57
57
58
58
## Setup
59
59
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
+
60
68
### Prerequisite installation
61
69
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.
63
71
64
72
**Docker**: The NuRec tool uses Docker images, therefore you need Docker installed on your system. The following packages are recommended:
65
73
@@ -108,16 +116,20 @@ source vecarla/bin/activate # Activate the venv
108
116
109
117
Remember to activate the virtual environment in each new terminal session you open.
110
118
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
112
123
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:
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.
121
133
122
134
The script will install the following Python packages:
123
135
@@ -133,14 +145,18 @@ The script will install the following Python packages:
133
145
134
146
### Example datasets
135
147
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.
137
152
138
153
### Python environment
139
154
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:
@@ -159,25 +175,20 @@ The replay script uses two environment variables — `NUREC_IMAGE` and `CUDA_VIS
159
175
160
176
## Run the CARLA NuRec Replays
161
177
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:
163
179
164
-
```
180
+
```sh
181
+
cd ${CARLA_ROOT}
165
182
./CarlaUE4.sh
166
183
```
167
184
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:
169
186
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`
174
187
175
188
```sh
176
189
source vecarla/bin/activate # Omit if you are not using a venv
*`--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
188
199
*`--output-dir`: specify the directory for the output images when using the `--saveimages` flag
189
200
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:
191
204
192
205
```py
193
206
# Add cameras using the new flexible add_camera method
0 commit comments