Table of Contents

Asset metadata & image overlay (beta)

Asset metadata refers to additional videos, images, or text attached to a data row that you can view in the right panel in the Editor.

Image overlay (beta) is a filtered subset of asset metadata. With Image overlay you can attach additional image layers for context.

Not supported:

  • Manipulate size, position, name of image layers
  • Label additional image layers (any annotations are only applied to the original image of the Data Rows
  • Upload via CSV
  • Image overlay on video or text assets

How to view attachments/layers

Image layers are specified as IMAGE_OVERLAY upon import will be rendered as canvas layers. Click the layers icon in the top right corner to see the hotkeys (option+1, option+2, option+3) for toggling between the image layers.

Asset metadata attachments specified as TEXT, IMAGE, or VIDEO upon import will be rendered on the right. You can view an asset metadata attachments by clicking the tab icon in the top left corner when the asset is loaded in the labeling interface.

Add attachments via JSON

Adding asset metadata and/or image layers via JSON is the quickest way to add multiple attachments to a Data Row. There is no limit to how many attachments you can add to a Data Row. However, when you add attachments as IMAGE_OVERLAY type, you may only view up to 3 additional image layers (4 total, including the original image of the Data Row) in the Editor. 

The Editor assumes that the additional image layers have the same dimensions as the original image of the Data Row. We recommend making sure that the dimensions match.

To learn how to import your JSON file, see Import your JSON file.

Attach metadata/image layers to an image

This sample JSON attaches the following to a JPG image:

  1. 2 additional images as image layers
  2. A string of text, a video URL, and an image URL as asset metadata.
[ 
{
"externalId": "basic.png",
"imageUrl": "https://labelbox.s3-us-west-2.amazonaws.com/coregistered-images/basic.png",
"attachments": [
{
"type": "IMAGE_OVERLAY",
"value": "https://labelbox.s3-us-west-2.amazonaws.com/coregistered-images/rgb.png"
},
{
"type": "IMAGE_OVERLAY",
"value": "https://labelbox.s3-us-west-2.amazonaws.com/coregistered-images/cir.png"
},
{
"type": "IMAGE_OVERLAY",
"value": "https://labelbox.s3-us-west-2.amazonaws.com/coregistered-images/weeds.png"
}, {
"type": "TEXT",
"value": "Camera: Micasense, 2342wdfewfd3214"
},
{
"type": "IMAGE",
"value": "https://labelbox.s3-us-west-2.amazonaws.com/coregistered-images/disease_attachment.jpg"
}
]
}
]

Where:

  • externalId is OPTIONAL and is a user-generated file name or ID for the file.
  • imageUrl is REQUIRED and accepts an https:// path to an external image URL.
  • type is REQUIRED and can be IMAGE_OVERLAY, IMAGE, VIDEO, or TEXT. Note: IMAGE_OVERLAY types can only be attached to image assets.
  • value is REQUIRED and accepts an https:// URL to an external file OR a string of text.
Specifying type and value under info is still supported. See old JSON format here.

Attach metadata to text

The sample JSON attaches an image, a text string and a video to a text asset. 

[ 
{
"data": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. At auctor urna nunc id cursus metus aliquam." ,
"attachments": [
{
"type": "IMAGE",
"value": "https://storage.googleapis.com/labelbox-sample-datasets/Images/chest-xray/person14_bacteria_51.jpeg"
},
{
"type": "TEXT",
"value": "Some sample text"
},
{
"type": "VIDEO",
"value": "https://storage.googleapis.com/labelbox-sample-datasets/Videos/shibuya-1230-1530.mp4"
}
]
}
]

Where:

  • data is REQUIRED and accepts a text string OR an https:// path to an external text file URL.
  • type is REQUIRED and can be IMAGE, VIDEO, or TEXT. Note: IMAGE_OVERLAY is not an attachable type that you can add to a text or video asset.
  • value is REQUIRED and accepts an https:// path to an external file OR a string of text.
Specifying type and value under info is still supported. See old format here.

Add attachments via GraphQL

To learn how to use the createAssetMetadata mutation to attach asset metadata to a Data Row, see Asset metadata.

You can also use the createAssetMetadata mutation to add an image layer to a Data Row. This operation only attaches one image at a time.

mutation addAssetInfo { 
createAssetMetadata(  
data: {    
dataRowId:"<DATAROW-ID>",
metaValue:"https://storage.googleapis.com/labelbox-sample-datasets/Images/dental_xrays/108.jpg",
metaType: IMAGE_OVERLAY
}
) {
id
}
}

Where:

  • metaValue is REQUIRED and accepts an https:// URL to an external image.
  • metaType is REQUIRED and must be IMAGE_OVERLAY.

Edit/remove asset metadata

To learn how to edit/remove asset metadata or layers via the GraphQL API, see Asset metadata.

Was this page helpful?

Import URLs via JSON

Delegated access

Contact