Labeling Jobs

Guide explains how to manage labeling jobs using Supervisely SDK and

Introduction

In this tutorial you will learn how to manage Labeling Jobs using Supervisely SDK and API.

πŸ“— Everything you need to reproduce this tutorial is on GitHub: source code and demo data.

How to debug this tutorial

Step 1. Prepare ~/supervisely.env file with credentials. Learn more here.

Step 2. Clone repository with source code and demo data and create Virtual Environment.

git clone https://github.com/supervisely-ecosystem/automation-with-python-sdk-and-api
cd automation-with-python-sdk-and-api
./create_venv.sh

Step 3. Open repository directory in Visual Studio Code.

code -r .

Step 4. change βœ… IDs βœ… in local.env file by copying the IDs from Supervisely instance.

  • Change Team ID in local.env file by copying the ID from the context menu of the team.

    TEAM_ID=8                 # ⬅️ change it
  • Get Lemons (Test) project from ecosystem. Lemons (Test) is an example project with 6 images of lemons and kiwi fruits.

Change project id in local.env file by copying the ID from the context menu of the project.

  • Change User ID and user login in local.env to your own from Team members page.

Step 5. Start debugging examples/labeling-jobs-automation/main.py

Labeling Jobs automation

Import libraries

Init API client

​Init API for communicating with Supervisely Instance. First, we load environment variables with credentials:

Get your IDs and username from environment

Prepare project for Labeling Job

Function will populate project meta with classes: "kiwi", "lemon", and tags: "size", "origin".

Labeling jobs automation

Step 1. Create and add annotators to the team, before creating Labeling Job

Create accounts for annotators with restrictions.

Note: Creating users requires admin permission.

Labelers will be able to login only after being added to at least one team

Note: Adding users to the Team requires admin permission.

Step 2. Define project and datasets for labeling job

Output:

Output:

Step 3. Create Labeling Jobs

Create labeling job for labeler 1, and assign class lemon to label.

Output:

You can stop Labeling Job if you need. Job will become unavailable for labeler.

Create labeling job for labeler 2, and assign class kiwi to label, and also tags "size" and "origin", with objects and tags limit. You can also specify which images to label by providing images ids.

List all images in dataset and get their IDs. As an example we will select only half of images in the dataset.

Output:

Created Labeling Jobs

Get all labeling jobs in a team

Output:

Labeling Jobs filtering

List of available filters:

  • created_by_id

  • assigned_to_id

  • project_id

  • dataset_id

Note: filters can be used in various combinations

Get all labeling jobs that were created by user 'my_username'

Note: Getting UserInfo by login requires admin permission.

Output

Get all labeling jobs that were created by user "my_username" and were assigned to labeler 2

Output:

Get all active labeling jobs in a team

Output:

Labeling Jobs Statuses

api.labeling_job.Status.PENDING - labeling job is created, labeler still has not started api.labeling_job.Status.IN_PROGRESS - labeler started, but not finished api.labeling_job.Status.ON_REVIEW - labeler finished his job, reviewer is in progress api.labeling_job.Status.COMPLETED - reviewer completed job api.labeling_job.Status.STOPPED - job was stopped at some stage

Output

Output:

If you want to change Labeling Job status you can use api.labeling_job.set_status() method

Output:

The following methods will wait until labeling job will change status to the given expected status:

  • Labeler has finished annotating

  • Reviewer has finished his annotation review

Archive Labeling Job

Archive Labeling job by ID. Data can be retrieved after archiving.

Archived Labelling Job

Remove Labeling Jobs

Labeling job will be removed permanently.

Remove single Labeling Job

Remove Labeling job by ID.

Remove list of Labeling Jobs

Remove Labeling jobs by IDs.

Last updated

Was this helpful?