|
|
4 years ago | |
|---|---|---|
| .. | ||
| .openapi-generator | 4 years ago | |
| cvat_sdk | 4 years ago | |
| docs | 4 years ago | |
| gen | 4 years ago | |
| requirements | 4 years ago | |
| .gitignore | 4 years ago | |
| .openapi-generator-ignore | 4 years ago | |
| .remarkignore | 4 years ago | |
| MANIFEST.in | 4 years ago | |
| README.md | 4 years ago | |
| developer_guide.md | 4 years ago | |
| pyproject.toml | 4 years ago | |
| setup.py | 4 years ago | |
README.md
cvat-sdk
REST API for Computer Vision Annotation Tool (CVAT)
This Python package is automatically generated by the OpenAPI Generator project:
- API version: alpha (2.0)
- Package version: 2.0-alpha
- Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://github.com/cvat-ai/cvat
Requirements.
Python >=3.6
Installation & Usage
pip install
If the python package is hosted on a repository, you can install directly using:
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)
Then import the package:
import cvat_sdk
Setuptools
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install to install the package for all users)
Then import the package:
import cvat_sdk
Getting Started
Please follow the installation procedure and then run the following:
import time
import cvat_sdk
from pprint import pprint
from cvat_sdk.api import auth_api
from cvat_sdk.model.login_request import LoginRequest
from cvat_sdk.model.password_change_request import PasswordChangeRequest
from cvat_sdk.model.password_reset_confirm_request import PasswordResetConfirmRequest
from cvat_sdk.model.password_reset_serializer_ex_request import PasswordResetSerializerExRequest
from cvat_sdk.model.rest_auth_detail import RestAuthDetail
from cvat_sdk.model.restricted_register import RestrictedRegister
from cvat_sdk.model.restricted_register_request import RestrictedRegisterRequest
from cvat_sdk.model.signing_request import SigningRequest
from cvat_sdk.model.token import Token
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = cvat_sdk.Configuration(
host = "http://localhost"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: SignatureAuthentication
configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer'
# Configure HTTP basic authorization: basicAuth
configuration = cvat_sdk.Configuration(
username = 'YOUR_USERNAME',
password = 'YOUR_PASSWORD'
)
# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'
# Configure API key authorization: tokenAuth
configuration.api_key['tokenAuth'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['tokenAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with cvat_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = auth_api.AuthApi(api_client)
login_request = LoginRequest(
username="username_example",
email="email_example",
password="password_example",
) # LoginRequest |
x_organization = "X-Organization_example" # str | (optional)
org = "org_example" # str | Organization unique slug (optional)
org_id = 1 # int | Organization identifier (optional)
try:
api_response = api_instance.auth_create_login(login_request, x_organization=x_organization, org=org, org_id=org_id)
pprint(api_response)
except cvat_sdk.ApiException as e:
print("Exception when calling AuthApi->auth_create_login: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to http://localhost
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AuthApi | auth_create_login | POST /api/auth/login | |
| AuthApi | auth_create_logout | POST /api/auth/logout | |
| AuthApi | auth_create_password_change | POST /api/auth/password/change | |
| AuthApi | auth_create_password_reset | POST /api/auth/password/reset | |
| AuthApi | auth_create_password_reset_confirm | POST /api/auth/password/reset/confirm | |
| AuthApi | auth_create_register | POST /api/auth/register | |
| AuthApi | auth_create_signing | POST /api/auth/signing | This method signs URL for access to the server |
| CloudStoragesApi | cloudstorages_create | POST /api/cloudstorages | Method creates a cloud storage with a specified characteristics |
| CloudStoragesApi | cloudstorages_destroy | DELETE /api/cloudstorages/{id} | Method deletes a specific cloud storage |
| CloudStoragesApi | cloudstorages_list | GET /api/cloudstorages | Returns a paginated list of storages according to query parameters |
| CloudStoragesApi | cloudstorages_partial_update | PATCH /api/cloudstorages/{id} | Methods does a partial update of chosen fields in a cloud storage instance |
| CloudStoragesApi | cloudstorages_retrieve | GET /api/cloudstorages/{id} | Method returns details of a specific cloud storage |
| CloudStoragesApi | cloudstorages_retrieve_actions | GET /api/cloudstorages/{id}/actions | Method returns allowed actions for the cloud storage |
| CloudStoragesApi | cloudstorages_retrieve_content | GET /api/cloudstorages/{id}/content | Method returns a manifest content |
| CloudStoragesApi | cloudstorages_retrieve_preview | GET /api/cloudstorages/{id}/preview | Method returns a preview image from a cloud storage |
| CloudStoragesApi | cloudstorages_retrieve_status | GET /api/cloudstorages/{id}/status | Method returns a cloud storage status |
| CommentsApi | comments_create | POST /api/comments | Method creates a comment |
| CommentsApi | comments_destroy | DELETE /api/comments/{id} | Method deletes a comment |
| CommentsApi | comments_list | GET /api/comments | Method returns a paginated list of comments according to query parameters |
| CommentsApi | comments_partial_update | PATCH /api/comments/{id} | Methods does a partial update of chosen fields in a comment |
| CommentsApi | comments_retrieve | GET /api/comments/{id} | Method returns details of a comment |
| InvitationsApi | invitations_create | POST /api/invitations | Method creates an invitation |
| InvitationsApi | invitations_destroy | DELETE /api/invitations/{key} | Method deletes an invitation |
| InvitationsApi | invitations_list | GET /api/invitations | Method returns a paginated list of invitations according to query parameters |
| InvitationsApi | invitations_partial_update | PATCH /api/invitations/{key} | Methods does a partial update of chosen fields in an invitation |
| InvitationsApi | invitations_retrieve | GET /api/invitations/{key} | Method returns details of an invitation |
| IssuesApi | issues_create | POST /api/issues | Method creates an issue |
| IssuesApi | issues_destroy | DELETE /api/issues/{id} | Method deletes an issue |
| IssuesApi | issues_list | GET /api/issues | Method returns a paginated list of issues according to query parameters |
| IssuesApi | issues_list_comments | GET /api/issues/{id}/comments | The action returns all comments of a specific issue |
| IssuesApi | issues_partial_update | PATCH /api/issues/{id} | Methods does a partial update of chosen fields in an issue |
| IssuesApi | issues_retrieve | GET /api/issues/{id} | Method returns details of an issue |
| JobsApi | jobs_create_annotations | POST /api/jobs/{id}/annotations/ | Method allows to upload job annotations |
| JobsApi | jobs_destroy_annotations | DELETE /api/jobs/{id}/annotations/ | Method deletes all annotations for a specific job |
| JobsApi | jobs_list | GET /api/jobs | Method returns a paginated list of jobs according to query parameters |
| JobsApi | jobs_list_commits | GET /api/jobs/{id}/commits | The action returns the list of tracked changes for the job |
| JobsApi | jobs_list_issues | GET /api/jobs/{id}/issues | Method returns list of issues for the job |
| JobsApi | jobs_partial_update | PATCH /api/jobs/{id} | Methods does a partial update of chosen fields in a job |
| JobsApi | jobs_partial_update_annotations | PATCH /api/jobs/{id}/annotations/ | Method performs a partial update of annotations in a specific job |
| JobsApi | jobs_partial_update_annotations_file | PATCH /api/jobs/{id}/annotations/{file_id} | Allows to upload an annotation file chunk. Implements TUS file uploading protocol. |
| JobsApi | jobs_retrieve | GET /api/jobs/{id} | Method returns details of a job |
| JobsApi | jobs_retrieve_annotations | GET /api/jobs/{id}/annotations/ | Method returns annotations for a specific job |
| JobsApi | jobs_retrieve_data | GET /api/jobs/{id}/data | Method returns data for a specific job |
| JobsApi | jobs_retrieve_data_meta | GET /api/jobs/{id}/data/meta | Method provides a meta information about media files which are related with the job |
| JobsApi | jobs_retrieve_dataset | GET /api/jobs/{id}/dataset | Export job as a dataset in a specific format |
| JobsApi | jobs_update | PUT /api/jobs/{id} | Method updates a job by id |
| JobsApi | jobs_update_annotations | PUT /api/jobs/{id}/annotations/ | Method performs an update of all annotations in a specific job |
| LambdaApi | lambda_create_functions | POST /api/lambda/functions/{func_id} | |
| LambdaApi | lambda_create_requests | POST /api/lambda/requests | Method calls the function |
| LambdaApi | lambda_list_functions | GET /api/lambda/functions | Method returns a list of functions |
| LambdaApi | lambda_list_requests | GET /api/lambda/requests | Method returns a list of requests |
| LambdaApi | lambda_retrieve_functions | GET /api/lambda/functions/{func_id} | Method returns the information about the function |
| LambdaApi | lambda_retrieve_requests | GET /api/lambda/requests/{id} | Method returns the status of the request |
| MembershipsApi | memberships_destroy | DELETE /api/memberships/{id} | Method deletes a membership |
| MembershipsApi | memberships_list | GET /api/memberships | Method returns a paginated list of memberships according to query parameters |
| MembershipsApi | memberships_partial_update | PATCH /api/memberships/{id} | Methods does a partial update of chosen fields in a membership |
| MembershipsApi | memberships_retrieve | GET /api/memberships/{id} | Method returns details of a membership |
| OrganizationsApi | organizations_create | POST /api/organizations | Method creates an organization |
| OrganizationsApi | organizations_destroy | DELETE /api/organizations/{id} | Method deletes an organization |
| OrganizationsApi | organizations_list | GET /api/organizations | Method returns a paginated list of organizatins according to query parameters |
| OrganizationsApi | organizations_partial_update | PATCH /api/organizations/{id} | Methods does a partial update of chosen fields in an organization |
| OrganizationsApi | organizations_retrieve | GET /api/organizations/{id} | Method returns details of an organization |
| ProjectsApi | projects_create | POST /api/projects | Method creates a new project |
| ProjectsApi | projects_create_backup | POST /api/projects/backup/ | Methods create a project from a backup |
| ProjectsApi | projects_create_dataset | POST /api/projects/{id}/dataset/ | Import dataset in specific format as a project |
| ProjectsApi | projects_destroy | DELETE /api/projects/{id} | Method deletes a specific project |
| ProjectsApi | projects_list | GET /api/projects | Returns a paginated list of projects according to query parameters (12 projects per page) |
| ProjectsApi | projects_list_tasks | GET /api/projects/{id}/tasks | Method returns information of the tasks of the project with the selected id |
| ProjectsApi | projects_partial_update | PATCH /api/projects/{id} | Methods does a partial update of chosen fields in a project |
| ProjectsApi | projects_partial_update_backup_file | PATCH /api/projects/backup/{file_id} | Allows to upload a file chunk. Implements TUS file uploading protocol. |
| ProjectsApi | projects_partial_update_dataset_file | PATCH /api/projects/{id}/dataset/{file_id} | Allows to upload a file chunk. Implements TUS file uploading protocol. |
| ProjectsApi | projects_retrieve | GET /api/projects/{id} | Method returns details of a specific project |
| ProjectsApi | projects_retrieve_annotations | GET /api/projects/{id}/annotations | Method allows to download project annotations |
| ProjectsApi | projects_retrieve_backup | GET /api/projects/{id}/backup | Methods creates a backup copy of a project |
| ProjectsApi | projects_retrieve_dataset | GET /api/projects/{id}/dataset/ | Export project as a dataset in a specific format |
| RestrictionsApi | restrictions_retrieve_terms_of_use | GET /api/restrictions/terms-of-use | Method provides CVAT terms of use |
| RestrictionsApi | restrictions_retrieve_user_agreements | GET /api/restrictions/user-agreements | Method provides user agreements that the user must accept to register |
| SchemaApi | schema_retrieve | GET /api/schema/ | |
| ServerApi | server_create_exception | POST /api/server/exception | Method saves an exception from a client on the server |
| ServerApi | server_create_logs | POST /api/server/logs | Method saves logs from a client on the server |
| ServerApi | server_list_share | GET /api/server/share | Returns all files and folders that are on the server along specified path |
| ServerApi | server_retrieve_about | GET /api/server/about | Method provides basic CVAT information |
| ServerApi | server_retrieve_annotation_formats | GET /api/server/annotation/formats | Method provides the list of supported annotations formats |
| ServerApi | server_retrieve_plugins | GET /api/server/plugins | Method provides allowed plugins |
| TasksApi | jobs_partial_update_data_meta | PATCH /api/jobs/{id}/data/meta | Method provides a meta information about media files which are related with the job |
| TasksApi | tasks_create | POST /api/tasks | Method creates a new task in a database without any attached images and videos |
| TasksApi | tasks_create_annotations | POST /api/tasks/{id}/annotations/ | Method allows to upload task annotations from storage |
| TasksApi | tasks_create_backup | POST /api/tasks/backup/ | Method recreates a task from an attached task backup file |
| TasksApi | tasks_create_data | POST /api/tasks/{id}/data/ | Method permanently attaches images or video to a task. Supports tus uploads, see more https://tus.io/ |
| TasksApi | tasks_destroy | DELETE /api/tasks/{id} | Method deletes a specific task, all attached jobs, annotations, and data |
| TasksApi | tasks_destroy_annotations | DELETE /api/tasks/{id}/annotations/ | Method deletes all annotations for a specific task |
| TasksApi | tasks_list | GET /api/tasks | Returns a paginated list of tasks according to query parameters (10 tasks per page) |
| TasksApi | tasks_list_jobs | GET /api/tasks/{id}/jobs | Method returns a list of jobs for a specific task |
| TasksApi | tasks_partial_update | PATCH /api/tasks/{id} | Methods does a partial update of chosen fields in a task |
| TasksApi | tasks_partial_update_annotations | PATCH /api/tasks/{id}/annotations/ | Method performs a partial update of annotations in a specific task |
| TasksApi | tasks_partial_update_annotations_file | PATCH /api/tasks/{id}/annotations/{file_id} | Allows to upload an annotation file chunk. Implements TUS file uploading protocol. |
| TasksApi | tasks_partial_update_backup_file | PATCH /api/tasks/backup/{file_id} | Allows to upload a file chunk. Implements TUS file uploading protocol. |
| TasksApi | tasks_partial_update_data_file | PATCH /api/tasks/{id}/data/{file_id} | Allows to upload a file chunk. Implements TUS file uploading protocol. |
| TasksApi | tasks_partial_update_data_meta | PATCH /api/tasks/{id}/data/meta | Method provides a meta information about media files which are related with the task |
| TasksApi | tasks_retrieve | GET /api/tasks/{id} | Method returns details of a specific task |
| TasksApi | tasks_retrieve_annotations | GET /api/tasks/{id}/annotations/ | Method allows to download task annotations |
| TasksApi | tasks_retrieve_backup | GET /api/tasks/{id}/backup | Method backup a specified task |
| TasksApi | tasks_retrieve_data | GET /api/tasks/{id}/data/ | Method returns data for a specific task |
| TasksApi | tasks_retrieve_data_meta | GET /api/tasks/{id}/data/meta | Method provides a meta information about media files which are related with the task |
| TasksApi | tasks_retrieve_dataset | GET /api/tasks/{id}/dataset | Export task as a dataset in a specific format |
| TasksApi | tasks_retrieve_status | GET /api/tasks/{id}/status | When task is being created the method returns information about a status of the creation process |
| TasksApi | tasks_update | PUT /api/tasks/{id} | Method updates a task by id |
| TasksApi | tasks_update_annotations | PUT /api/tasks/{id}/annotations/ | Method allows to upload task annotations |
| UsersApi | users_destroy | DELETE /api/users/{id} | Method deletes a specific user from the server |
| UsersApi | users_list | GET /api/users | Method provides a paginated list of users registered on the server |
| UsersApi | users_partial_update | PATCH /api/users/{id} | Method updates chosen fields of a user |
| UsersApi | users_retrieve | GET /api/users/{id} | Method provides information of a specific user |
| UsersApi | users_retrieve_self | GET /api/users/self | Method returns an instance of a user who is currently authorized |
Documentation For Models
- About
- AnnotationFileRequest
- Attribute
- AttributeRequest
- AttributeVal
- BasicUser
- BasicUserRequest
- ChunkType
- CloudStorageRead
- CloudStorageWrite
- CloudStorageWriteRequest
- CommentRead
- CommentReadOwner
- CommentWrite
- CommentWriteRequest
- CredentialsTypeEnum
- DataMetaRead
- DataRequest
- DatasetFileRequest
- DatasetFormat
- DatasetFormats
- Exception
- ExceptionRequest
- FileInfo
- FileInfoTypeEnum
- FrameMeta
- InputTypeEnum
- InvitationRead
- InvitationWrite
- InvitationWriteRequest
- IssueRead
- IssueWrite
- IssueWriteRequest
- JobCommit
- JobRead
- JobStage
- JobStatus
- JobWrite
- JobWriteRequest
- Label
- LabeledData
- LabeledImage
- LabeledShape
- LabeledTrack
- LocationEnum
- LogEvent
- LogEventRequest
- LoginRequest
- Manifest
- ManifestRequest
- MembershipRead
- MembershipWrite
- MetaUser
- OperationStatus
- OrganizationRead
- OrganizationWrite
- OrganizationWriteRequest
- PaginatedCloudStorageReadList
- PaginatedCommentReadList
- PaginatedInvitationReadList
- PaginatedIssueReadList
- PaginatedJobCommitList
- PaginatedJobReadList
- PaginatedMembershipReadList
- PaginatedMetaUserList
- PaginatedPolymorphicProjectList
- PaginatedTaskReadList
- PasswordChangeRequest
- PasswordResetConfirmRequest
- PasswordResetSerializerExRequest
- PatchedCloudStorageWriteRequest
- PatchedCommentWriteRequest
- PatchedInvitationWriteRequest
- PatchedIssueWriteRequest
- PatchedJobWriteRequest
- PatchedLabelRequest
- PatchedMembershipWriteRequest
- PatchedOrganizationWriteRequest
- PatchedProjectWriteRequest
- PatchedProjectWriteRequestTargetStorage
- PatchedTaskWriteRequest
- PatchedTaskWriteRequestTargetStorage
- PatchedUserRequest
- Plugins
- PolymorphicProject
- ProjectFileRequest
- ProjectRead
- ProjectReadAssignee
- ProjectReadOwner
- ProjectReadTargetStorage
- ProjectSearch
- ProjectWrite
- ProjectWriteRequest
- ProviderTypeEnum
- RestAuthDetail
- RestrictedRegister
- RestrictedRegisterRequest
- RoleEnum
- RqStatus
- RqStatusStateEnum
- Segment
- ShapeType
- SigningRequest
- SimpleJob
- SortingMethod
- Storage
- StorageMethod
- StorageRequest
- StorageType
- TaskFileRequest
- TaskRead
- TaskReadTargetStorage
- TaskWrite
- TaskWriteRequest
- Token
- TrackedShape
- User
- UserAgreement
- UserAgreementRequest
Documentation For Authorization
SignatureAuthentication
- Type: API key
- API key parameter name: sign
- Location: URL query string
basicAuth
- Type: HTTP basic authentication
cookieAuth
- Type: API key
- API key parameter name: sessionid
- Location:
tokenAuth
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
Author
Notes for Large OpenAPI documents
If the OpenAPI document is large, imports in cvat_sdk.apis and cvat_sdk.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:
Solution 1: Use specific imports for apis and models like:
from cvat_sdk.api.default_api import DefaultApifrom cvat_sdk.model.pet import Pet
Solution 2: Before importing the package, adjust the maximum recursion limit as shown below:
import sys
sys.setrecursionlimit(1500)
import cvat_sdk
from cvat_sdk.apis import *
from cvat_sdk.models import *