JobsApi class reference
All URIs are relative to http://localhost
Method | HTTP request | Description |
---|---|---|
create | POST /api/jobs | Method creates a new job in the task |
create_annotations | POST /api/jobs/{id}/annotations/ | Method allows to initialize the process of the job annotation upload from a local file or a cloud storage |
destroy | DELETE /api/jobs/{id} | Method deletes a job and its related annotations |
destroy_annotations | DELETE /api/jobs/{id}/annotations/ | Method deletes all annotations for a specific job |
list | GET /api/jobs | Method returns a paginated list of jobs |
partial_update | PATCH /api/jobs/{id} | Methods does a partial update of chosen fields in a job |
partial_update_annotations | PATCH /api/jobs/{id}/annotations/ | Method performs a partial update of annotations in a specific job |
retrieve | GET /api/jobs/{id} | Method returns details of a job |
retrieve_annotations | GET /api/jobs/{id}/annotations/ | Method returns annotations for a specific job as a JSON document. If format is specified, a zip archive is returned. |
retrieve_data | GET /api/jobs/{id}/data | Method returns data for a specific job |
retrieve_data_meta | GET /api/jobs/{id}/data/meta | Method provides a meta information about media files which are related with the job |
retrieve_dataset | GET /api/jobs/{id}/dataset | Export job as a dataset in a specific format |
retrieve_preview | GET /api/jobs/{id}/preview | Method returns a preview image for the job |
update_annotations | PUT /api/jobs/{id}/annotations/ | Method performs an update of all annotations in a specific job or used for uploading annotations from a file |
create
create( job_write_request, **kwargs )
Method creates a new job in the task
Example
from pprint import pprint
from cvat_sdk.api_client import Configuration, ApiClient, exceptions
from cvat_sdk.api_client.models import *
# Set up an API client
# Read Configuration class docs for more info about parameters and authentication methods
configuration = Configuration(
host = "http://localhost",
username = 'YOUR_USERNAME',
password = 'YOUR_PASSWORD',
)
with ApiClient(configuration) as api_client:
job_write_request = JobWriteRequest(
assignee=1,
stage=JobStage("annotation"),
state=OperationStatus("new"),
type=JobType("annotation"),
task_id=1,
frame_selection_method=FrameSelectionMethodEnum("random_uniform"),
frame_count=0,
seed=0,
frames=[
0,
],
) # JobWriteRequest |
try:
(data, response) = api_client.jobs_api.create(
job_write_request,)
pprint(data)
except exceptions.ApiException as e:
print("Exception when calling JobsApi.create(): %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
job_write_request | JobWriteRequest |
There are also optional kwargs that control the function invocation behavior. Read more here.
Returned values
Returned type: Tuple[JobRead, urllib3.HTTPResponse]
.
Returns a tuple with 2 values: (parsed_response, raw_response)
.
The first value is a model parsed from the response data. The second value is the raw response, which can be useful to get response parameters, such as status code, headers, or raw response data. Read more about invocation parameters and returned values here.
Authorization
basicAuth, csrfAuth, sessionAuth, signatureAuth, tokenAuth
HTTP request headers
- Content-Type: application/json
- Accept: application/vnd.cvat+json
HTTP response details
Status code | Description | Response headers |
---|---|---|
201 | - |
create_annotations
create_annotations( id, cloud_storage_id=None, filename=None, format=None, location=None, use_default_location=None, annotation_file_request=None, **kwargs )
Method allows to initialize the process of the job annotation upload from a local file or a cloud storage
The request POST /api/jobs/id/annotations will initiate file upload and will create the rq job on the server in which the process of annotations uploading from file will be carried out. Please, use the PUT /api/jobs/id/annotations endpoint for checking status of the process.
Example
from pprint import pprint
from cvat_sdk.api_client import Configuration, ApiClient, exceptions
from cvat_sdk.api_client.models import *
# Set up an API client
# Read Configuration class docs for more info about parameters and authentication methods
configuration = Configuration(
host = "http://localhost",
username = 'YOUR_USERNAME',
password = 'YOUR_PASSWORD',
)
with ApiClient(configuration) as api_client:
id = 1 # int | A unique integer value identifying this job.
cloud_storage_id = 1 # int | Storage id (optional)
filename = "filename_example" # str | Annotation file name (optional)
format = "format_example" # str | Input format name You can get the list of supported formats at: /server/annotation/formats (optional)
location = "cloud_storage" # str | where to import the annotation from (optional)
use_default_location = True # bool | Use the location that was configured in the task to import annotation (optional) if omitted the server will use the default value of True
annotation_file_request = AnnotationFileRequest(
annotation_file=open('/path/to/file', 'rb'),
) # AnnotationFileRequest | (optional)
try:
api_client.jobs_api.create_annotations(
id,
cloud_storage_id=cloud_storage_id,
filename=filename,
format=format,
location=location,
use_default_location=use_default_location,
annotation_file_request=annotation_file_request,
)
except exceptions.ApiException as e:
print("Exception when calling JobsApi.create_annotations(): %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | int | A unique integer value identifying this job. | |
cloud_storage_id | int | Storage id | [optional] |
filename | str | Annotation file name | [optional] |
format | str | Input format name You can get the list of supported formats at: /server/annotation/formats | [optional] |
location | str | where to import the annotation from | [optional] |
use_default_location | bool | Use the location that was configured in the task to import annotation | [optional] if omitted the server will use the default value of True |
annotation_file_request | AnnotationFileRequest | [optional] |
There are also optional kwargs that control the function invocation behavior. Read more here.
Returned values
Returned type: Tuple[None, urllib3.HTTPResponse]
.
Returns a tuple with 2 values: (None, raw_response)
.
This endpoint does not have any return value, so None
is always returned as the first value.
The second value is the raw response, which can be useful to get response parameters, such as
status code, headers, or raw response data. Read more about invocation parameters
and returned values here.
Authorization
basicAuth, csrfAuth, sessionAuth, signatureAuth, tokenAuth
HTTP request headers
- Content-Type: application/json, multipart/form-data
- Accept: application/vnd.cvat+json
HTTP response details
Status code | Description | Response headers |
---|---|---|
201 | Uploading has finished | - |
202 | Uploading has been started | - |
405 | Format is not available | - |
destroy
destroy( id, **kwargs )
Method deletes a job and its related annotations
Please note, that not every job can be removed. Currently, it is only available for Ground Truth jobs.
Example
from pprint import pprint
from cvat_sdk.api_client import Configuration, ApiClient, exceptions
from cvat_sdk.api_client.models import *
# Set up an API client
# Read Configuration class docs for more info about parameters and authentication methods
configuration = Configuration(
host = "http://localhost",
username = 'YOUR_USERNAME',
password = 'YOUR_PASSWORD',
)
with ApiClient(configuration) as api_client:
id = 1 # int | A unique integer value identifying this job.
try:
api_client.jobs_api.destroy(
id,)
except exceptions.ApiException as e:
print("Exception when calling JobsApi.destroy(): %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | int | A unique integer value identifying this job. |
There are also optional kwargs that control the function invocation behavior. Read more here.
Returned values
Returned type: Tuple[None, urllib3.HTTPResponse]
.
Returns a tuple with 2 values: (None, raw_response)
.
This endpoint does not have any return value, so None
is always returned as the first value.
The second value is the raw response, which can be useful to get response parameters, such as
status code, headers, or raw response data. Read more about invocation parameters
and returned values here.
Authorization
basicAuth, csrfAuth, sessionAuth, signatureAuth, tokenAuth
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
HTTP response details
Status code | Description | Response headers |
---|---|---|
204 | The job has been deleted | - |
destroy_annotations
destroy_annotations( id, **kwargs )
Method deletes all annotations for a specific job
Example
from pprint import pprint
from cvat_sdk.api_client import Configuration, ApiClient, exceptions
from cvat_sdk.api_client.models import *
# Set up an API client
# Read Configuration class docs for more info about parameters and authentication methods
configuration = Configuration(
host = "http://localhost",
username = 'YOUR_USERNAME',
password = 'YOUR_PASSWORD',
)
with ApiClient(configuration) as api_client:
id = 1 # int | A unique integer value identifying this job.
try:
api_client.jobs_api.destroy_annotations(
id,)
except exceptions.ApiException as e:
print("Exception when calling JobsApi.destroy_annotations(): %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | int | A unique integer value identifying this job. |
There are also optional kwargs that control the function invocation behavior. Read more here.
Returned values
Returned type: Tuple[None, urllib3.HTTPResponse]
.
Returns a tuple with 2 values: (None, raw_response)
.
This endpoint does not have any return value, so None
is always returned as the first value.
The second value is the raw response, which can be useful to get response parameters, such as
status code, headers, or raw response data. Read more about invocation parameters
and returned values here.
Authorization
basicAuth, csrfAuth, sessionAuth, signatureAuth, tokenAuth
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
HTTP response details
Status code | Description | Response headers |
---|---|---|
204 | The annotation has been deleted | - |
list
list( x_organization=None, assignee=None, dimension=None, filter=None, org=None, org_id=None, page=None, page_size=None, project_id=None, project_name=None, search=None, sort=None, stage=None, state=None, task_id=None, task_name=None, type=None, **kwargs )
Method returns a paginated list of jobs
Example
from pprint import pprint
from cvat_sdk.api_client import Configuration, ApiClient, exceptions
from cvat_sdk.api_client.models import *
# Set up an API client
# Read Configuration class docs for more info about parameters and authentication methods
configuration = Configuration(
host = "http://localhost",
username = 'YOUR_USERNAME',
password = 'YOUR_PASSWORD',
)
with ApiClient(configuration) as api_client:
x_organization = "X-Organization_example" # str | Organization unique slug (optional)
assignee = "assignee_example" # str | A simple equality filter for the assignee field (optional)
dimension = "3d" # str | A simple equality filter for the dimension field (optional)
filter = "filter_example" # str | JSON Logic filter. This filter can be used to perform complex filtering by grouping rules. For example, using such a filter you can get all resources created by you: - {\"and\":[{\"==\":[{\"var\":\"owner\"},\"<user>\"]}]} Details about the syntax used can be found at the link: https://jsonlogic.com/ Available filter_fields: ['task_name', 'project_name', 'assignee', 'state', 'stage', 'id', 'task_id', 'project_id', 'updated_date', 'dimension', 'type']. (optional)
org = "org_example" # str | Organization unique slug (optional)
org_id = 1 # int | Organization identifier (optional)
page = 1 # int | A page number within the paginated result set. (optional)
page_size = 1 # int | Number of results to return per page. (optional)
project_id = 1 # int | A simple equality filter for the project_id field (optional)
project_name = "project_name_example" # str | A simple equality filter for the project_name field (optional)
search = "search_example" # str | A search term. Available search_fields: ('task_name', 'project_name', 'assignee', 'state', 'stage') (optional)
sort = "sort_example" # str | Which field to use when ordering the results. Available ordering_fields: ['task_name', 'project_name', 'assignee', 'state', 'stage', 'id', 'task_id', 'project_id', 'updated_date', 'dimension', 'type'] (optional)
stage = "annotation" # str | A simple equality filter for the stage field (optional)
state = "new" # str | A simple equality filter for the state field (optional)
task_id = 1 # int | A simple equality filter for the task_id field (optional)
task_name = "task_name_example" # str | A simple equality filter for the task_name field (optional)
type = "annotation" # str | A simple equality filter for the type field (optional)
try:
(data, response) = api_client.jobs_api.list(
x_organization=x_organization,
assignee=assignee,
dimension=dimension,
filter=filter,
org=org,
org_id=org_id,
page=page,
page_size=page_size,
project_id=project_id,
project_name=project_name,
search=search,
sort=sort,
stage=stage,
state=state,
task_id=task_id,
task_name=task_name,
type=type,
)
pprint(data)
except exceptions.ApiException as e:
print("Exception when calling JobsApi.list(): %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
x_organization | str | Organization unique slug | [optional] |
assignee | str | A simple equality filter for the assignee field | [optional] |
dimension | str | A simple equality filter for the dimension field | [optional] |
filter | str | JSON Logic filter. This filter can be used to perform complex filtering by grouping rules. For example, using such a filter you can get all resources created by you: - {"and":[{"==":[{"var":"owner"}," |
[optional] |
org | str | Organization unique slug | [optional] |
org_id | int | Organization identifier | [optional] |
page | int | A page number within the paginated result set. | [optional] |
page_size | int | Number of results to return per page. | [optional] |
project_id | int | A simple equality filter for the project_id field | [optional] |
project_name | str | A simple equality filter for the project_name field | [optional] |
search | str | A search term. Available search_fields: (‘task_name’, ‘project_name’, ‘assignee’, ‘state’, ‘stage’) | [optional] |
sort | str | Which field to use when ordering the results. Available ordering_fields: [‘task_name’, ‘project_name’, ‘assignee’, ‘state’, ‘stage’, ‘id’, ‘task_id’, ‘project_id’, ‘updated_date’, ‘dimension’, ‘type’] | [optional] |
stage | str | A simple equality filter for the stage field | [optional] |
state | str | A simple equality filter for the state field | [optional] |
task_id | int | A simple equality filter for the task_id field | [optional] |
task_name | str | A simple equality filter for the task_name field | [optional] |
type | str | A simple equality filter for the type field | [optional] |
There are also optional kwargs that control the function invocation behavior. Read more here.
Returned values
Returned type: Tuple[PaginatedJobReadList, urllib3.HTTPResponse]
.
Returns a tuple with 2 values: (parsed_response, raw_response)
.
The first value is a model parsed from the response data. The second value is the raw response, which can be useful to get response parameters, such as status code, headers, or raw response data. Read more about invocation parameters and returned values here.
Authorization
basicAuth, csrfAuth, sessionAuth, signatureAuth, tokenAuth
HTTP request headers
- Content-Type: Not defined
- Accept: application/vnd.cvat+json
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | - |
partial_update
partial_update( id, patched_job_write_request=None, **kwargs )
Methods does a partial update of chosen fields in a job
Example
from pprint import pprint
from cvat_sdk.api_client import Configuration, ApiClient, exceptions
from cvat_sdk.api_client.models import *
# Set up an API client
# Read Configuration class docs for more info about parameters and authentication methods
configuration = Configuration(
host = "http://localhost",
username = 'YOUR_USERNAME',
password = 'YOUR_PASSWORD',
)
with ApiClient(configuration) as api_client:
id = 1 # int | A unique integer value identifying this job.
patched_job_write_request = PatchedJobWriteRequest(
assignee=1,
stage=JobStage("annotation"),
state=OperationStatus("new"),
) # PatchedJobWriteRequest | (optional)
try:
(data, response) = api_client.jobs_api.partial_update(
id,
patched_job_write_request=patched_job_write_request,
)
pprint(data)
except exceptions.ApiException as e:
print("Exception when calling JobsApi.partial_update(): %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | int | A unique integer value identifying this job. | |
patched_job_write_request | PatchedJobWriteRequest | [optional] |
There are also optional kwargs that control the function invocation behavior. Read more here.
Returned values
Returned type: Tuple[JobRead, urllib3.HTTPResponse]
.
Returns a tuple with 2 values: (parsed_response, raw_response)
.
The first value is a model parsed from the response data. The second value is the raw response, which can be useful to get response parameters, such as status code, headers, or raw response data. Read more about invocation parameters and returned values here.
Authorization
basicAuth, csrfAuth, sessionAuth, signatureAuth, tokenAuth
HTTP request headers
- Content-Type: application/json
- Accept: application/vnd.cvat+json
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | - |
partial_update_annotations
partial_update_annotations( action, id, patched_labeled_data_request=None, **kwargs )
Method performs a partial update of annotations in a specific job
Example
from pprint import pprint
from cvat_sdk.api_client import Configuration, ApiClient, exceptions
from cvat_sdk.api_client.models import *
# Set up an API client
# Read Configuration class docs for more info about parameters and authentication methods
configuration = Configuration(
host = "http://localhost",
username = 'YOUR_USERNAME',
password = 'YOUR_PASSWORD',
)
with ApiClient(configuration) as api_client:
action = "create" # str |
id = 1 # int | A unique integer value identifying this job.
patched_labeled_data_request = PatchedLabeledDataRequest(
version=0,
tags=[
LabeledImageRequest(
id=1,
frame=0,
label_id=0,
group=0,
source="manual",
attributes=[
AttributeValRequest(
spec_id=1,
value="value_example",
),
],
),
],
shapes=[
LabeledShapeRequest(
type=ShapeType("rectangle"),
occluded=False,
outside=False,
z_order=0,
rotation=0.0,
points=[
3.14,
],
id=1,
frame=0,
label_id=0,
group=0,
source="manual",
attributes=[
AttributeValRequest(
spec_id=1,
value="value_example",
),
],
elements=[
SubLabeledShapeRequest(
type=ShapeType("rectangle"),
occluded=False,
outside=False,
z_order=0,
rotation=0.0,
points=[
3.14,
],
id=1,
frame=0,
label_id=0,
group=0,
source="manual",
attributes=[
AttributeValRequest(
spec_id=1,
value="value_example",
),
],
),
],
),
],
tracks=[
LabeledTrackRequest(
id=1,
frame=0,
label_id=0,
group=0,
source="manual",
shapes=[
TrackedShapeRequest(
type=ShapeType("rectangle"),
occluded=False,
outside=False,
z_order=0,
rotation=0.0,
points=[
3.14,
],
id=1,
frame=0,
attributes=[
AttributeValRequest(
spec_id=1,
value="value_example",
),
],
),
],
attributes=[
AttributeValRequest(
spec_id=1,
value="value_example",
),
],
elements=[
SubLabeledTrackRequest(
id=1,
frame=0,
label_id=0,
group=0,
source="manual",
shapes=[
TrackedShapeRequest(
type=ShapeType("rectangle"),
occluded=False,
outside=False,
z_order=0,
rotation=0.0,
points=[
3.14,
],
id=1,
frame=0,
attributes=[
AttributeValRequest(
spec_id=1,
value="value_example",
),
],
),
],
attributes=[
AttributeValRequest(
spec_id=1,
value="value_example",
),
],
),
],
),
],
) # PatchedLabeledDataRequest | (optional)
try:
api_client.jobs_api.partial_update_annotations(
action,
id,
patched_labeled_data_request=patched_labeled_data_request,
)
except exceptions.ApiException as e:
print("Exception when calling JobsApi.partial_update_annotations(): %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
action | str | ||
id | int | A unique integer value identifying this job. | |
patched_labeled_data_request | PatchedLabeledDataRequest | [optional] |
There are also optional kwargs that control the function invocation behavior. Read more here.
Returned values
Returned type: Tuple[None, urllib3.HTTPResponse]
.
Returns a tuple with 2 values: (None, raw_response)
.
This endpoint does not have any return value, so None
is always returned as the first value.
The second value is the raw response, which can be useful to get response parameters, such as
status code, headers, or raw response data. Read more about invocation parameters
and returned values here.
Authorization
basicAuth, csrfAuth, sessionAuth, signatureAuth, tokenAuth
HTTP request headers
- Content-Type: application/json, multipart/form-data
- Accept: Not defined
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | Annotations successfully uploaded | - |
retrieve
retrieve( id, **kwargs )
Method returns details of a job
Example
from pprint import pprint
from cvat_sdk.api_client import Configuration, ApiClient, exceptions
from cvat_sdk.api_client.models import *
# Set up an API client
# Read Configuration class docs for more info about parameters and authentication methods
configuration = Configuration(
host = "http://localhost",
username = 'YOUR_USERNAME',
password = 'YOUR_PASSWORD',
)
with ApiClient(configuration) as api_client:
id = 1 # int | A unique integer value identifying this job.
try:
(data, response) = api_client.jobs_api.retrieve(
id,)
pprint(data)
except exceptions.ApiException as e:
print("Exception when calling JobsApi.retrieve(): %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | int | A unique integer value identifying this job. |
There are also optional kwargs that control the function invocation behavior. Read more here.
Returned values
Returned type: Tuple[JobRead, urllib3.HTTPResponse]
.
Returns a tuple with 2 values: (parsed_response, raw_response)
.
The first value is a model parsed from the response data. The second value is the raw response, which can be useful to get response parameters, such as status code, headers, or raw response data. Read more about invocation parameters and returned values here.
Authorization
basicAuth, csrfAuth, sessionAuth, signatureAuth, tokenAuth
HTTP request headers
- Content-Type: Not defined
- Accept: application/vnd.cvat+json
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | - |
retrieve_annotations
retrieve_annotations( id, action=None, cloud_storage_id=None, filename=None, format=None, location=None, use_default_location=None, **kwargs )
Method returns annotations for a specific job as a JSON document. If format is specified, a zip archive is returned.
Example
from pprint import pprint
from cvat_sdk.api_client import Configuration, ApiClient, exceptions
from cvat_sdk.api_client.models import *
# Set up an API client
# Read Configuration class docs for more info about parameters and authentication methods
configuration = Configuration(
host = "http://localhost",
username = 'YOUR_USERNAME',
password = 'YOUR_PASSWORD',
)
with ApiClient(configuration) as api_client:
id = 1 # int | A unique integer value identifying this job.
action = "download" # str | Used to start downloading process after annotation file had been created (optional) if omitted the server will use the default value of "download"
cloud_storage_id = 1 # int | Storage id (optional)
filename = "filename_example" # str | Desired output file name (optional)
format = "format_example" # str | Desired output format name You can get the list of supported formats at: /server/annotation/formats (optional)
location = "cloud_storage" # str | Where need to save downloaded annotation (optional)
use_default_location = True # bool | Use the location that was configured in the task to export annotation (optional) if omitted the server will use the default value of True
try:
(data, response) = api_client.jobs_api.retrieve_annotations(
id,
action=action,
cloud_storage_id=cloud_storage_id,
filename=filename,
format=format,
location=location,
use_default_location=use_default_location,
)
pprint(data)
except exceptions.ApiException as e:
print("Exception when calling JobsApi.retrieve_annotations(): %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | int | A unique integer value identifying this job. | |
action | str | Used to start downloading process after annotation file had been created | [optional] if omitted the server will use the default value of “download” |
cloud_storage_id | int | Storage id | [optional] |
filename | str | Desired output file name | [optional] |
format | str | Desired output format name You can get the list of supported formats at: /server/annotation/formats | [optional] |
location | str | Where need to save downloaded annotation | [optional] |
use_default_location | bool | Use the location that was configured in the task to export annotation | [optional] if omitted the server will use the default value of True |
There are also optional kwargs that control the function invocation behavior. Read more here.
Returned values
Returned type: Tuple[AnnotationsRead, urllib3.HTTPResponse]
.
Returns a tuple with 2 values: (parsed_response, raw_response)
.
The first value is a model parsed from the response data. The second value is the raw response, which can be useful to get response parameters, such as status code, headers, or raw response data. Read more about invocation parameters and returned values here.
Authorization
basicAuth, csrfAuth, sessionAuth, signatureAuth, tokenAuth
HTTP request headers
- Content-Type: Not defined
- Accept: application/vnd.cvat+json
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | Download of file started | - |
201 | Output file is ready for downloading | - |
202 | Exporting has been started | - |
405 | Format is not available | - |
retrieve_data
retrieve_data( id, number=None, quality=None, type=None, **kwargs )
Method returns data for a specific job
Example
from pprint import pprint
from cvat_sdk.api_client import Configuration, ApiClient, exceptions
from cvat_sdk.api_client.models import *
# Set up an API client
# Read Configuration class docs for more info about parameters and authentication methods
configuration = Configuration(
host = "http://localhost",
username = 'YOUR_USERNAME',
password = 'YOUR_PASSWORD',
)
with ApiClient(configuration) as api_client:
id = 1 # int | A unique integer value identifying this job.
number = 1 # int | A unique number value identifying chunk or frame (optional)
quality = "compressed" # str | Specifies the quality level of the requested data (optional)
type = "chunk" # str | Specifies the type of the requested data (optional)
try:
(data, response) = api_client.jobs_api.retrieve_data(
id,
number=number,
quality=quality,
type=type,
)
pprint(data)
except exceptions.ApiException as e:
print("Exception when calling JobsApi.retrieve_data(): %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | int | A unique integer value identifying this job. | |
number | int | A unique number value identifying chunk or frame | [optional] |
quality | str | Specifies the quality level of the requested data | [optional] |
type | str | Specifies the type of the requested data | [optional] |
There are also optional kwargs that control the function invocation behavior. Read more here.
Returned values
Returned type: Tuple[file_type, urllib3.HTTPResponse]
.
Returns a tuple with 2 values: (parsed_response, raw_response)
.
The first value is a model parsed from the response data. The second value is the raw response, which can be useful to get response parameters, such as status code, headers, or raw response data. Read more about invocation parameters and returned values here.
Authorization
basicAuth, csrfAuth, sessionAuth, signatureAuth, tokenAuth
HTTP request headers
- Content-Type: Not defined
- Accept: application/vnd.cvat+json
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | Data of a specific type | - |
retrieve_data_meta
retrieve_data_meta( id, **kwargs )
Method provides a meta information about media files which are related with the job
Example
from pprint import pprint
from cvat_sdk.api_client import Configuration, ApiClient, exceptions
from cvat_sdk.api_client.models import *
# Set up an API client
# Read Configuration class docs for more info about parameters and authentication methods
configuration = Configuration(
host = "http://localhost",
username = 'YOUR_USERNAME',
password = 'YOUR_PASSWORD',
)
with ApiClient(configuration) as api_client:
id = 1 # int | A unique integer value identifying this job.
try:
(data, response) = api_client.jobs_api.retrieve_data_meta(
id,)
pprint(data)
except exceptions.ApiException as e:
print("Exception when calling JobsApi.retrieve_data_meta(): %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | int | A unique integer value identifying this job. |
There are also optional kwargs that control the function invocation behavior. Read more here.
Returned values
Returned type: Tuple[DataMetaRead, urllib3.HTTPResponse]
.
Returns a tuple with 2 values: (parsed_response, raw_response)
.
The first value is a model parsed from the response data. The second value is the raw response, which can be useful to get response parameters, such as status code, headers, or raw response data. Read more about invocation parameters and returned values here.
Authorization
basicAuth, csrfAuth, sessionAuth, signatureAuth, tokenAuth
HTTP request headers
- Content-Type: Not defined
- Accept: application/vnd.cvat+json
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | - |
retrieve_dataset
retrieve_dataset( format, id, action=None, cloud_storage_id=None, filename=None, location=None, use_default_location=None, **kwargs )
Export job as a dataset in a specific format
Example
from pprint import pprint
from cvat_sdk.api_client import Configuration, ApiClient, exceptions
from cvat_sdk.api_client.models import *
# Set up an API client
# Read Configuration class docs for more info about parameters and authentication methods
configuration = Configuration(
host = "http://localhost",
username = 'YOUR_USERNAME',
password = 'YOUR_PASSWORD',
)
with ApiClient(configuration) as api_client:
format = "format_example" # str | Desired output format name You can get the list of supported formats at: /server/annotation/formats
id = 1 # int | A unique integer value identifying this job.
action = "download" # str | Used to start downloading process after annotation file had been created (optional) if omitted the server will use the default value of "download"
cloud_storage_id = 1 # int | Storage id (optional)
filename = "filename_example" # str | Desired output file name (optional)
location = "cloud_storage" # str | Where need to save downloaded dataset (optional)
use_default_location = True # bool | Use the location that was configured in the task to export dataset (optional) if omitted the server will use the default value of True
try:
(data, response) = api_client.jobs_api.retrieve_dataset(
format,
id,
action=action,
cloud_storage_id=cloud_storage_id,
filename=filename,
location=location,
use_default_location=use_default_location,
)
pprint(data)
except exceptions.ApiException as e:
print("Exception when calling JobsApi.retrieve_dataset(): %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
format | str | Desired output format name You can get the list of supported formats at: /server/annotation/formats | |
id | int | A unique integer value identifying this job. | |
action | str | Used to start downloading process after annotation file had been created | [optional] if omitted the server will use the default value of “download” |
cloud_storage_id | int | Storage id | [optional] |
filename | str | Desired output file name | [optional] |
location | str | Where need to save downloaded dataset | [optional] |
use_default_location | bool | Use the location that was configured in the task to export dataset | [optional] if omitted the server will use the default value of True |
There are also optional kwargs that control the function invocation behavior. Read more here.
Returned values
Returned type: Tuple[file_type, urllib3.HTTPResponse]
.
Returns a tuple with 2 values: (parsed_response, raw_response)
.
The first value is a model parsed from the response data. The second value is the raw response, which can be useful to get response parameters, such as status code, headers, or raw response data. Read more about invocation parameters and returned values here.
Authorization
basicAuth, csrfAuth, sessionAuth, signatureAuth, tokenAuth
HTTP request headers
- Content-Type: Not defined
- Accept: application/vnd.cvat+json
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | Download of file started | - |
201 | Output file is ready for downloading | - |
202 | Exporting has been started | - |
405 | Format is not available | - |
retrieve_preview
retrieve_preview( id, **kwargs )
Method returns a preview image for the job
Example
from pprint import pprint
from cvat_sdk.api_client import Configuration, ApiClient, exceptions
from cvat_sdk.api_client.models import *
# Set up an API client
# Read Configuration class docs for more info about parameters and authentication methods
configuration = Configuration(
host = "http://localhost",
username = 'YOUR_USERNAME',
password = 'YOUR_PASSWORD',
)
with ApiClient(configuration) as api_client:
id = 1 # int | A unique integer value identifying this job.
try:
api_client.jobs_api.retrieve_preview(
id,)
except exceptions.ApiException as e:
print("Exception when calling JobsApi.retrieve_preview(): %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | int | A unique integer value identifying this job. |
There are also optional kwargs that control the function invocation behavior. Read more here.
Returned values
Returned type: Tuple[None, urllib3.HTTPResponse]
.
Returns a tuple with 2 values: (None, raw_response)
.
This endpoint does not have any return value, so None
is always returned as the first value.
The second value is the raw response, which can be useful to get response parameters, such as
status code, headers, or raw response data. Read more about invocation parameters
and returned values here.
Authorization
basicAuth, csrfAuth, sessionAuth, signatureAuth, tokenAuth
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | Job image preview | - |
update_annotations
update_annotations( id, cloud_storage_id=None, filename=None, format=None, location=None, rq_id=None, use_default_location=None, job_annotations_update_request=None, **kwargs )
Method performs an update of all annotations in a specific job or used for uploading annotations from a file
To check the status of the process of uploading a job annotations from a file: After initiating the annotations upload, you will receive an rq_id parameter. Make sure to include this parameter as a query parameter in your subsequent PUT /api/jobs/id/annotations requests to track the status of the annotations upload.
Example
from pprint import pprint
from cvat_sdk.api_client import Configuration, ApiClient, exceptions
from cvat_sdk.api_client.models import *
# Set up an API client
# Read Configuration class docs for more info about parameters and authentication methods
configuration = Configuration(
host = "http://localhost",
username = 'YOUR_USERNAME',
password = 'YOUR_PASSWORD',
)
with ApiClient(configuration) as api_client:
id = 1 # int | A unique integer value identifying this job.
cloud_storage_id = 1 # int | Storage id (optional)
filename = "filename_example" # str | Annotation file name (optional)
format = "format_example" # str | Input format name You can get the list of supported formats at: /server/annotation/formats (optional)
location = "cloud_storage" # str | where to import the annotation from (optional)
rq_id = "rq_id_example" # str | rq id (optional)
use_default_location = True # bool | Use the location that was configured in the task to import annotation (optional) if omitted the server will use the default value of True
job_annotations_update_request = JobAnnotationsUpdateRequest(None) # JobAnnotationsUpdateRequest | (optional)
try:
api_client.jobs_api.update_annotations(
id,
cloud_storage_id=cloud_storage_id,
filename=filename,
format=format,
location=location,
rq_id=rq_id,
use_default_location=use_default_location,
job_annotations_update_request=job_annotations_update_request,
)
except exceptions.ApiException as e:
print("Exception when calling JobsApi.update_annotations(): %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | int | A unique integer value identifying this job. | |
cloud_storage_id | int | Storage id | [optional] |
filename | str | Annotation file name | [optional] |
format | str | Input format name You can get the list of supported formats at: /server/annotation/formats | [optional] |
location | str | where to import the annotation from | [optional] |
rq_id | str | rq id | [optional] |
use_default_location | bool | Use the location that was configured in the task to import annotation | [optional] if omitted the server will use the default value of True |
job_annotations_update_request | JobAnnotationsUpdateRequest | [optional] |
There are also optional kwargs that control the function invocation behavior. Read more here.
Returned values
Returned type: Tuple[None, urllib3.HTTPResponse]
.
Returns a tuple with 2 values: (None, raw_response)
.
This endpoint does not have any return value, so None
is always returned as the first value.
The second value is the raw response, which can be useful to get response parameters, such as
status code, headers, or raw response data. Read more about invocation parameters
and returned values here.
Authorization
basicAuth, csrfAuth, sessionAuth, signatureAuth, tokenAuth
HTTP request headers
- Content-Type: application/json, multipart/form-data
- Accept: Not defined
HTTP response details
Status code | Description | Response headers |
---|---|---|
201 | Uploading has finished | - |
202 | Uploading has been started | - |
405 | Format is not available | - |