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
The id of the project with the remote-labeling stage. Can be found in the url of the project dashboard
The name of the
Get's the next task(s) from the pipeline. Returns list of
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 moduleredbrick.init(api_key="<key>")remote_labeling = redbrick.remote_labeling.RemoteLabel(org_id="<org_id>", project_id="<project_id>", stage_name="<stage_name>")
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 remotetasks = remote_labeling.get_task(num_tasks=1)
tasks variable here is a list of
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 remoteimage_bbox = ImageBoundingBox(labels) # labels is a variable of the correct formatremote_labeling.submit_task(task=tasks, labels=image_bbox)