utils

Functions

accepted_items_count(job_info)

accepted_items_count_desc()

classes_summary(stats)

Get summary statistics about given Labeling Jobs classes.

get_job_url(server_address, job)

Get labeling job url.

images_summary(jobs)

Get summary statistics about given Labeling Jobs images.

is_completed(job_info)

is_completed_desc()

is_labeling_started(job_info)

is_labeling_started_desc()

is_not_started(job_info)

is_not_started_desc()

is_on_labeling(job_info)

is_on_labeling_desc()

Description about number of Labeling Jobs with status 'IN PROGRESS'

is_on_review(job_info)

is_on_review_desc()

is_review_started(job_info)

is_review_started_desc()

is_stopped(job_info)

is_stopped_desc()

is_zero_labeling_desc()

is_zero_reviewed_desc()

jobs_stats(server_address, jobs, stats)

Get statistics about Labeling Jobs items.

jobs_summary(jobs)

Get summary statistics about given Labeling Jobs.

labeled_items_count(job_info)

labeled_items_count_desc()

rejected_items_count(job_info)

rejected_items_count_desc()

reviewed_items_count(job_info)

reviewed_items_count_desc()

tags_summary(stats)

Get summary statistics about given Labeling Jobs tags.

total_desc()

total_items_count(job_info)

total_items_count_desc()

Description

utilities used for labeling jobs

accepted_items_count(job_info)[source]
Returns:

Number of accepted images in all Labeling Jobs

Return type:

int

accepted_items_count_desc()[source]
Returns:

Description about total number of accepted items in all Labeling Jobs

Return type:

Tuple[str, str]

classes_summary(stats)[source]

Get summary statistics about given Labeling Jobs classes.

get_job_url(server_address, job)[source]

Get labeling job url.

Parameters:
server_address : str

Server address there labeling job working.

job : NamedTuple

Information about labeling job.

Returns:

Labeling job url

Return type:

str

Usage Example:
import os
from dotenv import load_dotenv

import supervisely as sly
from supervisely.labeling_jobs.utils import get_job_url

# Load secrets and create API object from .env file (recommended)
# Learn more here: https://developer.supervisely.com/getting-started/basics-of-authentication
if sly.is_development():
    load_dotenv(os.path.expanduser("~/supervisely.env"))

api = sly.Api.from_env()

job_info = api.labeling_job.get_info_by_id(2)
job_url = get_job_url(api.server_address, job_info)
print(job_url)
# Output: https://app.supervisely.com/app/images/4/8/58/54?jobId=2
images_summary(jobs)[source]

Get summary statistics about given Labeling Jobs images.

Parameters:
jobs : List[NamedTuple]

List of information about Labeling Jobs.

Returns:

Statistics about Labeling Jobs images

Return type:

pd.DataFrame

Usage Example:
import os
from dotenv import load_dotenv

import supervisely as sly
from supervisely.labeling_jobs.utils import images_summary

# Load secrets and create API object from .env file (recommended)
# Learn more here: https://developer.supervisely.com/getting-started/basics-of-authentication
if sly.is_development():
    load_dotenv(os.path.expanduser("~/supervisely.env"))

api = sly.Api.from_env()

job_info1 = api.labeling_job.get_info_by_id(2)
job_info2 = api.labeling_job.get_info_by_id(3)

result = images_summary([job_info1, job_info2])
print(result)
# Output:
#    # ITEM STATUS  QUANTITY PERCENTAGE                                        DESCRIPTION
# 0  0       TOTAL         5   100.00 %     the total number of items in all labeling jobs
# 1  1     LABELED         5   100.00 %  the total number of labeled items (labelers ma...
# 2  2    REVIEWED         5   100.00 %  the total number of reviewed items (reviewers ...
# 3  3    ACCEPTED         4    80.00 %  the total number of accepted items (reviewers ...
# 4  4    REJECTED         1    20.00 %  the total number of rejected items (reviewers ...
is_completed(job_info)[source]
Returns:

True if Labeling Job is completed, otherwise None

Return type:

bool or None

is_completed_desc()[source]
Returns:

Description about total number of completed Labeling Jobs

Return type:

Tuple[str, str]

is_labeling_started(job_info)[source]
Returns:

True if Labeling Job is started, False otherwise

Return type:

bool

is_labeling_started_desc()[source]
Returns:

Description about total number of Labeling Jobs that are started by labeler

Return type:

Tuple[str, str]

is_not_started(job_info)[source]
Returns:

True if Labeling Job is not started, otherwise None

Return type:

bool or None

is_not_started_desc()[source]
Returns:

Description about total number of pending Labeling Jobs

Return type:

Tuple[str, str]

is_on_labeling(job_info)[source]
Returns:

True if Labeling Job is in progress, False otherwise

Return type:

bool

is_on_labeling_desc()[source]

Description about number of Labeling Jobs with status ‘IN PROGRESS’

is_on_review(job_info)[source]
Returns:

True if Labeling Job is in ‘ON REVIEW’ status , False otherwise

Return type:

bool

is_on_review_desc()[source]
Returns:

Description about number of Labeling Jobs with status ‘ON REVIEW’

Return type:

Tuple[str, str]

is_review_started(job_info)[source]
Returns:

True if Labeling Job is in ‘review’ status and there are Images that reviewer accepted or rejected, False otherwise

Return type:

bool

is_review_started_desc()[source]
Returns:

Description about number of Labeling Jobs that are started by reviewer

Return type:

Tuple[str, str]

is_stopped(job_info)[source]
Returns:

True if Labeling Job is stopped, otherwise None

Return type:

bool or None

is_stopped_desc()[source]
Returns:

Description about number of stopped Labeling Jobs

Return type:

Tuple[str, str]

is_zero_labeling_desc()[source]
Returns:

Description about number of Labeling Jobs with status “IN PROGRESS” with zero labeled items

Return type:

Tuple[str, str]

is_zero_reviewed_desc()[source]
Returns:

Description about number of Labeling Jobs with status “ON REVIEW” with zero reviewed items

Return type:

Tuple[str, str]

jobs_stats(server_address, jobs, stats)[source]

Get statistics about Labeling Jobs items.

Parameters:
server_address : str

Supervisely Server Address.

jobs : List[NamedTuple]

List of information about Labeling Jobs.

stats : list

Returns:

Statistics about Labeling Jobs items as pd.DataFrame

Return type:

pd.DataFrame

Usage Example:
import os
from dotenv import load_dotenv

import supervisely as sly
from supervisely.labeling_jobs.utils import jobs_stats

# Load secrets and create API object from .env file (recommended)
# Learn more here: https://developer.supervisely.com/getting-started/basics-of-authentication
if sly.is_development():
    load_dotenv(os.path.expanduser("~/supervisely.env"))

api = sly.Api.from_env()

address = api.server_address
job_info1 = api.labeling_job.get_info_by_id(2)
job_info2 = api.labeling_job.get_info_by_id(3)

result = jobs_stats(address, [job_info1, job_info2], [1, 2])
print(result)
# Output:
#    ID                                               NAME     STATUS  TOTAL  LABELED  REVIEWED  ACCEPTED  REJECTED        CREATED_AT
# 0   2  <a href="https://app.supervisely.com/app/images/...  completed      3        3         3         2         1  08/04/2020 15:10
# 1   3  <a href="https://app.supervisely.com/app/images/...  completed      2        2         2         2         0  08/04/2020 15:10
jobs_summary(jobs)[source]

Get summary statistics about given Labeling Jobs.

Parameters:
jobs : List[NamedTuple]

List of information about Labeling Jobs.

Returns:

Statistics about Labeling Jobs as pd.DataFrame

Return type:

pd.DataFrame

Usage Example:
import os
from dotenv import load_dotenv

import supervisely as sly
from supervisely.labeling_jobs.utils import jobs_summary

# Load secrets and create API object from .env file (recommended)
# Learn more here: https://developer.supervisely.com/getting-started/basics-of-authentication
if sly.is_development():
    load_dotenv(os.path.expanduser("~/supervisely.env"))

api = sly.Api.from_env()

job_info1 = api.labeling_job.get_info_by_id(2)
job_info2 = api.labeling_job.get_info_by_id(3)

result = jobs_summary([job_info1, job_info2])
print(result)
# Output:
#                 JOB STATUS  QUANTITY PERCENTAGE                                        DESCRIPTION
# 0  0                 TOTAL         2   100.00 %           the total number of jobs in current team
# 1  1             COMPLETED         2   100.00 %                       the number of completed jobs
# 2  2               STOPPED         0     0.00 %                         the number of stopped jobs
# 3  3               PENDING         0     0.00 %  the number of jobs labeler haven't even opened...
# 4  4  LABELING IN PROGRESS         0     0.00 %         the number of jobs with status IN_PROGRESS
# 5  5      LABELING STARTED         0     0.00 %  the number of jobs that are started by labeler...
# 6  6          ZERO LABELED         0     0.00 %  the number of jobs with status "IN PROGRESS" w...
# 7  7             ON REVIEW         0     0.00 %           the number of jobs with status ON_REVIEW
# 8  8        REVIEW STARTED         0     0.00 %  the number of jobs that are started by reviewe...
# 9  9         ZERO REVIEWED         0     0.00 %  the number of jobs with status "ON REVIEW" wit...
labeled_items_count(job_info)[source]
Returns:

Number of Images, that labeler marked as done

Return type:

int

labeled_items_count_desc()[source]
Returns:

Description about total number of labeled items in all Labeling Jobs

Return type:

Tuple[str, str]

rejected_items_count(job_info)[source]
Returns:

Number of rejected images in all Labeling Jobs

Return type:

int

rejected_items_count_desc()[source]
Returns:

Description about total number of rejected items in Labeling Jobs

Return type:

Tuple[str, str]

reviewed_items_count(job_info)[source]
Returns:

Number of reviewed Images(accepted and rejected)

Return type:

int

reviewed_items_count_desc()[source]
Returns:

Description about total number of reviewed items in all Labeling Jobs

Return type:

Tuple[str, str]

tags_summary(stats)[source]

Get summary statistics about given Labeling Jobs tags.

total_desc()[source]
Returns:

Description about total number of Labeling Jobs

Return type:

Tuple[str, str]

total_items_count(job_info)[source]
Returns:

Number of total items count in Labeling Jobs

Return type:

int

total_items_count_desc()[source]
Returns:

Description about total number of items in all Labeling Jobs

Return type:

Tuple[str, str]