Register Cloud Data
Using a JSON File (Recommended)
The following scripts initiate uploads from your cloud storage to a specified folder in Encord using a properly formatted JSON upload file. It works for all file types. Ensure that you:- Replace <private_key_path> with the path to your private key.
- Replace <integration_title> with the title of the integration you want to use.
- Replace <folder_name> with the folder name. The scripts assume that the specified folder name is unique.
- Replace
path/to/json/file.jsonwith the path to a JSON file specifying which cloud storage files should be uploaded. - If creating a new folder, replace
A folder to store my fileswith a meaningful description for your folder. - If creating a new folder, replace
"my": "folder_metadata"with any metadata you want to add to the folder.
- Replace
<upload_job_id>with theupload_job_idshown in the output of the script used to start the upload. In the example output of the script provided, theupload_job_id=c4026edb-4fw2-40a0-8f05-a1af7f465727. - Replace
<private_key_path>with the path to your private key. - Replace
<folder_name>with the folder name. The scripts assume that the specified folder name is unique.
Register Cloud Data Without a JSON File
Instead of using a JSON file to specify cloud files and URLs, you can useDataUploadItems. This method is recommended for cloud data registrations in the specific use cases listed below.
Increased Image Group File Registration
You can increase the speed at which Image Groups are registered to Encord by includingimageMetadata for each image belonging to the image group. For this you must use the following method of importing images and creating Image Groups.
Ensure that you:
- Replace
<path_to_private_key>with your private key path - Enter the URLs of images you want to import and batch as an image group.
- Provide the
imageMetadatafor your files by replacing the example values. - Enter a title for your image group.
- Specify the name of the target folder to store the image group.
- Replace
<integration_id>with the id of the integration you want to use for the data registration.
Create an Image Group from Existing Images
You can create Image Groups from individual images previously added to Encord. If the individual images includeclientMetadata and are then grouped into an Image Group, this metadata is retained at the frame level within the Image Group.
The following script combines three previously uploaded images in Encord into a single Image Group.
In the following script:
- Replace
<private_key_path>with your private key path. - Replace the titles in the
file_nameslist with the names of images to be grouped. - Replace
<folder_name>with the title for the folder containing the files. - Provide a title for the image group.
- Replace
<integration_id>with the ID of the integration being used. - Add optional
clientMetadatafor the image group.
Local Data
Upload Local Data to an Existing Folder
The following scripts add data to a folder that already exists in Data > Files & Folders.Each local file upload must start within 24 hours after its upload URL is issued. If an upload URL expires, rerun the upload to generate new URLs for the files. Encord-hosted Azure deployments configured with a static SAS token use the token’s configured expiry instead.
- Replace
<folder_name>with the name of the folder you want to add data to. - For images and videos replace
User/path/to/my/filewith the path to your image or video file. - For DICOM series replace
User/path/to/dicom/file1andUser/path/to/dicom/file2with the paths to the DICOM files you want to create a series from. Add as many file paths as necessary. - For image groups and image sequences, replace
User/path/to/image/file1andUser/path/to/image/file2with the paths to the image files you want to create an image group or image sequence from. Add as many file paths as necessary.
Upload Local Data to a New Folder
The following script creates a new folder in Data > Files & Folders and uploads image, video, DICOM, image group, or image sequence files to the newly created folder. A new folder is created each time the script is run. In the following scripts, ensure that you:- Replace <private_key_path> with the path to your private key.
- Replace <folder_name> with the name you want to give your folder. The scripts assume that the specified folder name is unique.
- Replace
A folder to store my fileswith a meaningful description for your folder. - Replace
my: folder_metadatawith any metadata you want to add to the folder. Remove the line if you do not want to add any metadata to the folder. - For images and videos replace
User/path/to/my/filewith the path to your image or video file. - For DICOM series replace
User/path/to/dicom/file1andUser/path/to/dicom/file2with the paths to the DICOM files you want to create a series from. Add as many file paths as necessary. - For image groups and image sequences, replace
User/path/to/image/file1andUser/path/to/image/file2with the paths to the image files you want to create an image group or image sequence from. Add as many file paths as necessary.
List Data Units in a Folder
Listing the files in a folder can be used to verify that all data unit were successfully uploaded.- Replace <private_key_path> with the path to your private key.
- Replace <folder_name> with the name you want to give your folder. The scripts assume that the specified folder name is unique.

