JobsApi class reference

All URIs are relative tohttp://localhost

MethodHTTP requestDescription
createPOST /api/jobsCreate a job
create_annotationsPOST /api/jobs/{id}/annotations/Import annotations into a job
create_dataset_exportPOST /api/jobs/{id}/dataset/exportInitialize process to export resource as a dataset in a specific format
destroyDELETE /api/jobs/{id}Delete a job
destroy_annotationsDELETE /api/jobs/{id}/annotations/Delete job annotations
listGET /api/jobsList jobs
partial_updatePATCH /api/jobs/{id}Update a job
partial_update_annotationsPATCH /api/jobs/{id}/annotations/Update job annotations
partial_update_data_metaPATCH /api/jobs/{id}/data/metaUpdate metainformation for media files in a job
partial_update_validation_layoutPATCH /api/jobs/{id}/validation_layoutAllows updating current validation configuration
retrieveGET /api/jobs/{id}Get job details
retrieve_annotationsGET /api/jobs/{id}/annotations/Get job annotations
retrieve_dataGET /api/jobs/{id}/dataGet data of a job
retrieve_data_metaGET /api/jobs/{id}/data/metaGet metainformation for media files in a job
retrieve_previewGET /api/jobs/{id}/previewGet a preview image for a job
retrieve_validation_layoutGET /api/jobs/{id}/validation_layoutAllows getting current validation configuration
update_annotationsPUT /api/jobs/{id}/annotations/Replace job annotations

create

create(job_write_request,**kwargs)

Create a job

Example

frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_client:job_write_request=JobWriteRequest(assignee=1,stage=JobStage("annotation"),state=OperationStatus("new"),type=JobType("annotation"),task_id=1,frame_selection_method=FrameSelectionMethod("random_uniform"),frame_count=1,frame_share=3.14,frames_per_job_count=1,frames_per_job_share=3.14,random_seed=0,seed=0,frames=[0,],)# JobWriteRequest |try:(data,response)=api_client.jobs_api.create(job_write_request,)pprint(data)exceptexceptions.ApiExceptionase:print("Exception when calling JobsApi.create():%s\n"%e)

Parameters

NameTypeDescriptionNotes
job_write_requestJobWriteRequest

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 asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.

Authentication

basicAuth, csrfAuth, csrfHeaderAuth, sessionAuth, signatureAuth, tokenAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/vnd.cvat+json

HTTP response details

Status codeDescriptionResponse 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)

Import annotations into a job

The request POST /api/jobs/id/annotations initiates a background process to import annotations into a job. Please, use the GET /api/requests/<rq_id> endpoint for checking status of the process. Therq_id parameter can be found in the response on initiating request.

Example

frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_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 Trueannotation_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,)exceptexceptions.ApiExceptionase:print("Exception when calling JobsApi.create_annotations():%s\n"%e)

Parameters

NameTypeDescriptionNotes
idintA unique integer value identifying this job.
cloud_storage_idintStorage id[optional]
filenamestrAnnotation file name[optional]
formatstrInput format name You can get the list of supported formats at: /server/annotation/formats[optional]
locationstrwhere to import the annotation from[optional]
use_default_locationboolUse 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_requestAnnotationFileRequest[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, soNone is always returned as the first value.The second value is the raw response, which can be useful to get response parameters, such asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.

Authentication

basicAuth, csrfAuth, csrfHeaderAuth, sessionAuth, signatureAuth, tokenAuth

HTTP request headers

  • Content-Type: application/json, multipart/form-data
  • Accept: application/vnd.cvat+json

HTTP response details

Status codeDescriptionResponse headers
201Uploading has finished-
202Uploading has been started-
405Format is not available-

create_dataset_export

create_dataset_export(format,id,cloud_storage_id=None,filename=None,location=None,save_images=None,**kwargs)

Initialize process to export resource as a dataset in a specific format

The requestPOST /api/<projects|tasks|jobs>/id/dataset/export will initialize a background process to export a dataset. To check status of the process please, useGET /api/requests/<rq_id> whererq_id is request ID returned in the response for this endpoint.

Example

frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_client:format="format_example"# str | Desired output format name You can get the list of supported formats at: /server/annotation/formatsid=1# int | A unique integer value identifying this job.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)save_images=False# bool | Include images or not (optional) if omitted the server will use the default value of Falsetry:(data,response)=api_client.jobs_api.create_dataset_export(format,id,cloud_storage_id=cloud_storage_id,filename=filename,location=location,save_images=save_images,)pprint(data)exceptexceptions.ApiExceptionase:print("Exception when calling JobsApi.create_dataset_export():%s\n"%e)

Parameters

NameTypeDescriptionNotes
formatstrDesired output format name You can get the list of supported formats at: /server/annotation/formats
idintA unique integer value identifying this job.
cloud_storage_idintStorage id[optional]
filenamestrDesired output file name[optional]
locationstrWhere need to save downloaded dataset[optional]
save_imagesboolInclude images or not[optional] if omitted the server will use the default value of False

There are also optional kwargs that control the function invocation behavior.Read more here.

Returned values

Returned type:Tuple[RqId, 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 asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.

Authentication

basicAuth, csrfAuth, csrfHeaderAuth, sessionAuth, signatureAuth, tokenAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.cvat+json

HTTP response details

Status codeDescriptionResponse headers
202Exporting has been started-
405Format is not available-
409Exporting is already in progress-

destroy

destroy(id,**kwargs)

Delete a job

Related annotations will be deleted as well. Please note, that not every job can be removed. Currently, it is only available for Ground Truth jobs.

Example

frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_client:id=1# int | A unique integer value identifying this job.try:api_client.jobs_api.destroy(id,)exceptexceptions.ApiExceptionase:print("Exception when calling JobsApi.destroy():%s\n"%e)

Parameters

NameTypeDescriptionNotes
idintA 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, soNone is always returned as the first value.The second value is the raw response, which can be useful to get response parameters, such asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.

Authentication

basicAuth, csrfAuth, csrfHeaderAuth, sessionAuth, signatureAuth, tokenAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status codeDescriptionResponse headers
204The job has been deleted-

destroy_annotations

destroy_annotations(id,**kwargs)

Delete job annotations

Example

frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_client:id=1# int | A unique integer value identifying this job.try:api_client.jobs_api.destroy_annotations(id,)exceptexceptions.ApiExceptionase:print("Exception when calling JobsApi.destroy_annotations():%s\n"%e)

Parameters

NameTypeDescriptionNotes
idintA 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, soNone is always returned as the first value.The second value is the raw response, which can be useful to get response parameters, such asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.

Authentication

basicAuth, csrfAuth, csrfHeaderAuth, sessionAuth, signatureAuth, tokenAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status codeDescriptionResponse headers
204The 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,parent_job_id=None,project_id=None,project_name=None,search=None,sort=None,stage=None,state=None,task_id=None,task_name=None,type=None,**kwargs)

List jobs

Example

frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_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', 'parent_job_id']. (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)parent_job_id=1# int | A simple equality filter for the parent_job_id field (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', 'parent_job_id'] (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,parent_job_id=parent_job_id,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)exceptexceptions.ApiExceptionase:print("Exception when calling JobsApi.list():%s\n"%e)

Parameters

NameTypeDescriptionNotes
x_organizationstrOrganization unique slug[optional]
assigneestrA simple equality filter for the assignee field[optional]
dimensionstrA simple equality filter for the dimension field[optional]
filterstrJSON 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"},""]}]} 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’, ‘parent_job_id’].[optional]
orgstrOrganization unique slug[optional]
org_idintOrganization identifier[optional]
pageintA page number within the paginated result set.[optional]
page_sizeintNumber of results to return per page.[optional]
parent_job_idintA simple equality filter for the parent_job_id field[optional]
project_idintA simple equality filter for the project_id field[optional]
project_namestrA simple equality filter for the project_name field[optional]
searchstrA search term. Available search_fields: (’task_name’, ‘project_name’, ‘assignee’, ‘state’, ‘stage’)[optional]
sortstrWhich 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’, ‘parent_job_id’][optional]
stagestrA simple equality filter for the stage field[optional]
statestrA simple equality filter for the state field[optional]
task_idintA simple equality filter for the task_id field[optional]
task_namestrA simple equality filter for the task_name field[optional]
typestrA 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 asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.

Authentication

basicAuth, csrfAuth, csrfHeaderAuth, sessionAuth, signatureAuth, tokenAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.cvat+json

HTTP response details

Status codeDescriptionResponse headers
200-

partial_update

partial_update(id,patched_job_write_request=None,**kwargs)

Update a job

Example

frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_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)exceptexceptions.ApiExceptionase:print("Exception when calling JobsApi.partial_update():%s\n"%e)

Parameters

NameTypeDescriptionNotes
idintA unique integer value identifying this job.
patched_job_write_requestPatchedJobWriteRequest[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 asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.

Authentication

basicAuth, csrfAuth, csrfHeaderAuth, sessionAuth, signatureAuth, tokenAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/vnd.cvat+json

HTTP response details

Status codeDescriptionResponse headers
200-

partial_update_annotations

partial_update_annotations(action,id,patched_labeled_data_request=None,**kwargs)

Update job annotations

Example

frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_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,)exceptexceptions.ApiExceptionase:print("Exception when calling JobsApi.partial_update_annotations():%s\n"%e)

Parameters

NameTypeDescriptionNotes
actionstr
idintA unique integer value identifying this job.
patched_labeled_data_requestPatchedLabeledDataRequest[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, soNone is always returned as the first value.The second value is the raw response, which can be useful to get response parameters, such asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.

Authentication

basicAuth, csrfAuth, csrfHeaderAuth, sessionAuth, signatureAuth, tokenAuth

HTTP request headers

  • Content-Type: application/json, multipart/form-data
  • Accept: Not defined

HTTP response details

Status codeDescriptionResponse headers
200Annotations successfully uploaded-

partial_update_data_meta

partial_update_data_meta(id,patched_job_data_meta_write_request=None,**kwargs)

Update metainformation for media files in a job

Example

frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_client:id=1# int | A unique integer value identifying this job.patched_job_data_meta_write_request=PatchedJobDataMetaWriteRequest(deleted_frames=[0,],)# PatchedJobDataMetaWriteRequest |  (optional)try:(data,response)=api_client.jobs_api.partial_update_data_meta(id,patched_job_data_meta_write_request=patched_job_data_meta_write_request,)pprint(data)exceptexceptions.ApiExceptionase:print("Exception when calling JobsApi.partial_update_data_meta():%s\n"%e)

Parameters

NameTypeDescriptionNotes
idintA unique integer value identifying this job.
patched_job_data_meta_write_requestPatchedJobDataMetaWriteRequest[optional]

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 asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.

Authentication

basicAuth, csrfAuth, csrfHeaderAuth, sessionAuth, signatureAuth, tokenAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/vnd.cvat+json

HTTP response details

Status codeDescriptionResponse headers
200-

partial_update_validation_layout

partial_update_validation_layout(id,patched_job_validation_layout_write_request=None,**kwargs)

Allows updating current validation configuration

WARNING: this operation is not protected from race conditions. It’s up to the user to ensure no parallel calls to this operation happen. It affects image access, including exports with images, backups, chunk downloading etc.

Example

frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_client:id=1# int | A unique integer value identifying this job.patched_job_validation_layout_write_request=PatchedJobValidationLayoutWriteRequest(frame_selection_method=None,honeypot_real_frames=[0,],)# PatchedJobValidationLayoutWriteRequest |  (optional)try:(data,response)=api_client.jobs_api.partial_update_validation_layout(id,patched_job_validation_layout_write_request=patched_job_validation_layout_write_request,)pprint(data)exceptexceptions.ApiExceptionase:print("Exception when calling JobsApi.partial_update_validation_layout():%s\n"%e)

Parameters

NameTypeDescriptionNotes
idintA unique integer value identifying this job.
patched_job_validation_layout_write_requestPatchedJobValidationLayoutWriteRequest[optional]

There are also optional kwargs that control the function invocation behavior.Read more here.

Returned values

Returned type:Tuple[JobValidationLayoutRead, 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 asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.

Authentication

basicAuth, csrfAuth, csrfHeaderAuth, sessionAuth, signatureAuth, tokenAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/vnd.cvat+json

HTTP response details

Status codeDescriptionResponse headers
200-

retrieve

retrieve(id,**kwargs)

Get job details

Example

frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_client:id=1# int | A unique integer value identifying this job.try:(data,response)=api_client.jobs_api.retrieve(id,)pprint(data)exceptexceptions.ApiExceptionase:print("Exception when calling JobsApi.retrieve():%s\n"%e)

Parameters

NameTypeDescriptionNotes
idintA 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 asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.

Authentication

basicAuth, csrfAuth, csrfHeaderAuth, sessionAuth, signatureAuth, tokenAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.cvat+json

HTTP response details

Status codeDescriptionResponse headers
200-

retrieve_annotations

retrieve_annotations(id,action=None,cloud_storage_id=None,filename=None,format=None,location=None,**kwargs)

Get job annotations

Deprecation warning: Utilizing this endpoint to export job dataset in a specific format is no longer possible. Consider using new API: -POST /api/jobs/<job_id>/dataset/export?save_images=True to initiate export process -GET /api/requests/<rq_id> to check process status, whererq_id is request id returned on initializing request -GET result_url to download a prepared file, whereresult_url can be found in the response on checking status request

Example

frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_client:id=1# int | A unique integer value identifying this job.action="action_example"# str | This parameter is no longer supported (optional)cloud_storage_id=1# int | This parameter is no longer supported (optional)filename="filename_example"# str | This parameter is no longer supported (optional)format="format_example"# str | This parameter is no longer supported (optional)location="cloud_storage"# str | This parameter is no longer supported (optional)try:(data,response)=api_client.jobs_api.retrieve_annotations(id,action=action,cloud_storage_id=cloud_storage_id,filename=filename,format=format,location=location,)pprint(data)exceptexceptions.ApiExceptionase:print("Exception when calling JobsApi.retrieve_annotations():%s\n"%e)

Parameters

NameTypeDescriptionNotes
idintA unique integer value identifying this job.
actionstrThis parameter is no longer supported[optional]
cloud_storage_idintThis parameter is no longer supported[optional]
filenamestrThis parameter is no longer supported[optional]
formatstrThis parameter is no longer supported[optional]
locationstrThis parameter is no longer supported[optional]

There are also optional kwargs that control the function invocation behavior.Read more here.

Returned values

Returned type:Tuple[LabeledData, 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 asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.

Authentication

basicAuth, csrfAuth, csrfHeaderAuth, sessionAuth, signatureAuth, tokenAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.cvat+json

HTTP response details

Status codeDescriptionResponse headers
200-
410API endpoint no longer handles dataset exporting process-

retrieve_data

retrieve_data(id,index=None,number=None,quality=None,type=None,**kwargs)

Get data of a job

Example

frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_client:id=1# int | A unique integer value identifying this job.index=1# int | A unique number value identifying chunk, starts from 0 for each job (optional)number=1# int | A unique number value identifying chunk or frame. The numbers are the same as for the task. Deprecated for chunks in favor of 'index' (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,index=index,number=number,quality=quality,type=type,)pprint(data)exceptexceptions.ApiExceptionase:print("Exception when calling JobsApi.retrieve_data():%s\n"%e)

Parameters

NameTypeDescriptionNotes
idintA unique integer value identifying this job.
indexintA unique number value identifying chunk, starts from 0 for each job[optional]
numberintA unique number value identifying chunk or frame. The numbers are the same as for the task. Deprecated for chunks in favor of ‘index’[optional]
qualitystrSpecifies the quality level of the requested data[optional]
typestrSpecifies 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 asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.

Authentication

basicAuth, csrfAuth, csrfHeaderAuth, sessionAuth, signatureAuth, tokenAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.cvat+json

HTTP response details

Status codeDescriptionResponse headers
200Data of a specific type-

retrieve_data_meta

retrieve_data_meta(id,**kwargs)

Get metainformation for media files in a job

Example

frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_client:id=1# int | A unique integer value identifying this job.try:(data,response)=api_client.jobs_api.retrieve_data_meta(id,)pprint(data)exceptexceptions.ApiExceptionase:print("Exception when calling JobsApi.retrieve_data_meta():%s\n"%e)

Parameters

NameTypeDescriptionNotes
idintA 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 asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.

Authentication

basicAuth, csrfAuth, csrfHeaderAuth, sessionAuth, signatureAuth, tokenAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.cvat+json

HTTP response details

Status codeDescriptionResponse headers
200-

retrieve_preview

retrieve_preview(id,**kwargs)

Get a preview image for a job

Example

frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_client:id=1# int | A unique integer value identifying this job.try:api_client.jobs_api.retrieve_preview(id,)exceptexceptions.ApiExceptionase:print("Exception when calling JobsApi.retrieve_preview():%s\n"%e)

Parameters

NameTypeDescriptionNotes
idintA 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, soNone is always returned as the first value.The second value is the raw response, which can be useful to get response parameters, such asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.

Authentication

basicAuth, csrfAuth, csrfHeaderAuth, sessionAuth, signatureAuth, tokenAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status codeDescriptionResponse headers
200Job image preview-

retrieve_validation_layout

retrieve_validation_layout(id,**kwargs)

Allows getting current validation configuration

Example

frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_client:id=1# int | A unique integer value identifying this job.try:(data,response)=api_client.jobs_api.retrieve_validation_layout(id,)pprint(data)exceptexceptions.ApiExceptionase:print("Exception when calling JobsApi.retrieve_validation_layout():%s\n"%e)

Parameters

NameTypeDescriptionNotes
idintA 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[JobValidationLayoutRead, 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 asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.

Authentication

basicAuth, csrfAuth, csrfHeaderAuth, sessionAuth, signatureAuth, tokenAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.cvat+json

HTTP response details

Status codeDescriptionResponse headers
200-

update_annotations

update_annotations(id,labeled_data_request=None,**kwargs)

Replace job annotations

Example

frompprintimportpprintfromcvat_sdk.api_clientimportConfiguration,ApiClient,exceptionsfromcvat_sdk.api_client.modelsimport*# Set up an API client# Read Configuration class docs for more info about parameters and authentication methodsconfiguration=Configuration(host="http://localhost",username='YOUR_USERNAME',password='YOUR_PASSWORD',)withApiClient(configuration)asapi_client:id=1# int | A unique integer value identifying this job.labeled_data_request=LabeledDataRequest(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",),],),],),],)# LabeledDataRequest |  (optional)try:api_client.jobs_api.update_annotations(id,labeled_data_request=labeled_data_request,)exceptexceptions.ApiExceptionase:print("Exception when calling JobsApi.update_annotations():%s\n"%e)

Parameters

NameTypeDescriptionNotes
idintA unique integer value identifying this job.
labeled_data_requestLabeledDataRequest[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, soNone is always returned as the first value.The second value is the raw response, which can be useful to get response parameters, such asstatus code, headers, or raw response data. Read more about invocation parametersand returned valueshere.

Authentication

basicAuth, csrfAuth, csrfHeaderAuth, sessionAuth, signatureAuth, tokenAuth

HTTP request headers

  • Content-Type: application/json, multipart/form-data
  • Accept: Not defined

HTTP response details

Status codeDescriptionResponse headers
200Annotations have been replaced-