Remote Labeling

The remote labeling module of the SDK provides an interface to interact with your remote labeling stage in your project pipeline. The remote labeling stage is used to import predictions from a model, algorithm, or any other method. The remote labeling module has been designed with flexibility in mind, giving users control over how they are generating, and importing predictions.


redbrick.remote_label.RemoteLabel(org_id: str, project_id: str, stage_name: str)




Your organization id, can be found in the url<org_id>/


The id of the project with the remote-labeling stage. Can be found in the url of the project dashboard<org_id>/projects/<project_id>


The name of the remote-labeling stage




get_task(num_tasks: int)

Get's the next task(s) from the pipeline. Returns list of Task objects.

submit_task(task: Task, label: label)

Submits the task with the labels for that task. Requires the Task object from get_task and label is one of the label object types - ImageBoundingBox, VideoBoundingBox, VideoClassification etc.


Returns the number of tasks queued in this stage


Initializing the module

You first have to initialize the module by providing all the relevant organization and project details

import redbrick
# Initialize sdk and remote-labeling module
remote_labeling = redbrick.remote_labeling.RemoteLabel(
org_id="<org_id>", project_id="<project_id>", stage_name="<stage_name>"

Retrieving tasks

Each datapoint is converted into a task inside a pipeline. The first step in adding model/algorithm generated pre-labels to your tasks, is to retrieve the tasks from the backend.

# Get task from remote
tasks = remote_labeling.get_task(num_tasks=1)

The tasks variable here is a list of Task objects.

Submitting tasks

Now that you have the task, you can generate your labels using a model, algorithm or rule based system. You have to submit these labels to the backend in the following manner.

from redbrick.entity.label.bbox import ImageBoundingBox
# Submit task to remote
image_bbox = ImageBoundingBox(labels) # labels is a variable of the correct format
remote_labeling.submit_task(task=tasks[0], labels=image_bbox)