Skip to main content

Overview

In this guide, we’ll walk through the steps to upload your 3D and sensor fusion data to Nucleus.
  1. Create Dataset for LidarScenes
  2. Schematize and upload remote pointcloud JSONs
  3. Grant scale access to your data.
  4. Upload remote camera + schematize camera intrinsics
  5. Create pointcloud and camera image DatasetItems
  6. Collect the above into Frames
  7. Collect the above into LidarScenes
  8. Upload LidarScenes to Dataset
Nucleus supports 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 new Dataset 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 field camera_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 of Frame 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
Once you’ve constructed a JSON for each of your pointclouds, you can upload them to your favorite remote file system or cloud storage provider. Nucleus expects each 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 single DatasetItem, 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
All camera images should also be uploaded to a remote file system from which Scale can access URLs to each image. As for camera intrinsics like the dictionary above, we recommend serializing each camera’s intrinsics to JSON or a similar key-value format. These files should be organized such that it’s easy to link them back to their associated camera images. More on how we’ll use these in the next section.

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 construct LidarScene objects for upload via API. There are three main steps in this process:
  1. Create pointcloud and camera image DatasetItems
  2. Create Frames from 1.
  3. Create LidarScenes from 2.

DatasetItem

Pointclouds

Since we’ve already packaged much of the necessary pointcloud information into the JSON blobs, creating pointcloud DatasetItems 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 the camera_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
You can also make changes to an existing LidarScene. The add_frame method allows you to add or update frames in the sequence by index.
Add Frames to existing LidarScene
Similarly, you can add pointclouds and camera images to specific frames of a scene by index.
Add DatasetItems to existing LidarScene
A single scene can have at most 300 items (pointclouds or images). Support for larger scenes is under active development! In the meantime, we recommend splitting up your larger scenes such that each one has <300 items.

Uploading to Nucleus

We’ll upload to the Dataset 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
With your scenes and dataset ready, you can now upload to Nucleus!
Upload to Dataset
By setting the update flag to True, your upload will overwrite any existing scene- or item-level metadata for any collisions on reference_id.
A note on update=TrueNucleus expects scenes to maintain the same structure in terms of frame sequence, and items per frame.Intended scene/frame updates with a different structure will be ignored.