Labelbox

Asset Information Overlay

Overlay asset metadata in the labeling interface

Overlay multi-media metadata on the labeling interface using the Asset Info feature. When asset information is available, it is shown by pressing the i icon in the top right.

Including Asset Info During Dataset Import

[
  {
    "externalId": "ab65d5e99w13",
    "imageUrl": "https://storage.googleapis.com/labelbox-example-datasets/tesla/104836109-p100d-review-5.1910x1000.jpeg",
    "info": {
        "type": "IMAGE",
        "value": "https://firebasestorage.googleapis.com/v0/b/labelbox-193903.appspot.com/o/cjhk4p9dyf5va0702liitudpz%2Fd3ffab29-d6be-4d69-b006-89a828679d29%2Fleft_small-pen-test-site_1_1537524039648.jpg?alt=media&token=66e84e55-97e8-46a6-9ab8-685f1e950581"
    }
  },
  {
    "externalId": "ljk6s544a7f8",
    "imageUrl": "https://storage.googleapis.com/labelbox-example-datasets/tesla/2017-Tesla-Model-3-top-view.jpg",
    "info": {
        "type": "VIDEO",
        "value": "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
    }
  },
  {
    "externalId": "ljk6s544a7f8",
    "imageUrl": "https://storage.googleapis.com/labelbox-example-datasets/tesla/2017-Tesla-Model-3-top-view.jpg",
    "info": {
        "type": "TEXT",
        "value": "In publishing and graphic design, lorem ipsum is a placeholder text used to demonstrate the visual form of a document without relying on meaningful content. Replacing the actual content with placeholder text allows designers to design the form of the content before the content itself has been produced"
    }
  }
]

Adding Asset Info via API

Adding Text Asset Info to a Datarow

mutation addAssetInfo {
  createAssetMetadata(
    data: {
      dataRowId:"<DATAROW-ID>",
      metaValue:"This is textual asset information.",
      metaType: TEXT,
    }
  ) {
    id
  }
}

Adding Image Asset Info to a Datarow

mutation addAssetInfo {
  createAssetMetadata(
    data: {
      dataRowId:"<DATAROW-ID>",
      metaValue:"https://firebasestorage.googleapis.com/v0/b/labelbox-193903.appspot.com/o/cjhk4p9dyf5va0702liitudpz%2Fd3ffab29-d6be-4d69-b006-89a828679d29%2Fleft_small-pen-test-site_1_1537524039648.jpg?alt=media&token=66e84e55-97e8-46a6-9ab8-685f1e950581",
      metaType: IMAGE,
    }
  ) {
    id
  }
}

Adding Video Asset Info to a Datarow

mutation addAssetInfo {
  createAssetMetadata(
    data: {
      dataRowId:"<DATAROW-ID>",
      metaValue:"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
      metaType: VIDEO,
    }
  ) {
    id
  }
}

Python Example

# Two things to run this script
# 1. run "pip install graphqlclient"
# 2. Fill in <API-KEY-HERE> (https://app.labelbox.com/settings/apikey)

import json
from graphqlclient import GraphQLClient
client = GraphQLClient('https://api.labelbox.com/graphql')
client.inject_token('Bearer <API-KEY-HERE>')

def add_asset_info(data_row_id, meta_value, meta_type):
    res_str = client.execute("""
    mutation AddAssetInfo($dataRowId:ID!, $metaValue:String!, $metaType: MetadataType!) {
      createAssetMetadata(
        data: {
          dataRowId: $dataRowId,
          metaValue: $metaValue,
          metaType: $metaType,
        }
      ) {
        id
      }
    }
    """, {
        'dataRowId': data_row_id,
        'metaValue': meta_value,
        'metaType': meta_type
    })

    res = json.loads(res_str)
    return res['data']['createAssetMetadata']

if __name__ == "__main__":
  new_asset_info = add_asset_info('some-id', 'This is textual asset information.', 'TEXT')
  print(new_asset_info)

Asset Information Overlay


Overlay asset metadata in the labeling interface

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.