### Create Asset Example Source: https://docs.cvat.ai/docs/api_sdk/sdk/reference/apis/assets-api Demonstrates how to create a new asset using the Assets API. Requires guide ID and a file to upload. Handles potential API exceptions. ```python 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: guide_id = 1 # int | file = open('/path/to/file', 'rb') # file_type | try: (data, response) = api_client.assets_api.create( guide_id, file,) pprint(data) except exceptions.ApiException as e: print("Exception when calling AssetsApi.create(): %s\n" % e) ``` -------------------------------- ### Install google-drive-ocamlfuse Source: https://docs.cvat.ai/docs/administration/community/advanced/_print Install the google-drive-ocamlfuse utility on Ubuntu using a PPA. This command adds the PPA, updates package lists, and installs the package. ```bash sudo add-apt-repository ppa:alessandro-strada/ppa sudo apt-get update sudo apt-get install google-drive-ocamlfuse ``` -------------------------------- ### Enabling and Starting google-drive-ocamlfuse Service Source: https://docs.cvat.ai/docs/administration/community/advanced/_print Commands to reload systemd, enable the google-drive-ocamlfuse service to start on boot, and then start the service immediately. ```bash sudo systemctl daemon-reload sudo systemctl enable google-drive-ocamlfuse.service sudo systemctl start google-drive-ocamlfuse.service ``` -------------------------------- ### Install Docker and Docker Compose on Ubuntu Source: https://docs.cvat.ai/docs/administration/community/_print Installs Docker and Docker Compose by adding the official Docker GPG key and repository, then installing the necessary packages. ```bash sudo apt-get update sudo apt-get install ca-certificates curl sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin ``` -------------------------------- ### Create Annotation Guide Source: https://docs.cvat.ai/docs/api_sdk/sdk/reference/apis/guides-api Use this snippet to create a new annotation guide. The guide can be associated with a specific task or project. Ensure the Configuration object is correctly set up with host, username, and password. ```python 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: annotation_guide_write_request = AnnotationGuideWriteRequest( task_id=1, project_id=1, markdown="markdown_example", ) # AnnotationGuideWriteRequest | (optional) try: (data, response) = api_client.guides_api.create( annotation_guide_write_request=annotation_guide_write_request, ) pprint(data) except exceptions.ApiException as e: print("Exception when calling GuidesApi.create(): %s\n" % e) ``` -------------------------------- ### Create and Use PyTorch Dataset from CVAT Project Source: https://docs.cvat.ai/docs/api_sdk/sdk/pytorch-adapter This example demonstrates how to create a PyTorch dataset from a CVAT project, load data, and perform basic model inference. Ensure the 'pytorch' extra is installed for cvat_sdk. ```python import torch import torchvision.models from cvat_sdk import make_client from cvat_sdk.pytorch import ProjectVisionDataset, ExtractSingleLabelIndex # create a PyTorch model model = torchvision.models.resnet34( weights=torchvision.models.ResNet34_Weights.IMAGENET1K_V1) model.eval() # log into the CVAT server with make_client("http://localhost", credentials=('user', 'password')) as client: # get the dataset comprising all tasks for the Validation subset of project 12345 dataset = ProjectVisionDataset(client, project_id=12345, include_subsets=['Validation'], # use transforms that fit our neural network transform=torchvision.models.ResNet34_Weights.IMAGENET1K_V1.transforms(), target_transform=ExtractSingleLabelIndex()) # print the number of images in the dataset (in other words, the number of frames # in the included tasks) print(len(dataset)) # get a sample from the dataset image, target = dataset[0] # evaluate the network on the sample and compare the output to the target output = model(image) if torch.equal(output, target): print("correct prediction") else: print("incorrect prediction") ``` -------------------------------- ### Install Detectron2 Locally Source: https://docs.cvat.ai/docs/guides/serverless-tutorial Install the Detectron2 library from your local clone. Ensure you are in the cloned detectron2 directory. ```bash python -m pip install -e . ``` -------------------------------- ### Install google-drive-ocamlfuse Source: https://docs.cvat.ai/docs/administration/community/advanced/mounting_cloud_storages Installs the necessary package for mounting Google Drive. Ensure you have added the PPA first. ```bash sudo add-apt-repository ppa:alessandro-strada/ppa sudo apt-get update sudo apt-get install google-drive-ocamlfuse ``` -------------------------------- ### Install Git on Ubuntu Source: https://docs.cvat.ai/docs/administration/community/basics/installation Installs Git on Ubuntu systems using apt-get. This is a prerequisite for cloning the CVAT repository. ```bash sudo apt-get --no-install-recommends install -y git ``` -------------------------------- ### Install CVAT Packages Source: https://docs.cvat.ai/docs/api_sdk/sdk/developer-guide Install the CVAT SDK and CLI packages using pip. ```bash pip install ./cvat-sdk ./cvat-cli ``` -------------------------------- ### Install Detectron2 Dependencies Source: https://docs.cvat.ai/docs/guides/serverless-tutorial Set up a virtual environment and install the necessary Python packages, including PyTorch and OpenCV, for Detectron2. ```bash python3 -m venv .detectron2 . .detectron2/bin/activate pip install torch==1.8.1+cpu torchvision==0.9.1+cpu torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html pip install opencv-python ``` -------------------------------- ### Install CVAT SDK Source: https://docs.cvat.ai/docs/api_sdk/sdk Install the official release of the CVAT SDK using pip. ```bash pip install cvat-sdk ``` -------------------------------- ### Install CVAT SDK with Masks Extra Source: https://docs.cvat.ai/docs/api_sdk/sdk Install the CVAT SDK with the 'masks' extra to use the cvat_sdk.masks module. ```bash pip install "cvat-sdk[masks]" ``` -------------------------------- ### GuidesApi retrieve Source: https://docs.cvat.ai/docs/api_sdk/sdk/reference/apis Get annotation guide details. ```APIDOC ## GET /api/guides/{id} ### Description Get annotation guide details. ### Method GET ### Endpoint /api/guides/{id} #### Path Parameters - **id** (string) - Required - The ID of the annotation guide to retrieve. ``` -------------------------------- ### Initialize google-drive-ocamlfuse Source: https://docs.cvat.ai/docs/administration/community/advanced/mounting_cloud_storages Runs the tool for the first time to set up configuration and obtain authorization from Google Drive. This creates default directories and opens a browser for authentication. ```bash google-drive-ocamlfuse ``` -------------------------------- ### Client Initialization with Config Source: https://docs.cvat.ai/docs/api_sdk/sdk/highlevel-api Illustrates creating a `Client` instance by explicitly configuring it with a `Config` object. This provides more control over client settings before authentication. ```APIDOC ## Client Initialization with Config ### Description This example demonstrates initializing the `Client` by first creating and configuring a `Config` object, then passing it to the `Client` constructor. This approach offers more granular control over the client's behavior and settings before authentication. ### Method `Client` class constructor used within a context manager. ### Endpoint N/A (SDK function) ### Parameters - **url** (string) - Required - The base URL of the CVAT server. - **config** (Config) - Optional - A `Config` object with custom settings. ### Request Example ```python from cvat_sdk import Config, Client config = Config() # Configure specific settings on the config object, e.g.: # config.allow_unsupported_server = False with Client("https://app.cvat.ai", config=config) as client: client.login(("user", "password")) # Or client.login(AccessTokenCredentials("token")) # Use the client object here pass ``` ### Response - **client** (Client) - An authenticated `Client` object. ### Response Example N/A (SDK object) ``` -------------------------------- ### FreeIPA LDAP Configuration Example Source: https://docs.cvat.ai/docs/administration/community/advanced/_print Example configuration for authenticating users against a FreeIPA server. This setup requires a bind user and is known to work with Enterprise Linux distributions. ```text # FreeIPA Example # The following example should allow for users to authenticate themselves against FreeIPA. # This example requires a dummy user named `cvat_bind`. # The configuration for the bind account does not need any special permissions. # When updating `AUTH_LDAP_BIND_DN`, you can only write the user info in one way, unlike with Active Directory # This config is known to work with AlmaLinux 8, but may work for other versions and flavors of Enterprise Linux. ``` -------------------------------- ### Initialize ApiClient with Configuration Source: https://docs.cvat.ai/docs/api_sdk/sdk/lowlevel-api Demonstrates the basic setup for creating an ApiClient instance using a Configuration object. The ApiClient is managed as a context manager. ```python from cvat_sdk.api_client import ApiClient, Configuration configuration = Configuration(host="http://localhost") with ApiClient(configuration) as api_client: ... ``` -------------------------------- ### FreeIPA LDAP Configuration Example Source: https://docs.cvat.ai/docs/administration/community/_print Example configuration for authenticating users against a FreeIPA LDAP server. This setup requires a bind user and is known to work with Enterprise Linux distributions. ```text ### FreeIPA Example The following example should allow for users to authenticate themselves against FreeIPA. This example requires a dummy user named `cvat_bind`. The configuration for the bind account does not need any special permissions. When updating `AUTH_LDAP_BIND_DN`, you can only write the user info in one way, unlike with Active Directory This config is known to work with AlmaLinux 8, but may work for other versions and flavors of Enterprise Linux. ``` -------------------------------- ### List Deployed Functions Output Source: https://docs.cvat.ai/docs/guides/serverless-tutorial Example output from the 'nuctl get functions' command, showing the status and details of deployed serverless functions. ```text NAMESPACE | NAME | PROJECT | STATE | REPLICAS | NODE PORT nuclio | pth-dschoerk-transt | cvat | ready | 1/1 | 32771 ``` -------------------------------- ### Start Minikube with Registry Addons Source: https://docs.cvat.ai/docs/administration/community/advanced/k8s_deployment_with_helm Starts a Minikube instance with the registry and registry-aliases addons enabled. This is a prerequisite for certain Kubernetes deployments. ```bash minikube start --addons registry,registry-aliases ``` -------------------------------- ### Client Initialization with make_client Source: https://docs.cvat.ai/docs/api_sdk/sdk/highlevel-api Demonstrates how to create and use a `Client` instance using the `make_client` utility function, which simplifies configuration and authentication. The `with` statement ensures automatic session logout. ```APIDOC ## Client Initialization with make_client ### Description This example shows the recommended way to initialize and use the `Client` by leveraging the `make_client` utility function. It handles configuration and authentication, and the `with` statement ensures proper session management by automatically logging out when the block is exited. ### Method `make_client()` utility function used within a context manager. ### Endpoint N/A (SDK function) ### Parameters - **url** (string) - Required - The base URL of the CVAT server. - **credentials** (tuple) - Optional - A tuple containing username and password for authentication. - **access_token** (string) - Optional - A Personal Access Token (PAT) for authentication. ### Request Example ```python from cvat_sdk import make_client # Using username and password with make_client("https://app.cvat.ai", credentials=("user", "password")) as client: # Use the client object here pass # Using Personal Access Token (PAT) with make_client("https://app.cvat.ai", access_token="your_pat_token") as client: # Use the client object here pass ``` ### Response - **client** (Client) - An authenticated `Client` object. ### Response Example N/A (SDK object) ``` -------------------------------- ### Example of Opening Specification Automatically Source: https://docs.cvat.ai/docs/annotation/specification This is an example of how a full URL would look when the '?openGuide' parameter is appended to ensure specifications are always opened. ```URL https://app.cvat.ai/tasks/taskID/jobs/jobID?openGuide ``` -------------------------------- ### VS Code Path Mappings for Debugging Source: https://docs.cvat.ai/docs/contributing/running-tests Example of local-remote path mappings in VS Code's launch.json for debugging CVAT server containers. Adjust paths according to your setup. ```json ... "pathMappings": [ { "localRoot": "${workspaceFolder}/my_venv", "remoteRoot": "/opt/venv", }, { "localRoot": "/some/other/path", "remoteRoot": "/some/container/path", } ] ... ``` -------------------------------- ### Create Project with Labels Source: https://docs.cvat.ai/docs/api_sdk/cli Create a new project with specified labels from a file. ```bash cvat-cli project create "new project" --labels labels.json ``` -------------------------------- ### Update Job Annotations Source: https://docs.cvat.ai/docs/api_sdk/sdk/reference/apis/jobs-api Use this snippet to replace existing annotations for a job. Ensure you have the correct job ID and a properly formatted LabeledDataRequest object. The example includes setup for API client configuration and authentication. ```python 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. labeled_data_request = LabeledDataRequest( version=0, tags=[ LabeledImageRequest( id=1, label_id=0, group=0, source="manual", frame=0, 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, label_id=0, group=0, source="manual", frame=0, attributes=[ AttributeValRequest( spec_id=1, value="value_example", ), ], score=1.0, elements=[ SubLabeledShapeRequest( type=ShapeType("rectangle"), occluded=False, outside=False, z_order=0, rotation=0.0, points=[ 3.14, ], id=1, label_id=0, group=0, source="manual", frame=0, attributes=[ AttributeValRequest( spec_id=1, value="value_example", ), ], score=1.0, ), ], ), ], tracks=[ LabeledTrackRequest( id=1, label_id=0, group=0, source="manual", frame=0, attributes=[ AttributeValRequest( spec_id=1, value="value_example", ), ], shapes=[ TrackedShapeRequest( type=ShapeType("rectangle"), occluded=False, outside=False, z_order=0, rotation=0.0, points=[ 3.14, ], attributes=[ AttributeValRequest( spec_id=1, value="value_example", ), ], id=1, frame=0, ), ], elements=[ SubLabeledTrackRequest( id=1, label_id=0, group=0, source="manual", frame=0, attributes=[ AttributeValRequest( spec_id=1, value="value_example", ), ], shapes=[ TrackedShapeRequest( type=ShapeType("rectangle"), occluded=False, outside=False, z_order=0, rotation=0.0, points=[ 3.14, ], attributes=[ AttributeValRequest( spec_id=1, value="value_example", ), ], id=1, ``` -------------------------------- ### List Conflicts Example Source: https://docs.cvat.ai/docs/api_sdk/sdk/reference/apis/quality-api Demonstrates how to list annotation conflicts using the `list_conflicts` method. Includes setup for API client configuration and handling potential API exceptions. Various optional parameters for filtering and pagination are shown. ```python 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) 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"},""]}]} Details about the syntax used can be found at the link: https://jsonlogic.com/ Available filter_fields: ['frame', 'id', 'job_id', 'project_id', 'severity', 'task_id', 'type']. (optional) frame = 1 # int | A simple equality filter for the frame field (optional) job_id = 1 # int | A simple equality filter for the job_id field (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) report_id = 1 # int | A simple equality filter for report id (optional) severity = "warning" # str | A simple equality filter for the severity field (optional) sort = "sort_example" # str | Which field to use when ordering the results. Available ordering_fields: ['frame', 'id', 'job_id', 'project_id', 'severity', 'task_id', 'type'] (optional) task_id = 1 # int | A simple equality filter for the task_id field (optional) type = "missing_annotation" # str | A simple equality filter for the type field (optional) try: (data, response) = api_client.quality_api.list_conflicts( x_organization=x_organization, filter=filter, frame=frame, job_id=job_id, org=org, org_id=org_id, page=page, page_size=page_size, project_id=project_id, report_id=report_id, severity=severity, sort=sort, task_id=task_id, type=type, ) pprint(data) except exceptions.ApiException as e: print("Exception when calling QualityApi.list_conflicts(): %s\n" % e) ``` -------------------------------- ### Retrieve Access Token Details in Python Source: https://docs.cvat.ai/docs/api_sdk/sdk/reference/apis/auth-api Use this snippet to get details of a specific API access token by its ID. Ensure you have configured the API client with your host, username, and password. The example shows how to handle potential API exceptions. ```python 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 API Access Token. try: (data, response) = api_client.auth_api.retrieve_access_tokens( id,) pprint(data) except exceptions.ApiException as e: print("Exception when calling AuthApi.retrieve_access_tokens(): %s\n" % e) ``` -------------------------------- ### Python Example: Retrieve Job Annotations Source: https://docs.cvat.ai/docs/api_sdk/sdk/reference/apis/jobs-api This snippet shows how to use the retrieve_annotations function from the CVAT SDK to fetch annotations for a given job ID. It includes setup for the API client and error handling. Note that several parameters for format and storage are deprecated. ```python 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 = "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) except exceptions.ApiException as e: print("Exception when calling JobsApi.retrieve_annotations(): %s\n" % e) ``` -------------------------------- ### Create Annotation Guide Source: https://docs.cvat.ai/docs/api_sdk/sdk/reference/apis/guides-api Creates a new annotation guide. The guide can be associated with either a project or a task. ```APIDOC ## POST /api/guides ### Description Create an annotation guide. The new guide will be bound either to a project or a task, depending on parameters. ### Method POST ### Endpoint /api/guides ### Parameters #### Request Body - **annotation_guide_write_request** (AnnotationGuideWriteRequest) - Required/Optional - Description of the annotation guide to create. Can include `task_id`, `project_id`, and `markdown`. ### Request Example ```python from cvat_sdk.api_client.models import AnnotationGuideWriteRequest annotation_guide_write_request = AnnotationGuideWriteRequest( task_id=1, project_id=1, markdown="markdown_example", ) ``` ### Response #### Success Response (201) - **AnnotationGuideRead** - Details of the created annotation guide. #### Response Example ```json { "id": 1, "task_id": 1, "project_id": null, "markdown": "markdown_example", "created_date": "2023-10-27T10:00:00Z", "updated_date": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### List All Projects Source: https://docs.cvat.ai/docs/api_sdk/cli List all available projects. ```bash cvat-cli project ls ``` -------------------------------- ### Check Git Installation Source: https://docs.cvat.ai/docs/administration/community/basics/installation Verify if Git is installed on your system. If not, it will prompt you to install the Xcode Command Line Tools. ```bash git --version ``` -------------------------------- ### Install Node.js and npm on Arch Linux Source: https://docs.cvat.ai/docs/contributing/development-environment Installs the LTS version of Node.js and npm, and ensures Corepack is installed globally. ```bash # Install Node.js and npm sudo pacman -S nodejs-lts-gallium npm sudo npm -g install corepack # ensure corepack is installed ``` -------------------------------- ### Set up Python Virtual Environment for Manifest Script Source: https://docs.cvat.ai/docs/manual/advanced/dataset_manifest Creates and activates a Python virtual environment, then installs necessary packages using `pip`. ```bash python3 -m venv .env . .env/bin/activate pip install -U pip pip install -r utils/dataset_manifest/requirements.in ``` -------------------------------- ### Create Project from Backup Source: https://docs.cvat.ai/docs/api_sdk/cli Create a new project from a previously created backup file. ```bash cvat-cli project create-from-backup project_backup.zip ``` -------------------------------- ### Install Node.js 20 on Ubuntu Source: https://docs.cvat.ai/docs/contributing/development-environment Installs Node.js version 20 and ensures Corepack is installed globally, which is necessary for managing Node.js package manager versions. ```bash # Install Node.js 20 curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash - sudo apt-get install -y nodejs sudo npm -g install corepack # ensure corepack is installed ``` -------------------------------- ### Install Ubuntu library components for create.py Source: https://docs.cvat.ai/docs/dataset_management/_print Installs FFmpeg library components required for video processing when using the `create.py` script directly on Ubuntu. ```bash # Library components sudo apt-get install --no-install-recommends -y \ libavformat-dev libavcodec-dev libavdevice-dev \ libavutil-dev libswscale-dev libswresample-dev libavfilter-dev ``` -------------------------------- ### Install HDF5 and H5py on Mac Source: https://docs.cvat.ai/docs/contributing/development-environment If you encounter 'Failed building wheel for h5py' errors, you may need to install the HDF5 library and specify its directory before installing h5py. ```bash brew install hdf5 export HDF5_DIR="$(brew --prefix hdf5)" pip install --no-binary=h5py h5py ``` -------------------------------- ### Install E2E Test Dependencies Source: https://docs.cvat.ai/docs/contributing/running-tests Navigates to the tests directory and installs npm dependencies using Yarn for E2E testing. Uses immutable installs for reproducible builds. ```bash cd tests yarn --immutable ``` -------------------------------- ### Enable Minikube Local Registry Addons Source: https://docs.cvat.ai/docs/administration/community/_print Enable the registry and registry-aliases addons for Minikube. ```bash minikube addons enable registry minikube addons enable registry-aliases ``` -------------------------------- ### Delete Annotation Guide Source: https://docs.cvat.ai/docs/api_sdk/sdk/reference/apis/guides-api Deletes an existing annotation guide by its ID. ```APIDOC ## DELETE /api/guides/{id} ### Description Delete an annotation guide. ### Method DELETE ### Endpoint /api/guides/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the annotation guide to delete. ### Response #### Success Response (204) No content is returned upon successful deletion. #### Response Example (No content) ``` -------------------------------- ### Install Nuclio CLI Source: https://docs.cvat.ai/docs/administration/community/advanced/installation_automatic_annotation After downloading the Nuclio CLI, grant it execute permissions and create a symbolic link to make it accessible system-wide. ```bash sudo chmod +x nuctl--linux-amd64 sudo ln -sf $(pwd)/nuctl--linux-amd64 /usr/local/bin/nuctl ``` -------------------------------- ### Retrieve Annotation Guide Source: https://docs.cvat.ai/docs/api_sdk/sdk/reference/apis/guides-api Fetches the details of a specific annotation guide by its ID. This method allows retrieval of annotation guide information, returning both the parsed response and the raw HTTP response. ```APIDOC ## retrieve ### Description Get annotation guide details. ### Method GET ### Endpoint /api/v1/guides/{id} ### Parameters #### Path Parameters - **id** (int) - Required - A unique integer value identifying this annotation guide. #### Query Parameters None explicitly defined in source. #### Request Body None explicitly defined in source. ### Request Example ```python from cvat_sdk.api_client import ApiClient, Configuration from cvat_sdk.api_client.models import * 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 annotation guide. try: (data, response) = api_client.guides_api.retrieve(id,) # Process data and response except Exception as e: print(f"Error retrieving guide: {e}") ``` ### Response #### Success Response (200) - **data** (AnnotationGuideRead) - Parsed response data. - **response** (urllib3.HTTPResponse) - Raw HTTP response. #### Response Example ```json { "example": "AnnotationGuideRead object" } ``` ### Authentication accessTokenAuth, basicAuth, csrfAuth, csrfHeaderAuth, sessionAuth, tokenAuth ### HTTP request headers * **Content-Type**: Not defined * **Accept**: application/vnd.cvat+json ``` -------------------------------- ### List of Deployed Functions Source: https://docs.cvat.ai/docs/guides/_print Example output showing the status of deployed functions, including TransT. ```text NAMESPACE | NAME | PROJECT | STATE | REPLICAS | NODE PORT nuclio | pth-dschoerk-transt | cvat | ready | 1/1 | 32771 ``` -------------------------------- ### Pull and Install CVAT Helm Chart from Local Directory Source: https://docs.cvat.ai/docs/administration/community/advanced/_print Pull the CVAT Helm chart from Docker Hub, extract it, and then install it from the local directory. This allows for inspection and customization before installation. ```bash helm pull oci://registry-1.docker.io/cvat/cvat --version tar -xzf cvat-.tgz cd cvat ``` ```bash helm install \ . \ -n \ --create-namespace \ -f values.yaml \ -f values.override.yaml ``` -------------------------------- ### List Quality Settings Source: https://docs.cvat.ai/docs/api_sdk/sdk/reference/apis/quality-api Demonstrates how to list quality settings using the Quality API client. Includes setup for API client configuration and handling potential exceptions. Various optional parameters for filtering, sorting, and pagination are shown. ```python 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) 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"},""]}]} Details about the syntax used can be found at the link: https://jsonlogic.com/ Available filter_fields: ['created_date', 'id', 'inherit', 'project_id', 'task_id', 'updated_date']. (optional) inherit = True # bool | A simple equality filter for the inherit field (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_type = "project" # str | A simple equality filter for parent instance type (optional) project_id = 1 # int | A simple equality filter for project id (optional) sort = "sort_example" # str | Which field to use when ordering the results. Available ordering_fields: ['created_date', 'id', 'inherit', 'project_id', 'task_id', 'updated_date'] (optional) task_id = 1 # int | A simple equality filter for the task_id field (optional) try: (data, response) = api_client.quality_api.list_settings( x_organization=x_organization, filter=filter, inherit=inherit, org=org, org_id=org_id, page=page, page_size=page_size, parent_type=parent_type, project_id=project_id, sort=sort, task_id=task_id, ) pprint(data) except exceptions.ApiException as e: print("Exception when calling QualityApi.list_settings(): %s\n" % e) ``` -------------------------------- ### GuidesApi Source: https://docs.cvat.ai/docs/api_sdk/sdk/reference/apis Reference for the Guides API, allowing interaction with guides within the system. ```APIDOC ## GuidesApi ### Description Provides methods for interacting with guides. ### Class GuidesApi ``` -------------------------------- ### Retrieve Annotation Guide Source: https://docs.cvat.ai/docs/api_sdk/sdk/reference/apis/guides-api Retrieves the details of a specific annotation guide by its ID. ```APIDOC ## GET /api/guides/{id} ### Description Get annotation guide details. ### Method GET ### Endpoint /api/guides/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the annotation guide to retrieve. ### Response #### Success Response (200) - **AnnotationGuideRead** - Details of the requested annotation guide. #### Response Example ```json { "id": 1, "task_id": 1, "project_id": null, "markdown": "markdown_example", "created_date": "2023-10-27T10:00:00Z", "updated_date": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### Configure ApiClient with Basic Authentication Source: https://docs.cvat.ai/docs/api_sdk/sdk/lowlevel-api Illustrates setting up Basic authentication for the ApiClient using a username and password. This method is not recommended for security reasons. ```python configuration = Configuration( username="YOUR_USERNAME", password="YOUR_PASSWORD", ... ) with ApiClient(configuration) as api_client: ... ``` -------------------------------- ### GuidesApi create Source: https://docs.cvat.ai/docs/api_sdk/sdk/reference/apis Create an annotation guide. ```APIDOC ## POST /api/guides ### Description Create an annotation guide. ### Method POST ### Endpoint /api/guides ``` -------------------------------- ### Install Generator Dependencies Source: https://docs.cvat.ai/docs/api_sdk/sdk/developer-guide Install the necessary dependencies for the generator using pip. ```bash pip install -r cvat-sdk/gen/requirements.txt ``` -------------------------------- ### Download and Run OPA Directly Source: https://docs.cvat.ai/docs/contributing/running-tests Downloads the OPA binary, makes it executable, and runs OPA tests directly on the host machine. ```bash curl -L -o opa https://openpolicyagent.org/downloads/v0.63.0/opa_linux_amd64_static chmod +x ./opa ./opa test cvat/apps/*/rules ``` -------------------------------- ### Create Project from Dataset with Verification Source: https://docs.cvat.ai/docs/api_sdk/cli Create a new project from a dataset and set a verification period for import status. ```bash cvat-cli project create "new project" --dataset_path coco.zip --dataset_format "COCO 1.0" \ --completion_verification_period 1 ``` -------------------------------- ### Partial Update Annotation Guide Source: https://docs.cvat.ai/docs/api_sdk/sdk/reference/apis/guides-api Updates specific fields of an existing annotation guide. ```APIDOC ## PATCH /api/guides/{id} ### Description Update an annotation guide. ### Method PATCH ### Endpoint /api/guides/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the annotation guide to update. #### Request Body - **annotation_guide_write_request** (AnnotationGuideWriteRequest) - Optional - Fields to update for the annotation guide. ### Response #### Success Response (200) - **AnnotationGuideRead** - Details of the updated annotation guide. #### Response Example ```json { "id": 1, "task_id": 1, "project_id": null, "markdown": "updated_markdown_example", "created_date": "2023-10-27T10:00:00Z", "updated_date": "2023-10-27T10:05:00Z" } ``` ``` -------------------------------- ### Authorize google-drive-ocamlfuse Source: https://docs.cvat.ai/docs/administration/community/advanced/_print Run google-drive-ocamlfuse without parameters to initiate the authorization process. This will create configuration files and open a browser for authentication. ```bash google-drive-ocamlfuse ```