Overview
In this guide, we’ll walk through the steps to upload your 3D and sensor fusion data to Nucleus.- Create
DatasetforLidarScenes - Schematize and upload remote pointcloud JSONs
- Grant scale access to your data.
- Upload remote camera + schematize camera intrinsics
- Create pointcloud and camera image
DatasetItems - Collect the above into
Frames - Collect the above into
LidarScenes - Upload
LidarScenestoDataset
LidarScenes, which are sequences of Frames for each timestep of capture. Each Frame is a collection of sensor data, namely a single lidar pointcloud with any number of associated camera images.
Dataset
We’ll begin by creating a newDataset to which to upload our 3D data. In order to create a Dataset to which you can upload LidarScenes you need to set the is_scene flag to True during creation.
Create new Dataset
Preparing Your Data
Nucleus expects a remote JSON for pointclouds and a remote image file. For camera images, Nucleus also expects a metadata fieldcamera_params, which gives details about the extrinsics and intrinsics of your camera sensor. This information is used to create integrated 2D visualizations such as cuboid projections and FOV highlighting.
Please refer to our API documentation for more specifics.
Granting Scale Access to Your Data
If you are using non-public cloud storage for your images, then you need to make sure your remote data is accessible to Scale by following this guide.Lidar Pointclouds
Lidar pointclouds must follow a specific JSON schema for uploads into Nucleus. This schema is very similar to that ofFrame payloads for Scale annotation projects. However, Nucleus payloads only pertain to the pointcloud and should not have camera information.
Pointcloud JSONs can have five properties:
The most important property to have is
points. Meanwhile, device_position and device_heading are helpful for calibrating a static offset of the sensor relative to the captured points. Providing device_gps_pose and timestamp is optional, but may prove helpful when querying your data in Nucleus.
Example lidar pointcloud JSON
DatasetItem to be initialized with the URL of a pointcloud JSON — we’ll show how to construct these in a later section.
Privacy ModeAs an enterprise customer, you can use Nucleus without ever transferring data onto Scale servers! Read more on Privacy Mode here.
Camera Images
Nucleus processes each camera image as a singleDatasetItem, even if there are multiple camera images associated with the same Frame (e.g. multiple angles captured at the same timestep).
Intrinsics and extrinsics for each camera, such as focal length or camera position and heading, should be organized into a Python dictionary as in the below example. These dictionaries should use the same schema as Scale annotation CameraImages, excluding the image_url property (schema defined here).
Example camera_params dict
Constructing Lidar Scenes
Now that your data is formatted properly, and you have granted access to your data to Scale, we can start using the Nucleus Python client to constructLidarScene objects for upload via API.
There are three main steps in this process:
- Create pointcloud and camera image
DatasetItems - Create
Framesfrom 1. - Create
LidarScenesfrom 2.
DatasetItem
Pointclouds
Since we’ve already packaged much of the necessary pointcloud information into the JSON blobs, creating pointcloudDatasetItems is very straightforward.
Camera Images
Camera intrinsics such as focal length or camera position and heading must be packaged as a dictionary and passed into image metadata using thecamera_params key. As mentioned, this dictionary must follow the schema defined here, excluding image_url.
Example camera image DatasetItem
Frame
Next, you’ll want to group your newly created pointcloud and camera image DatasetItems into Frames.
A Frame corresponds to a single timestep of sensor capture. It must contain exactly one pointcloud, and any number of camera images. Sensor names may be passed in as arbitrary keyword arguments, mapped to their respective DatasetItems.
Example Frame
LidarScene
After creating several Frames for each timestep of capture, you can string them together into a LidarScene.
Creating a LidarScene
LidarScene. The add_frame method allows you to add or update frames in the sequence by index.
Add Frames to existing LidarScene
Add DatasetItems to existing LidarScene
Uploading to Nucleus
We’ll upload to theDataset created earlier in this guide. You can always retrieve a Dataset by its dataset ID, which are always prefixed with ds_. You can list all of your datasets’ IDs using NucleusClient.list_datasets(), or extract one from the Nucleus dashboard’s URL upon clicking into the Dataset.
Get existing Dataset
Upload to Dataset
update flag to True, your upload will overwrite any existing scene- or item-level metadata for any collisions on reference_id.