utils

Functions

accepted_items_count(job_info)

return

Number of accepted images in all Labeling Jobs

accepted_items_count_desc()

return

Description about total number of accepted items in all Labeling Jobs

classes_summary(stats)

rtype

DataFrame

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)

return

True if Labeling Job is completed, otherwise None

is_completed_desc()

return

Description about total number of completed Labeling Jobs

is_labeling_started(job_info)

return

True if Labeling Job is started, False otherwise

is_labeling_started_desc()

return

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

is_not_started(job_info)

return

True if Labeling Job is not started, otherwise None

is_not_started_desc()

return

Description about total number of pending Labeling Jobs

is_on_labeling(job_info)

return

True if Labeling Job is in progress, False otherwise

is_on_labeling_desc()

rtype

str

is_on_review(job_info)

return

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

is_on_review_desc()

return

Description about number of Labeling Jobs with status 'ON REVIEW'

is_review_started(job_info)

return

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

is_review_started_desc()

return

Description about number of Labeling Jobs that are started by reviewer

is_stopped(job_info)

return

True if Labeling Job is stopped, otherwise None

is_stopped_desc()

return

Description about number of stopped Labeling Jobs

is_zero_labeling_desc()

return

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

is_zero_reviewed_desc()

return

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

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)

return

Number of Images, that labeler marked as done

labeled_items_count_desc()

return

Description about total number of labeled items in all Labeling Jobs

rejected_items_count(job_info)

return

Number of rejected images in all Labeling Jobs

rejected_items_count_desc()

return

Description about total number of rejected items in Labeling Jobs

reviewed_items_count(job_info)

return

Number of reviewed Images(accepted and rejected)

reviewed_items_count_desc()

return

Description about total number of reviewed items in all Labeling Jobs

tags_summary(stats)

rtype

DataFrame

total_desc()

return

Description about total number of Labeling Jobs

total_items_count(job_info)

return

Number of total items count in Labeling Jobs

total_items_count_desc()

return

Description about total number of items in all Labeling Jobs

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]

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
address = 'https://app.supervise.ly'
os.environ['SERVER_ADDRESS'] = address
os.environ['API_TOKEN'] = 'Your Supervisely API Token'
api = sly.Api.from_env()
job_info = api.labeling_job.get_info_by_id(2)

from supervisely.labeling_jobs.utils import get_job_url
job_url = get_job_url(address, job_info)
print(job_url)
# Output: https://app.supervise.ly/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
os.environ['SERVER_ADDRESS'] = 'https://app.supervise.ly'
os.environ['API_TOKEN'] = 'Your Supervisely API Token'
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)

from supervisely.labeling_jobs.utils import images_summary
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_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
os.environ['SERVER_ADDRESS'] = 'https://app.supervise.ly'
os.environ['API_TOKEN'] = 'Your Supervisely API Token'
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)
address = https://app.supervise.ly

from supervisely.labeling_jobs.utils import jobs_stats
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.supervise.ly/app/images/...  completed      3        3         3         2         1  08/04/2020 15:10
# 1   3  <a href="https://app.supervise.ly/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
os.environ['SERVER_ADDRESS'] = 'https://app.supervise.ly'
os.environ['API_TOKEN'] = 'Your Supervisely API Token'
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)

from supervisely.labeling_jobs.utils import jobs_summary
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]

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]