Overview
In this guide, we’ll walk through the steps to upload your 2D image data to Nucleus.- Create
DatasetforDatasetItems - Create image
DatasetItems - Upload
DatasetItemstoDataset - Update metadata
Creating a Dataset
Get started by creating a new Dataset to which to upload your 2D data. If you do have an existing Dataset, you can retrieve it by its dataset ID. You can list information about all of your datasets using NucleusClient.datasets, or extract it from the Nucleus dashboard’s URL upon clicking into the Dataset.
Create new Dataset
Creating Image DatasetItems
Next, we’ll upload DatasetItems via API.
When uploading items via API, you’ll first need to construct DatasetItem payloads. The best way to do so is using the Python SDK’s DatasetItem constructor, which takes in a few parameters:
To keep your data from being uploaded to Scale, see Privacy Mode.
Example DatasetItem Creation
Uploading DatasetItems to Nucleus
We’ll upload to the Dataset created earlier in this guide. You can always retrieve a Dataset by its dataset ID. You can list all of your datasets’ IDs using NucleusClient.datasets, or extract one from the Nucleus dashboard’s URL upon clicking into the Dataset.
Get existing Dataset
Dataset.append.
Example upload to Dataset
Large Batch Uploads
Dataset.append always processes uploads asynchronously and returns an AsyncJob. The concurrent processing dramatically increases upload throughput.
For large uploads, we recommend storing your images remotely (e.g. in S3, GCS, or Azure Blob Storage) rather than uploading local files.
Updating Metadata
By setting theupdate=True in Dataset.append, your upload will overwrite metadata for any existing item with a shared reference_id.
For instance, in our example we uploaded an item with reference ID 107. We can overwrite this item’s metadata to include a new key-value pair as follows:
Example metadata update
Dashboard Upload
Using the Nucleus dashboard, you can upload directly from disk or import an existing Scale or Rapid labeling project.
Uploading local files from the dashboard (creates a new Dataset).