> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encord.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Import to Consensus Branches

## Overview

To upload labels to a Consensus Project, you need to create a Consensus branch.

ALL Consensus branches start with `encord-`.

## Supported Label/Annotation Formats

**[Encord Format (Recommended)](#import-encord-format-labels)**

* Supports multi-level nested classifications (radio, checklist, or free-form text) under objects or classifications.
* Handles all object types and classification.

**[COCO Format](#import-coco-labels-to-consensus-branches)**

Does not support multiple levels of nested classifications (radio, checklist, or free-form text) under tools or classifications.

### Confidence Score

You can include confidence scores when uploading labels/annotations. Encord automatically calculates model metrics based on your label and prediction sets and assigned confidence scores.

## Label Branches

When importing label/annotation sets into a Consensus Project, they are added as branches to individual label rows on your data units (images, videos, audio). Each data unit has the following:

* A MAIN branch for ground truth annotations or pre-labels.
* Optional Consensus branches and Prediction branches for different label/annotation or prediction sets.

![Label branches](https://storage.googleapis.com/docs-media.encord.com/static/img/annotate/consensus-branch.png)

<Tip>You can [export main branch labels from the UI](/platform-documentation/Annotate/annotate-export/annotate-how-to-export-labels). [Consensus labels and model predictions can only be exported using the SDK](/sdk-documentation/sdk-labels/sdk-export#export-all-consensus-labels).</Tip>

## Import Labels/Annotations to Consensus Projects

Import your labels to a Project in Annotate. Encord currently supports importing labels from the Encord format and from COCO.

### Import Encord-Format Labels

Use `branch_name` to create a label branch in `label_rows_v2` for a data unit.

Use `branch_name` to create a label branch in `label_rows_v2` for a data unit.

<Warning>
  * `branch_name` supports alphanumeric characters (a-z, A-Z, 0-9) and is case sensitive
  * `branch_name` supports the following special characters: hyphens (-), underscores (\_), and periods (.)
</Warning>

<AccordionGroup>
  <Accordion title="Bounding Box">
    **Example 1**

    Imports a single bounding box (`Cherry`) to a single image (`cherry_001.png`).

    **Example 2:**

    Imports three instances (tracking an object across three sequential frames: 103, 104, and 105) of a bounding box (`Cherry`) to a video (`Cherries_video.mp4`).

    **Example 3**

    Imports three bounding boxes (`Cherry`) to a single image (`cherry_001.png`).

    **Example 4:**

    Imports three instances (tracking 3 different objects across three frames: object 1 - frames 103, 104, 105, object 2 - frames 206, 207, 208, and object 3 - frames 313, 315, 317) of three bounding boxes (`Cherry`) to a video (`Cherries_video.mp4`).

    <CodeGroup>
      ```python Bounding Box Template theme={"dark"}
      # Import dependencies
      import os
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import LabelRowV2, Object, OntologyStructure, ObjectInstance
      from encord.objects.coordinates import BoundingBoxCoordinates, RotatableBoundingBoxCoordinates, PolygonCoordinates, PolylineCoordinates, PointCoordinate, BitmaskCoordinates

      # Configuration
      SSH_PATH = "<file-path-to-ssh-private-key>"
      PROJECT_ID = "<unique-id-of-your-project>"
      CONSENSUS_BRANCH_NAME = "<name-of-your-label-branch>"
      ONTOLOGY_OBJECT_TITLE = "<name-of-ontology-object>" # Name of object label in your Ontology
      DATA_UNIT_TITLES = ["<data-unit-title-1>", "<data-unit-title-2>"]  # List of specific data units

      # Ensure SSH path and project id are set
      assert SSH_PATH, "SSH path cannot be None"
      assert PROJECT_ID, "Project id cannot be None"

      # Authenticate with Encord using access key
      user_client = EncordUserClient.create_with_ssh_private_key(
          ssh_private_key_path=Path(SSH_PATH).read_text()
      )

      # Get the project and list label rows for the label branch
      project = user_client.get_project(PROJECT_ID)
      all_consensus_branch_rows = project.list_label_rows_v2(branch_name=CONSENSUS_BRANCH_NAME)

      # Filter label rows based on the specified data unit titles
      consensus_branch_rows = [
          row for row in all_consensus_branch_rows 
          if row.data_title in DATA_UNIT_TITLES
      ]

      if not consensus_branch_rows:
          print("No matching data units found in the specified branch.")
      else:
          print("Data units found:", [row.data_title for row in consensus_branch_rows])

      # Retrieve the specified ontology object by title
      ontology_object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE,
          type_=Object
      )

      # Initialize labels for each selected label row in the label branch
      with project.create_bundle() as bundle:
          for row in consensus_branch_rows:
              row.initialise_labels(bundle=bundle)

      # Add bounding box labels to each filtered label row
      for row in consensus_branch_rows:
          # Instantiate an object instance for bounding box labels
          inst = ontology_object.create_instance()
          inst.set_for_frames(
              coordinates=BoundingBoxCoordinates(
                  height=0.1,
                  width=0.1,
                  top_left_x=0.5,
                  top_left_y=0.5,
              ),
              frames=0,  # Apply to the specified frame
              manual_annotation=False,  # Set to False as this is a label
              confidence=1, # Confidence of your label
          )

          # Add the label instance to the label row
          row.add_object_instance(inst)

      with project.create_bundle() as bundle:
          # Save the row with labels within the bundle
          for row in consensus_branch_rows:
              row.save(bundle=bundle)
      ```

      ```python Example 1 theme={"dark"}
      # Import dependencies
      import os
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import LabelRowV2, Object, OntologyStructure, ObjectInstance
      from encord.objects.coordinates import BoundingBoxCoordinates, RotatableBoundingBoxCoordinates, PolygonCoordinates, PolylineCoordinates, PointCoordinate, BitmaskCoordinates

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "80ae53e3-594c-4120-a108-ee4af105bff3"
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"
      ONTOLOGY_OBJECT_TITLE = "Cherry" # Name of object label in your Ontology
      DATA_UNIT_TITLES = ["cherry_001.png"]  # List of specific data units

      # Ensure SSH path and project id are set
      assert SSH_PATH, "SSH path cannot be None"
      assert PROJECT_ID, "Project id cannot be None"

      # Authenticate with Encord using access key
      user_client = EncordUserClient.create_with_ssh_private_key(
          ssh_private_key_path=Path(SSH_PATH).read_text()
      )

      # Get the project and list label rows for the label branch
      project = user_client.get_project(PROJECT_ID)
      all_consensus_branch_rows = project.list_label_rows_v2(branch_name=CONSENSUS_BRANCH_NAME)

      # Filter label rows based on the specified data unit titles
      consensus_branch_rows = [
          row for row in all_consensus_branch_rows 
          if row.data_title in DATA_UNIT_TITLES
      ]

      if not consensus_branch_rows:
          print("No matching data units found in the specified branch.")
      else:
          print("Data units found:", [row.data_title for row in consensus_branch_rows])

      # Retrieve the specified ontology object by title
      ontology_object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE,
          type_=Object
      )

      # Initialize labels for each selected label row in the label branch
      with project.create_bundle() as bundle:
          for row in consensus_branch_rows:
              row.initialise_labels(bundle=bundle)

      # Add bounding box labels to each filtered label row
      for row in consensus_branch_rows:
          # Instantiate an object instance for bounding box labels
          inst = ontology_object.create_instance()
          inst.set_for_frames(
              coordinates=BoundingBoxCoordinates(
                  height=0.1,
                  width=0.1,
                  top_left_x=0.5,
                  top_left_y=0.5,
              ),
              frames=0,  # Apply to the specified frame
              manual_annotation=False,  # Set to False as this is a label
              confidence=1, # Confidence of your label
          )

          # Add the label instance to the label row
          row.add_object_instance(inst)

      with project.create_bundle() as bundle:
          for row in consensus_branch_rows:
              # Save the row with labels within the bundle
              row.save(bundle=bundle)
      ```

      ```python Example 2 theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import BoundingBoxCoordinates

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"
      ONTOLOGY_OBJECT_TITLE = "Cherry"
      DATA_UNIT_TITLES = ["Cherries_video.mp4"]  # List of specific video data units

      # Authenticate with Encord using access key
      user_client = EncordUserClient.create_with_ssh_private_key(
          ssh_private_key_path=Path(SSH_PATH).read_text()
      )

      # Get the project and list label rows for the label branch
      project = user_client.get_project(PROJECT_ID)
      all_consensus_branch_rows = project.list_label_rows_v2(branch_name=CONSENSUS_BRANCH_NAME)

      # Filter label rows based on the specified data unit titles
      consensus_branch_rows = [
          row for row in all_consensus_branch_rows 
          if row.data_title in DATA_UNIT_TITLES
      ]

      if not consensus_branch_rows:
          print("No matching data units found in the specified branch.")
      else:
          print("Data units found:", [row.data_title for row in consensus_branch_rows])

      # Retrieve the specified ontology object by title
      box_ontology_object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE,
          type_=Object
      )

      with project.create_bundle() as bundle:
          # Initialize labels for each selected label row in the label branch
          for label_row in consensus_branch_rows:
              label_row.initialise_labels(bundle=bundle)

      # Define frame coordinates for video tracking
      coordinates_per_frame = {
          103: BoundingBoxCoordinates(
              height=0.5,
              width=0.5,
              top_left_x=0.2,
              top_left_y=0.2,
          ),
          104: BoundingBoxCoordinates(
              height=0.5,
              width=0.5,
              top_left_x=0.3,
              top_left_y=0.3,
          ),
          105: BoundingBoxCoordinates(
              height=0.5,
              width=0.5,
              top_left_x=0.4,
              top_left_y=0.4,
          ),
      }

      # Add bounding box labels to each filtered label row across specified frames
      for label_row in consensus_branch_rows:
          # Instantiate an object instance for bounding box labels
          box_object_instance = box_ontology_object.create_instance()
          
          # Apply bounding box coordinates for each specified frame
          for frame_number, coordinates in coordinates_per_frame.items():
              box_object_instance.set_for_frames(
                  coordinates=coordinates, 
                  frames=frame_number,  # Specify the frame number
                  manual_annotation=False  # Mark as a label
              )
          
          # Add the object instance to the label row
          label_row.add_object_instance(box_object_instance)
          
      with project.create_bundle() as bundle:
          for label_row in consensus_branch_rows:
              # Save the label row with the updated labels within the bundle
              label_row.save(bundle=bundle)
      ```

      ```python Example 3 theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import BoundingBoxCoordinates

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-II"
      ONTOLOGY_OBJECT_TITLE = "Cherry"
      DATA_UNIT_TITLES = ["cherry_001.png"]  # List of specific image data units

      # Authenticate with Encord using access key
      user_client = EncordUserClient.create_with_ssh_private_key(
          ssh_private_key_path=Path(SSH_PATH).read_text()
      )

      # Get the project and list label rows for the label branch
      project = user_client.get_project(PROJECT_ID)
      all_consensus_branch_rows = project.list_label_rows_v2(branch_name=CONSENSUS_BRANCH_NAME)

      # Filter label rows based on the specified data unit titles
      consensus_branch_rows = [
          row for row in all_consensus_branch_rows 
          if row.data_title in DATA_UNIT_TITLES
      ]

      if not consensus_branch_rows:
          print("No matching data units found in the specified branch.")
      else:
          print("Data units found:", [row.data_title for row in consensus_branch_rows])

      # Retrieve the specified ontology object by title
      box_ontology_object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE,
          type_=Object
      )

      with project.create_bundle() as bundle:
          # Initialize labels for each selected label row in the label branch
          for label_row in consensus_branch_rows:
              label_row.initialise_labels(bundle=bundle)

      # Add bounding box labels to each filtered label row
      for label_row in consensus_branch_rows:
          # Define bounding box coordinates for each label
          bounding_boxes = [
              BoundingBoxCoordinates(height=0.1, width=0.1, top_left_x=0.2, top_left_y=0.2),
              BoundingBoxCoordinates(height=0.1, width=0.1, top_left_x=0.3, top_left_y=0.3),
              BoundingBoxCoordinates(height=0.1, width=0.1, top_left_x=0.4, top_left_y=0.4),
          ]

          # Instantiate and set labels for each bounding box
          for coordinates in bounding_boxes:
              box_object_instance = box_ontology_object.create_instance()
              box_object_instance.set_for_frames(
                  coordinates=coordinates,
                  frames=0,  # Image frame
                  manual_annotation=False,  # Mark as label
                  confidence=1.0,
              )

              # Add each object instance to the label row
              label_row.add_object_instance(box_object_instance)
          
      with project.create_bundle() as bundle:
          for label_row in consensus_branch_rows:
              # Save the label row with the updated labels within the bundle
              label_row.save(bundle=bundle)
      ```

      ```python Example 4 theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import BoundingBoxCoordinates

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-II"
      ONTOLOGY_OBJECT_TITLE = "Cherry"
      DATA_UNIT_TITLES = ["Cherries_video.mp4"]  # List of specific video data units

      # Authenticate with Encord using access key
      user_client = EncordUserClient.create_with_ssh_private_key(
          ssh_private_key_path=Path(SSH_PATH).read_text()
      )

      # Get the project and list label rows for the label branch
      project = user_client.get_project(PROJECT_ID)
      all_consensus_branch_rows = project.list_label_rows_v2(branch_name=CONSENSUS_BRANCH_NAME)

      # Filter label rows based on the specified data unit titles
      consensus_branch_rows = [
          row for row in all_consensus_branch_rows 
          if row.data_title in DATA_UNIT_TITLES
      ]

      if not consensus_branch_rows:
          print("No matching data units found in the specified branch.")
      else:
          print("Data units found:", [row.data_title for row in consensus_branch_rows])

      # Retrieve the specified ontology object by title
      box_ontology_object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE,
          type_=Object
      )

      with project.create_bundle() as bundle:
          # Initialize labels for each selected label row in the label branch
          for label_row in consensus_branch_rows:
              label_row.initialise_labels(bundle=bundle)

      # Define frame coordinates for tracking across multiple frames for each object
      tracking_coordinates = [
          {  # First object tracked across frames 103, 104, 105
              103: BoundingBoxCoordinates(height=0.5, width=0.5, top_left_x=0.2, top_left_y=0.2),
              104: BoundingBoxCoordinates(height=0.5, width=0.5, top_left_x=0.3, top_left_y=0.3),
              105: BoundingBoxCoordinates(height=0.5, width=0.5, top_left_x=0.4, top_left_y=0.4)
          },
          {  # Second object tracked across frames 206, 207, 208
              206: BoundingBoxCoordinates(height=0.5, width=0.5, top_left_x=0.2, top_left_y=0.2),
              207: BoundingBoxCoordinates(height=0.5, width=0.5, top_left_x=0.3, top_left_y=0.3),
              208: BoundingBoxCoordinates(height=0.5, width=0.5, top_left_x=0.4, top_left_y=0.4)
          },
          {  # Third object tracked across frames 313, 315, 317
              313: BoundingBoxCoordinates(height=0.5, width=0.5, top_left_x=0.2, top_left_y=0.2),
              315: BoundingBoxCoordinates(height=0.5, width=0.5, top_left_x=0.3, top_left_y=0.3),
              317: BoundingBoxCoordinates(height=0.5, width=0.5, top_left_x=0.4, top_left_y=0.4)
          },
      ]

      # Add bounding box labels to each filtered label row across specified frames
      for label_row in consensus_branch_rows:
          for frame_coordinates in tracking_coordinates:
              box_object_instance = box_ontology_object.create_instance()
              
              for frame_number, coordinates in frame_coordinates.items():
                  box_object_instance.set_for_frames(
                      coordinates=coordinates, 
                      frames=frame_number,
                      manual_annotation=False,  # Mark as a label
                      confidence=1.0
                  )
              
              # Add each object instance to the label row
              label_row.add_object_instance(box_object_instance)
          
      with project.create_bundle() as bundle:
          for label_row in consensus_branch_rows:
              # Save the label row with the updated labels within the bundle
              label_row.save(bundle=bundle)
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="Rotatable Bounding Box">
    **Example 1**

    Imports a single rotatable bounding box (`Other type of fruit`) to a single image (`apple_001.png`).

    **Example 2**

    Imports three instances (tracking an object across three sequential frames: 120, 121, and 122) of a bounding box (`Other type of fruit`) to a video (`Cherries_video.mp4`).

    **Example 3**

    Imports three rotatable bounding boxes (`Other type of fruit`) to a single image (`apple_001.png`).

    **Example 4:**

    Imports three instances (tracking 3 different objects across three frames: object 1 - frames 120, 121, 122, object 2 - frames 222, 224, 226, and object 3 - frames 321, 323, 325) of three rotatable bounding boxes (`Other type of fruit`) to a video (`Cherries_video.mp4`).

    <CodeGroup>
      ```python Import Rotatable Bounding Box Template theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import RotatableBoundingBoxCoordinates

      # Configuration
      SSH_PATH = "<file-path-to-ssh-private-key>"
      PROJECT_ID = "<unique-id-for-project>"
      CONSENSUS_BRANCH_NAME = "<name-of-your-label-branch>"
      ONTOLOGY_OBJECT_TITLE = "<rotatable-bounding-box-class-title>"
      DATA_UNIT_TITLES = ["<data-unit-title-1>", "<data-unit-title-2>"]  # Specify the data unit titles here

      # Authenticate with Encord using access key
      user_client = EncordUserClient.create_with_ssh_private_key(
          ssh_private_key_path=Path(SSH_PATH).read_text()
      )

      # Get the project and list label rows for the label branch
      project = user_client.get_project(PROJECT_ID)
      all_consensus_branch_rows = project.list_label_rows_v2(branch_name=CONSENSUS_BRANCH_NAME)

      # Filter label rows based on the specified data unit titles
      consensus_branch_rows = [
          row for row in all_consensus_branch_rows 
          if row.data_title in DATA_UNIT_TITLES
      ]

      if not consensus_branch_rows:
          print("No matching data units found in the specified branch.")
      else:
          print("Data units found:", [row.data_title for row in consensus_branch_rows])

      # Retrieve the specified ontology object by title
      rbb_ontology_object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE,
          type_=Object
      )

      with project.create_bundle() as bundle:
          # Initialize labels for each selected label row in the label branch
          for label_row in consensus_branch_rows:
              label_row.initialise_labels(bundle=bundle)

      # Define rotatable bounding box coordinates and frame for each object
      rotatable_bounding_box_labels = [
          {
              "frame_number": 0,
              "coordinates": RotatableBoundingBoxCoordinates(
                  height=0.3,
                  width=0.2,
                  top_left_x=0.1,
                  top_left_y=0.1,
                  theta=15  # Angle of rotation in degrees
              ),
          },
          {
              "frame_number": 5,
              "coordinates": RotatableBoundingBoxCoordinates(
                  height=0.25,
                  width=0.25,
                  top_left_x=0.15,
                  top_left_y=0.15,
                  theta=30
              ),
          },
          {
              "frame_number": 10,
              "coordinates": RotatableBoundingBoxCoordinates(
                  height=0.2,
                  width=0.3,
                  top_left_x=0.2,
                  top_left_y=0.2,
                  theta=45
              ),
          },
      ]

      # Add rotatable bounding box labels to each filtered label row
      for label_row in consensus_branch_rows:
          for label in rotatable_bounding_box_labels:
              rbb_object_instance = rbb_ontology_object.create_instance()
              
              rbb_object_instance.set_for_frames(
                  coordinates=label["coordinates"],
                  frames=label["frame_number"],
                  manual_annotation=False,  # Mark as a label
                  confidence=1.0
              )
              
              # Link the object instance to the label row
              label_row.add_object_instance(rbb_object_instance)
          
      with project.create_bundle() as bundle:
          for label_row in consensus_branch_rows:
              # Save the label row with the updated labels within the bundle
              label_row.save(bundle=bundle)
      ```

      ```python Example 1 theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import RotatableBoundingBoxCoordinates

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"
      DATA_UNIT_TITLE = "apple_001.jpg"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Other type of fruit"  # Ontology class title for rotatable bounding box

      # Authenticate with Encord using access key
      user_client = EncordUserClient.create_with_ssh_private_key(
          ssh_private_key_path=Path(SSH_PATH).read_text()
      )

      # Get the project and list label rows for the label branch
      project = user_client.get_project(PROJECT_ID)
      consensus_branch_rows = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,
          data_title_eq=DATA_UNIT_TITLE
      )

      if not consensus_branch_rows:
          print("No matching data unit found in the specified branch.")
      else:
          print("Data unit found:", consensus_branch_rows[0].data_title)

      # Retrieve the specified ontology object by title
      rbb_ontology_object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE,
          type_=Object
      )

      # Prepare for label imports by creating a bundle
      with project.create_bundle() as bundle:
          # Initialize labels for the label row in the label branch
          label_row = consensus_branch_rows[0]
          label_row.initialise_labels(bundle=bundle)

      # Define the rotatable bounding box coordinates for label
      rbb_coordinates = RotatableBoundingBoxCoordinates(
          height=0.23,
          width=0.13,
          top_left_x=0.3,
          top_left_y=0.5,
          theta=95  # Angle of rotation in degrees
      )

      # Add rotatable bounding box label to the label row
      rbb_object_instance = rbb_ontology_object.create_instance()
      rbb_object_instance.set_for_frames(
          coordinates=rbb_coordinates,
          frames=0,  # Frame for the image
          manual_annotation=False,  # Mark as a label
          confidence=1.0
      )

      # Link the object instance to the label row
      label_row.add_object_instance(rbb_object_instance)

      with project.create_bundle() as bundle:
          # Save the label row with the updated labels within the bundle
          # (useful if you're calling `initialise_labels` on many label rows
          label_row.save(bundle=bundle)
      ```

      ```python Example 2 theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import RotatableBoundingBoxCoordinates

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify the label branch
      DATA_UNIT_TITLE = "Cherries_video.mp4"  # The title of the video data unit
      ONTOLOGY_OBJECT_TITLE = "Other type of fruit"  # The ontology object title for the bounding box

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Creating multiple instances of a rotatable bounding box - START
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Use the label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]


      with project.create_bundle() as bundle:
          # Initialize labels for the selected label row in the label branch
          label_row.initialise_labels(bundle=bundle)

      # Find a rotatable bounding box annotation object in the project ontology
      rbb_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )

      # Define the coordinates for the rotatable bounding boxes across frames
      coordinates_per_frame = {
          120: RotatableBoundingBoxCoordinates(
              height=0.5,
              width=0.5,
              top_left_x=0.2,
              top_left_y=0.2,
              theta=23
          ),
          121: RotatableBoundingBoxCoordinates(
              height=0.5,
              width=0.5,
              top_left_x=0.3,
              top_left_y=0.3,
              theta=27
          ),
          122: RotatableBoundingBoxCoordinates(
              height=0.5,
              width=0.5,
              top_left_x=0.4,
              top_left_y=0.4,
              theta=57
          ),
      }

      # Iterate through the frames and create instances for each bounding box
      for frame_number, coordinates in coordinates_per_frame.items():
          # Instantiate an object instance from the ontology node for each frame
          rbb_object_instance: ObjectInstance = rbb_ontology_object.create_instance()

          # Set the coordinates for the rotatable bounding box for this frame
          rbb_object_instance.set_for_frames(
              coordinates=coordinates,
              frames=frame_number,
              manual_annotation=False,  # Mark as a label
              confidence=1.0  # Optional confidence score
          )

          # Link the object instance to the label row
          label_row.add_object_instance(rbb_object_instance)

      with project.create_bundle() as bundle:
          # Save the label row with the updated labels within the bundle
          label_row.save(bundle=bundle)
      ```

      ```python Example 3 theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import RotatableBoundingBoxCoordinates

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-II"  # Specify the label branch
      DATA_UNIT_TITLE = "apple_001.jpg"  # The title of the image data unit
      ONTOLOGY_OBJECT_TITLE = "Other type of fruit"  # The ontology object title for the bounding box

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get the project and list label rows for the label branch
      project: Project = user_client.get_project(PROJECT_ID)
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Use the label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      with project.create_bundle() as bundle:
          # Initialize labels for the selected label row in the label branch
          label_row.initialise_labels(bundle=bundle)

      # Find the rotatable bounding box annotation object in the project ontology
      rbb_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )

      # Define rotatable bounding box instances with different coordinates
      rotatable_bounding_boxes = [
          RotatableBoundingBoxCoordinates(
              height=0.23,
              width=0.13,
              top_left_x=0.1,
              top_left_y=0.2,
              theta=37
          ),
          RotatableBoundingBoxCoordinates(
              height=0.23,
              width=0.13,
              top_left_x=0.3,
              top_left_y=0.5,
              theta=95
          ),
          RotatableBoundingBoxCoordinates(
              height=0.23,
              width=0.13,
              top_left_x=0.4,
              top_left_y=0.6,
              theta=70
          ),
      ]

      # Iterate over each bounding box and apply them as labels to the label row
      for rbb_coordinates in rotatable_bounding_boxes:
          rbb_object_instance: ObjectInstance = rbb_ontology_object.create_instance()

          rbb_object_instance.set_for_frames(
              coordinates=rbb_coordinates,
              frames=0,  # Image frame
              manual_annotation=False,  # Mark as a label
              confidence=1.0
          )

          # Link the object instance to the label row
          label_row.add_object_instance(rbb_object_instance)

      with project.create_bundle() as bundle:
          # Save the label row with the updated labels within the bundle
          label_row.save(bundle=bundle)
      ```

      ```python Example 4 theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import RotatableBoundingBoxCoordinates

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "<name-of-your-label-branch>"  # Specify the label branch
      DATA_UNIT_TITLE = "Cherries_video.mp4"  # The title of the video data unit
      ONTOLOGY_OBJECT_TITLE = "Other type of fruit"  # The ontology object title for the bounding box

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get the project and list label rows for the label branch
      project: Project = user_client.get_project(PROJECT_ID)
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Use the label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      with project.create_bundle() as bundle:
          # Initialize labels for the selected label row in the label branch
          label_row.initialise_labels(bundle=bundle)

      # Find the rotatable bounding box annotation object in the project ontology
      rbb_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )

      # Define frame coordinates for the first rotatable bounding box
      coordinates_per_frame_01 = {
          120: RotatableBoundingBoxCoordinates(
              height=0.5,
              width=0.5,
              top_left_x=0.2,
              top_left_y=0.2,
              theta=23
          ),
          121: RotatableBoundingBoxCoordinates(
              height=0.5,
              width=0.5,
              top_left_x=0.3,
              top_left_y=0.3,
              theta=27
          ),
          122: RotatableBoundingBoxCoordinates(
              height=0.5,
              width=0.5,
              top_left_x=0.4,
              top_left_y=0.4,
              theta=57
          ),
      }

      # Create and link the first rotatable bounding box to the label row
      rbb_object_instance_01: ObjectInstance = rbb_ontology_object.create_instance()
      for frame_number, coordinates in coordinates_per_frame_01.items():
          rbb_object_instance_01.set_for_frames(
              coordinates=coordinates,
              frames=frame_number,
              manual_annotation=False,  # Mark as a label
              confidence=1.0  # Optional confidence score
          )
      label_row.add_object_instance(rbb_object_instance_01)

      # Define frame coordinates for the second rotatable bounding box
      coordinates_per_frame_02 = {
          222: RotatableBoundingBoxCoordinates(
              height=0.5,
              width=0.5,
              top_left_x=0.2,
              top_left_y=0.2,
              theta=23
          ),
          224: RotatableBoundingBoxCoordinates(
              height=0.5,
              width=0.5,
              top_left_x=0.3,
              top_left_y=0.3,
              theta=27
          ),
          226: RotatableBoundingBoxCoordinates(
              height=0.5,
              width=0.5,
              top_left_x=0.4,
              top_left_y=0.4,
              theta=57
          ),
      }

      # Create and link the second rotatable bounding box to the label row
      rbb_object_instance_02: ObjectInstance = rbb_ontology_object.create_instance()
      for frame_number, coordinates in coordinates_per_frame_02.items():
          rbb_object_instance_02.set_for_frames(
              coordinates=coordinates,
              frames=frame_number,
              manual_annotation=False,  # Mark as a label
              confidence=1.0  # Optional confidence score
          )
      label_row.add_object_instance(rbb_object_instance_02)

      # Define frame coordinates for the third rotatable bounding box
      coordinates_per_frame_03 = {
          321: RotatableBoundingBoxCoordinates(
              height=0.5,
              width=0.5,
              top_left_x=0.2,
              top_left_y=0.2,
              theta=23
          ),
          323: RotatableBoundingBoxCoordinates(
              height=0.5,
              width=0.5,
              top_left_x=0.3,
              top_left_y=0.3,
              theta=27
          ),
          325: RotatableBoundingBoxCoordinates(
              height=0.5,
              width=0.5,
              top_left_x=0.4,
              top_left_y=0.4,
              theta=57
          ),
      }

      # Create and link the third rotatable bounding box to the label row
      rbb_object_instance_03: ObjectInstance = rbb_ontology_object.create_instance()
      for frame_number, coordinates in coordinates_per_frame_03.items():
          rbb_object_instance_03.set_for_frames(
              coordinates=coordinates,
              frames=frame_number,
              manual_annotation=False,  # Mark as a label
              confidence=1.0  # Optional confidence score
          )
      label_row.add_object_instance(rbb_object_instance_03)

      with project.create_bundle() as bundle:
          # Save the label row with the updated labels within the bundle
          label_row.save(bundle=bundle)
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="Polygons (Advanced)">
    Polygons can have simple and complex shapes, including being enclosed in one another, and encompassing separate regions. In each case the polygon's coordinates are arranged in a different way.

    Specifying coordinates for polygons uses this format:

    <CodeGroup>
      ```python Simple theme={"dark"}

      PolygonCoordinates(polygons=[[[PointCoordinate(x1, y1), PointCoordinate(x2, y2),...]]]

      ```

      ```python Donut theme={"dark"}

      PolygonCoordinates(polygons=
      [
          [
              [PointCoordinate(x1, y1), PointCoordinate(x2, y2),...], # Outer ring
              [PointCoordinate(x1, y1), PointCoordinate(x2, y2),...], # Inner ring
          ]
      ]

      ```

      ```python Multiple Polygons theme={"dark"}

      PolygonCoordinates(polygons=
      [
          [
              [PointCoordinate(x1, y1), PointCoordinate(x2, y2),...], # Polygon 1
          ],
          [
              [PointCoordinate(x1, y1), PointCoordinate(x2, y2),...], # Polygon 2
          ],
          [
              [PointCoordinate(x1, y1), PointCoordinate(x2, y2),...], # Polygon 3
          ],

      ]

      ```

      ```python Donut with Object Inside theme={"dark"}

      PolygonCoordinates(polygons=
      [
          [
              [PointCoordinate(x1, y1), PointCoordinate(x2, y2),...], # Outer ring
              [PointCoordinate(x1, y1), PointCoordinate(x2, y2),...], # Inner ring
          ],
          [
              [PointCoordinate(x1, y1), PointCoordinate(x2, y2),...], # Polygon inside
          ],

      ]

      ```
    </CodeGroup>

    **Simple Polygon**

    Import a simple polygon using the recommended method.

    <div class="flex justify-center">
      <img src="https://storage.googleapis.com/docs-media.encord.com/static/img/polygon2.png" />
    </div>

    **Donut**

    Import a complex polygon with a hole in it.

    <div class="flex justify-center">
      <img src="https://storage.googleapis.com/docs-media.encord.com/static/img/polygon3.png" />
    </div>

    **Multiple Polygons**

    Import a complex polygon that is in multiple parts.

    <div class="flex justify-center">
      <img src="https://storage.googleapis.com/docs-media.encord.com/static/img/polygon 4.png" />
    </div>

    **Donut with Object Inside**

    Imports a complex polygon that has a hole in it with another polygon inside.

    <div class="flex justify-center">
      <img src="https://storage.googleapis.com/docs-media.encord.com/static/img/polygon5.png" />
    </div>

    <CodeGroup title="Complex Polygons">
      ```python Simple Polygon theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import PolygonCoordinates, PointCoordinate

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify your label branch
      ONTOLOGY_OBJECT_TITLE = "Persimmon"  # Name of object label in your Ontology

      # Define coordinates for each image
      image_annotations = {
          "cherry-002-dup-001.jpg": [
              [  # Simple Polygon
                  [PointCoordinate(1.000, 0.500), PointCoordinate(0.750, 0.933), 
                   PointCoordinate(0.250, 0.933), PointCoordinate(0.000, 0.500), 
                   PointCoordinate(0.250, 0.067), PointCoordinate(0.750, 0.067)]
              ]
          ],
          
          "cherry-002-dup-002.jpg": [
              [  # Simple Polygon
                  [PointCoordinate(0.900, 0.400), PointCoordinate(0.700, 0.850), 
                   PointCoordinate(0.300, 0.850), PointCoordinate(0.100, 0.400), 
                   PointCoordinate(0.300, 0.100), PointCoordinate(0.700, 0.100)]
              ]
          ],
      }

      # Ensure SSH path and project id are set
      assert SSH_PATH, "SSH path cannot be None"
      assert PROJECT_ID, "Project id cannot be None"

      # Authenticate with Encord using access key
      user_client = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project and list label rows for the specified branch
      project = user_client.get_project(PROJECT_ID)
      all_label_rows = project.list_label_rows_v2(branch_name=CONSENSUS_BRANCH_NAME)

      # Filter label rows based on images in `image_annotations`
      label_rows = [row for row in all_label_rows if row.data_title in image_annotations]

      if not label_rows:
          print("No matching label rows found for specified images in branch '{CONSENSUS_BRANCH_NAME}'.")
          exit()

      print("Processing label rows for:", [row.data_title for row in label_rows])

      with project.create_bundle() as bundle:
          # Prepare for labeling
          for label_row in label_rows:
              label_row.initialise_labels(bundle=bundle)

      for label_row in label_rows:
          image_title = label_row.data_title  # Get the image title
          polygon_data = image_annotations.get(image_title, [])  # Get associated polygons

          if not polygon_data:
              print(f"No polygon data found for {image_title}, skipping.")
              continue

          # Retrieve the specified ontology object by title
          polygon_ontology_object = project.ontology_structure.get_child_by_title(
              title=ONTOLOGY_OBJECT_TITLE,
              type_=Object
          )

          # Iterate through each polygon in the image's annotation data
          for polygon in polygon_data:
              # Instantiate an object instance from the polygon ontology node
              polygon_object_instance = polygon_ontology_object.create_instance()

              # Set the coordinates for the polygon
              polygon_object_instance.set_for_frames(
                  coordinates=PolygonCoordinates(polygon),
                  frames=0,  # Apply to the specified frame
                  manual_annotation=True,  # Set to True for manual annotation
                  confidence=1.0,  # Confidence of your label
              )

              # Link the object instance to the label row
              label_row.add_object_instance(polygon_object_instance)

      with project.create_bundle() as bundle:
          for label_row in label_rows:
              # Save the label row with the polygon object instance within the bundle
              label_row.save(bundle=bundle)

      print("Label rows updated with polygon instances.")

      ```

      ```python Donut theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import PolygonCoordinates, PointCoordinate

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify your label branch
      ONTOLOGY_OBJECT_TITLE = "Persimmon"  # Name of object label in your Ontology

      # Define coordinates for each image (supporting both outer and inner rings)
      image_annotations = {
          "cherry-002-dup-004.jpg": [
              # Outer ring
              [
                  [PointCoordinate(1.000, 0.500), PointCoordinate(0.750, 0.933), 
                   PointCoordinate(0.250, 0.933), PointCoordinate(0.000, 0.500), 
                   PointCoordinate(0.250, 0.067), PointCoordinate(0.750, 0.067)],
              ],
              # Inner ring (hole)
              [
                  [PointCoordinate(0.750, 0.500), PointCoordinate(0.625, 0.717), 
                   PointCoordinate(0.375, 0.717), PointCoordinate(0.250, 0.500), 
                   PointCoordinate(0.375, 0.284), PointCoordinate(0.625, 0.284)]
              ]
          ],
          
          "cherry-002-dup-003.jpg": [
              # Outer ring
              [
                  [PointCoordinate(0.900, 0.400), PointCoordinate(0.700, 0.850), 
                   PointCoordinate(0.300, 0.850), PointCoordinate(0.100, 0.400), 
                   PointCoordinate(0.300, 0.100), PointCoordinate(0.700, 0.100)],
              ],
              # Inner ring (hole)
              [
                  [PointCoordinate(0.700, 0.400), PointCoordinate(0.600, 0.650), 
                   PointCoordinate(0.400, 0.650), PointCoordinate(0.300, 0.400), 
                   PointCoordinate(0.400, 0.200), PointCoordinate(0.600, 0.200)]
              ]
          ],
      }

      # Ensure SSH path and project id are set
      assert SSH_PATH, "SSH path cannot be None"
      assert PROJECT_ID, "Project id cannot be None"

      # Authenticate with Encord using access key
      user_client = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project and list label rows for the specified branch
      project = user_client.get_project(PROJECT_ID)
      all_label_rows = project.list_label_rows_v2(branch_name=CONSENSUS_BRANCH_NAME)

      # Filter label rows based on images in `image_annotations`
      label_rows = [row for row in all_label_rows if row.data_title in image_annotations]

      if not label_rows:
          print("No matching label rows found for specified images in branch '{CONSENSUS_BRANCH_NAME}'.")
          exit()

      print("Processing label rows for:", [row.data_title for row in label_rows])

      with project.create_bundle() as bundle:
          # Prepare for labeling
          for label_row in label_rows:
              label_row.initialise_labels(bundle=bundle)

      for label_row in label_rows:
          image_title = label_row.data_title  # Get the image title
          polygon_data = image_annotations.get(image_title, [])  # Get associated polygons

          if not polygon_data:
              print(f"No polygon data found for {image_title}, skipping.")
              continue

          # Retrieve the specified ontology object by title
          polygon_ontology_object = project.ontology_structure.get_child_by_title(
              title=ONTOLOGY_OBJECT_TITLE,
              type_=Object
          )

          # Iterate through each set of polygons in the image's annotation data
          for polygon_group in polygon_data:
              # Instantiate an object instance from the polygon ontology node
              polygon_object_instance = polygon_ontology_object.create_instance()

              # Set the coordinates for the polygon(s) (outer + inner if applicable)
              polygon_object_instance.set_for_frames(
                  coordinates=PolygonCoordinates(polygon_group),
                  frames=0,  # Apply to the specified frame
                  manual_annotation=True,  # Set to True for manual annotation
                  confidence=1.0,  # Confidence of your label
              )

              # Link the object instance to the label row
              label_row.add_object_instance(polygon_object_instance)

      with project.create_bundle() as bundle:
          for label_row in label_rows:
              # Save the label row with the polygon object instance within the bundle
              label_row.save(bundle=bundle)

      print("Label rows updated with polygon instances.")

      ```

      ```python Multiple Polygons theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import PolygonCoordinates, PointCoordinate

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify your label branch
      ONTOLOGY_OBJECT_TITLE = "Persimmon"  # Name of object label in your Ontology

      # Define coordinates for each image (multiple independent polygons)
      image_annotations = {
          "cherry-002-dup-003.jpg": [
              # Polygon 1
              [
                  [PointCoordinate(0.1, 0.1), PointCoordinate(0.3, 0.1), 
                   PointCoordinate(0.3, 0.3), PointCoordinate(0.1, 0.3)]
              ],
              # Polygon 2
              [
                  [PointCoordinate(0.6, 0.6), PointCoordinate(0.9, 0.6), 
                   PointCoordinate(0.9, 0.9), PointCoordinate(0.6, 0.9)]
              ]
          ],
          
          "cherry-002-dup-006.jpg": [
              # Polygon 1
              [
                  [PointCoordinate(0.2, 0.2), PointCoordinate(0.4, 0.2), 
                   PointCoordinate(0.4, 0.4), PointCoordinate(0.2, 0.4)]
              ],
              # Polygon 2
              [
                  [PointCoordinate(0.5, 0.5), PointCoordinate(0.7, 0.5), 
                   PointCoordinate(0.7, 0.7), PointCoordinate(0.5, 0.7)]
              ]
          ],
      }

      # Ensure SSH path and project id are set
      assert SSH_PATH, "SSH path cannot be None"
      assert PROJECT_ID, "Project id cannot be None"

      # Authenticate with Encord using access key
      user_client = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project and list label rows for the specified branch
      project = user_client.get_project(PROJECT_ID)
      all_label_rows = project.list_label_rows_v2(branch_name=CONSENSUS_BRANCH_NAME)

      # Filter label rows based on images in `image_annotations`
      label_rows = [row for row in all_label_rows if row.data_title in image_annotations]

      if not label_rows:
          print(f"No matching label rows found for specified images in branch '{CONSENSUS_BRANCH_NAME}'.")
          exit()

      print("Processing label rows for:", [row.data_title for row in label_rows])

      with project.create_bundle() as bundle:
          # Prepare for labeling
          for label_row in label_rows:
              label_row.initialise_labels(bundle=bundle)

      for label_row in label_rows:
          image_title = label_row.data_title  # Get the image title
          polygon_data = image_annotations.get(image_title, [])  # Get associated polygons

          if not polygon_data:
              print(f"No polygon data found for {image_title}, skipping.")
              continue

          # Retrieve the specified ontology object by title
          polygon_ontology_object = project.ontology_structure.get_child_by_title(
              title=ONTOLOGY_OBJECT_TITLE,
              type_=Object
          )

          # Iterate through each independent polygon in the image's annotation data
          for polygon in polygon_data:
              # Instantiate an object instance from the polygon ontology node
              polygon_object_instance = polygon_ontology_object.create_instance()

              # Set the coordinates for each polygon separately
              polygon_object_instance.set_for_frames(
                  coordinates=PolygonCoordinates(polygon),
                  frames=0,  # Apply to the specified frame
                  manual_annotation=True,  # Set to True for manual annotation
                  confidence=1.0,  # Confidence of your label
              )

              # Link the object instance to the label row
              label_row.add_object_instance(polygon_object_instance)

      with project.create_bundle() as bundle:
          for label_row in label_rows:
              # Save the label row with the polygon object instances within the bundle
              label_row.save(bundle=bundle)

      print("Label rows updated with multiple independent polygon instances.")


      ```

      ```python Donut with Object Inside theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import PolygonCoordinates, PointCoordinate

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify your label branch
      ONTOLOGY_OBJECT_TITLE = "Persimmon"  # Name of object label in your Ontology

      # Define coordinates for each image (handling donut shapes and nested polygons)
      image_annotations = {
          "cherries-001.jpg": [
              # Donut shape: Outer ring + Inner ring
              [
                  [
                      PointCoordinate(1.000, 0.500), PointCoordinate(0.750, 0.933), 
                      PointCoordinate(0.250, 0.933), PointCoordinate(0.000, 0.500), 
                      PointCoordinate(0.250, 0.067), PointCoordinate(0.750, 0.067)  # Outer ring
                  ],
                  [
                      PointCoordinate(0.750, 0.500), PointCoordinate(0.625, 0.717), 
                      PointCoordinate(0.375, 0.717), PointCoordinate(0.250, 0.500), 
                      PointCoordinate(0.375, 0.284), PointCoordinate(0.625, 0.284)  # Inner ring (hole)
                  ]
              ],
              # Second polygon inside the hole
              [
                  [
                      PointCoordinate(0.550, 0.500), PointCoordinate(0.525, 0.575), 
                      PointCoordinate(0.475, 0.575), PointCoordinate(0.450, 0.500), 
                      PointCoordinate(0.475, 0.425), PointCoordinate(0.525, 0.425)
                  ]
              ]
          ],
          
          "cherries-010.jpg": [
              # Donut shape: Outer ring + Inner ring
              [
                  [
                      PointCoordinate(0.900, 0.400), PointCoordinate(0.700, 0.850), 
                      PointCoordinate(0.300, 0.850), PointCoordinate(0.100, 0.400), 
                      PointCoordinate(0.300, 0.100), PointCoordinate(0.700, 0.100)
                  ],
                  [
                      PointCoordinate(0.700, 0.400), PointCoordinate(0.600, 0.650), 
                      PointCoordinate(0.400, 0.650), PointCoordinate(0.300, 0.400), 
                      PointCoordinate(0.400, 0.200), PointCoordinate(0.600, 0.200)
                  ]
              ],
              # Second polygon inside the hole
              [
                  [
                      PointCoordinate(0.500, 0.500), PointCoordinate(0.550, 0.600), 
                      PointCoordinate(0.450, 0.600), PointCoordinate(0.400, 0.500), 
                      PointCoordinate(0.450, 0.400), PointCoordinate(0.550, 0.400)
                  ]
              ]
          ]
      }

      # Ensure SSH path and project ID are set
      assert SSH_PATH, "SSH path cannot be None"
      assert PROJECT_ID, "Project ID cannot be None"

      # Authenticate with Encord using access key
      user_client = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project and list label rows for the specified branch
      project = user_client.get_project(PROJECT_ID)
      all_label_rows = project.list_label_rows_v2(branch_name=CONSENSUS_BRANCH_NAME)

      # Filter label rows based on images in `image_annotations`
      label_rows = [row for row in all_label_rows if row.data_title in image_annotations]

      if not label_rows:
          print(f"No matching label rows found for specified images in branch '{CONSENSUS_BRANCH_NAME}'.")
          exit()

      print("Processing label rows for:", [row.data_title for row in label_rows])

      with project.create_bundle() as bundle:
          # Prepare for labeling
          for label_row in label_rows:
              label_row.initialise_labels(bundle=bundle)

      for label_row in label_rows:
          image_title = label_row.data_title  # Get the image title
          polygon_data = image_annotations.get(image_title, [])  # Get associated polygons

          if not polygon_data:
              print(f"No polygon data found for {image_title}, skipping.")
              continue

          # Retrieve the specified ontology object by title
          polygon_ontology_object = project.ontology_structure.get_child_by_title(
              title=ONTOLOGY_OBJECT_TITLE,
              type_=Object
          )

          # Iterate through each group of polygons in the image's annotation data
          for polygon_group in polygon_data:
              # Instantiate an object instance from the polygon ontology node
              polygon_object_instance = polygon_ontology_object.create_instance()

              # Check if the polygon group contains multiple polygons (outer + inner ring)
              if len(polygon_group) > 1:
                  # Handle donut shape (outer ring + inner ring)
                  polygon_object_instance.set_for_frames(
                      coordinates=PolygonCoordinates(polygon_group),  # Multiple polygons
                      frames=0,  # Apply to the specified frame
                      manual_annotation=True,  # Set to True for manual annotation
                      confidence=1.0,  # Confidence of your label
                  )
              else:
                  # Handle single independent polygons inside the hole
                  polygon_object_instance.set_for_frames(
                      coordinates=PolygonCoordinates(polygon_group[0]),  # Single polygon
                      frames=0,  # Apply to the specified frame
                      manual_annotation=True,  # Set to True for manual annotation
                      confidence=1.0,  # Confidence of your label
                  )

              # Link the object instance to the label row
              label_row.add_object_instance(polygon_object_instance)

      with project.create_bundle() as bundle:
          for label_row in label_rows:
              # Save the label row with the polygon object instances within the bundle
              label_row.save(bundle=bundle)

      print("Label rows updated with donut-shaped polygons and nested polygons.")

      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="DEPRECATED - Polygons">
    **Example 1**

    Imports a single polygon (`Persimmon`) to a single image (`persimmon_001.jpg`).

    **Example 2**

    Imports three instances (tracking an object across three sequential frames: 143, 144, and 145) of a polygon (`Persimmon`) to a video (`Cherries_video.mp4`).

    **Example 3**

    Imports three polygons (`Persimmon`) to a single image (`persimmon_001.jpg`).

    **Example 4:**

    Imports three instances (tracking 3 different objects across three frames: object 1 - frames 153, 154, 155, object 2 - frames 242, 244, 246, and object 3 - frames 343, 345, 347) of three polygons (`Persimmon`) to a video (`Cherries_video.mp4`).

    <CodeGroup>
      ```python Import Polygon Template theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import PolygonCoordinates, PointCoordinate

      # Configuration
      SSH_PATH = "<file-path-to-ssh-private-key>"
      PROJECT_ID = "<project-unique-id>"
      CONSENSUS_BRANCH_NAME = "<name-of-your-label-branch>"  # Specify the label branch
      DATA_UNIT_TITLE = "<name-of-data-unit>"  # The title of the data unit (image or video)
      ONTOLOGY_OBJECT_TITLE = "<object-name>"  # The ontology object title for the polygon

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get the project and list label rows for the label branch
      project: Project = user_client.get_project(PROJECT_ID)
      consensus_branch_rows = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Use the label branch
          data_title_eq=DATA_UNIT_TITLE
      )

      if not consensus_branch_rows:
          print("No matching data units found in the specified branch.")
      else:
          print("Data units found:", [row.data_title for row in consensus_branch_rows])

      # Initialize labels for each selected label row in the label branch
      label_row = consensus_branch_rows[0]
      label_row.initialise_labels()

      # Find a polygon annotation object in the project ontology
      polygon_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )

      # Instantiate an object instance from the polygon ontology node
      polygon_object_instance: ObjectInstance = polygon_ontology_object.create_instance()

      # Define the polygon coordinates
      polygon_coordinates = PolygonCoordinates([
          PointCoordinate(0.1, 0.2),
          PointCoordinate(0.3, 0.4),
          PointCoordinate(0.5, 0.6),
          PointCoordinate(0.7, 0.8)
      ])

      # Set the polygon label for the specified frame
      polygon_object_instance.set_for_frames(
          coordinates=polygon_coordinates,
          frames=0,  # Specify the frame number
          manual_annotation=False,  # Mark as a label
          confidence=1.0  # Optional confidence score
      )

      # Link the object instance to the label row
      label_row.add_object_instance(polygon_object_instance)

      # Save the label row 
      label_row.save()
      ```

      ```python Example 1 theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import PolygonCoordinates, PointCoordinate

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify your label branch
      ONTOLOGY_OBJECT_TITLE = "Persimmon"  # Name of object label in your Ontology
      DATA_UNIT_TITLE = "persimmon_001.jpg"  # Specific data unit title

      # Ensure SSH path and project id are set
      assert SSH_PATH, "SSH path cannot be None"
      assert PROJECT_ID, "Project id cannot be None"

      # Authenticate with Encord using access key
      user_client = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project and list label rows for the specified branch and data unit
      project = user_client.get_project(PROJECT_ID)
      all_label_rows = project.list_label_rows_v2(branch_name=CONSENSUS_BRANCH_NAME)

      # Filter label rows based on the specified data unit title
      label_rows = [
          row for row in all_label_rows 
          if row.data_title == DATA_UNIT_TITLE
      ]

      if not label_rows:
          print(f"No matching label rows found for {DATA_UNIT_TITLE} in branch '{CONSENSUS_BRANCH_NAME}'.")
          exit()  # Nothing to do so exit early

      print("Label rows found:", [row.data_title for row in label_rows])

      with project.create_bundle() as bundle:
          # Prepare for labeling
          for label_row in label_rows:
              label_row.initialise_labels(bundle=bundle)

      for label_row in label_rows:
          # Retrieve the specified ontology object by title
          polygon_ontology_object = project.ontology_structure.get_child_by_title(
              title=ONTOLOGY_OBJECT_TITLE,
              type_=Object
          )

          # Instantiate an object instance from the polygon ontology node
          polygon_object_instance = polygon_ontology_object.create_instance()

          # The x,y coordinates of each polygon vertex
          polygon_object_instance.set_for_frames(
              coordinates=PolygonCoordinates(
                  [PointCoordinate(.1, .1), PointCoordinate(.2, .2), PointCoordinate(.3, .3), PointCoordinate(.4, .4)]
              ),
              frames=0,  # Apply to the specified frame
              manual_annotation=True,  # Set to True for manual annotation
              confidence=1.0,  # Confidence of your label
          )

          # Link the object instance to the label row
          label_row.add_object_instance(polygon_object_instance)


      with project.create_bundle() as bundle:
          for label_row in label_rows:
              # Save the label row with the polygon object instance within the bundle
              label_row.save(bundle=bundle)

      print("Label rows updated with polygon instances.")
      ```

      ```python Example 2 theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import PolygonCoordinates, PointCoordinate

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify your label branch
      DATA_UNIT_TITLE = "Cherries_video.mp4"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Persimmon"  # Name of object label in your Ontology

      # Ensure SSH path and project id are set
      assert SSH_PATH, "SSH path cannot be None"
      assert PROJECT_ID, "Project id cannot be None"

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Retrieve the label row for the specified data unit
      label_row = project.list_label_rows_v2(
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row
      label_row.initialise_labels()

      # Find the polygon annotation object in the project ontology
      polygon_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )

      # Coordinates for each frame
      coordinates_per_frame = {
          143: PolygonCoordinates(
              [PointCoordinate(.1, .1),
               PointCoordinate(.2, .1),
               PointCoordinate(.3, .2),
               PointCoordinate(.1, .3)]
          ),
          144: PolygonCoordinates(
              [PointCoordinate(.1, .1),
               PointCoordinate(.2, .1),
               PointCoordinate(.3, .2),
               PointCoordinate(.1, .3)]
          ),
          145: PolygonCoordinates(
              [PointCoordinate(.1, .1),
               PointCoordinate(.2, .1),
               PointCoordinate(.3, .2),
               PointCoordinate(.1, .3)]
          ),
      }

      # Create and link polygon object instances for each frame
      for frame_number, coordinates in coordinates_per_frame.items():
          polygon_object_instance: ObjectInstance = polygon_ontology_object.create_instance()
          polygon_object_instance.set_for_frames(
              coordinates=coordinates,
              frames=frame_number,
              manual_annotation=True,  # Set to True for manual annotation
              confidence=1.0,  # Set confidence level as needed
          )
          
          # Link the object instance to the label row
          label_row.add_object_instance(polygon_object_instance)

      # Save the label row 
      label_row.save()
      print("Label row updated with polygon instances.")

      ```

      ```python Example 3 theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import PolygonCoordinates, PointCoordinate

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify your label branch
      DATA_UNIT_TITLE = "persimmon_001.jpg"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Persimmon"  # Name of object label in your Ontology

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to label in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      label_row.initialise_labels()

      # Find a polygon annotation object in the project ontology
      polygon_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )

      # Function to create a polygon object instance
      def create_polygon_instance(ontology_object, coordinates, frame, manual_annotation=True, confidence=1.0):
          polygon_instance = ontology_object.create_instance()
          polygon_instance.set_for_frames(
              coordinates=coordinates,
              frames=frame,
              manual_annotation=manual_annotation,
              confidence=confidence,
          )
          return polygon_instance

      # Define coordinates for polygons
      polygon_coordinates = [
          PolygonCoordinates([PointCoordinate(.1, .1), PointCoordinate(.2, .2), PointCoordinate(.3, .3), PointCoordinate(.4, .4)]),
          PolygonCoordinates([PointCoordinate(.15, .15), PointCoordinate(.25, .25), PointCoordinate(.35, .35), PointCoordinate(.15, .45)]),
          PolygonCoordinates([PointCoordinate(.2, .2), PointCoordinate(.3, .3), PointCoordinate(.4, .4), PointCoordinate(.2, .5)]),
      ]

      # Create and link polygon instances for each set of coordinates
      for coords in polygon_coordinates:
          polygon_instance = create_polygon_instance(polygon_ontology_object, coords, frame=0)
          label_row.add_object_instance(polygon_instance)

      # Save the label row with polygon instances
      label_row.save()
      print("Label row updated with polygon instances.")

      ```

      ```python Example 4 theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import PolygonCoordinates, PointCoordinate

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify your label branch
      DATA_UNIT_TITLE = "Cherries_video.mp4"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Persimmon"  # Name of object label in your Ontology

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to label in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row 
      label_row.initialise_labels()

      # Find a polygon annotation object in the project ontology
      polygon_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )

      # Function to create and add a polygon instance
      def add_polygon_instance(label_row, ontology_object, coordinates_per_frame):
          polygon_instance = ontology_object.create_instance()

          for frame_number, coordinates in coordinates_per_frame.items():
              polygon_instance.set_for_frames(
                  coordinates=coordinates,
                  frames=frame_number,
                  manual_annotation=True,  # Set to True for manual annotation
                  confidence=1.0,  # Set confidence level as needed
              )
          
          # Link the object instance to the label row
          label_row.add_object_instance(polygon_instance)

      # Coordinates for each polygon
      coordinates_list = [
          {
              153: PolygonCoordinates([PointCoordinate(.1, .1), PointCoordinate(.2, .1), PointCoordinate(.3, .2), PointCoordinate(.1, .3)]),
              154: PolygonCoordinates([PointCoordinate(.1, .1), PointCoordinate(.2, .1), PointCoordinate(.3, .2), PointCoordinate(.1, .3)]),
              155: PolygonCoordinates([PointCoordinate(.1, .1), PointCoordinate(.2, .1), PointCoordinate(.3, .2), PointCoordinate(.1, .3)]),
          },
          {
              242: PolygonCoordinates([PointCoordinate(.1, .1), PointCoordinate(.2, .1), PointCoordinate(.3, .2), PointCoordinate(.1, .3)]),
              244: PolygonCoordinates([PointCoordinate(.1, .1), PointCoordinate(.2, .1), PointCoordinate(.3, .2), PointCoordinate(.1, .3)]),
              246: PolygonCoordinates([PointCoordinate(.1, .1), PointCoordinate(.2, .1), PointCoordinate(.3, .2), PointCoordinate(.1, .3)]),
          },
          {
              343: PolygonCoordinates([PointCoordinate(.1, .1), PointCoordinate(.2, .1), PointCoordinate(.3, .2), PointCoordinate(.1, .3)]),
              345: PolygonCoordinates([PointCoordinate(.1, .1), PointCoordinate(.2, .1), PointCoordinate(.3, .2), PointCoordinate(.1, .3)]),
              347: PolygonCoordinates([PointCoordinate(.1, .1), PointCoordinate(.2, .1), PointCoordinate(.3, .2), PointCoordinate(.1, .3)]),
          },
      ]

      # Add polygon instances
      for coordinates in coordinates_list:
          add_polygon_instance(label_row, polygon_ontology_object, coordinates)

      # Save the label row with polygon instances
      label_row.save()
      print("Label row updated with polygon instances.")

      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="Polyline">
    **Example 1**

    Imports a single polyline (`Branch`) to a single image (`persimmon_001.jpg`).

    **Example 2**

    Imports three instances (tracking an object across three sequential frames: 146, 147, and 148) of a polygon (`Branch`) to a video (`Cherries_video.mp4`).

    **Example 3**

    Imports three polylines (`Branch`) to a single image (`persimmon_001.jpg`).

    **Example 4:**

    Imports three instances (tracking 3 different objects across three frames: object 1 - frames 246, 247, 248, object 2 - frames 346, 347, 348, and object 3 - frames 446, 447, 448) of three polylines (`Branch`) to a video (`Cherries_video.mp4`).

    <CodeGroup>
      ```python Import Polyline Template theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import PolylineCoordinates, PointCoordinate

      # Configuration
      SSH_PATH = "<file-path-to-ssh-private-key>"  # Path to your SSH private key
      PROJECT_ID = "<project-unique-id>"  # Unique project id
      CONSENSUS_BRANCH_NAME = "<your-label-branch-name>"  # Specify your label branch
      DATA_UNIT_TITLE = "<name-of-data-unit>"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "<object-name>"  # Name of the polyline object in your ontology

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to label in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row 
      label_row.initialise_labels()

      # Find a polyline annotation object in the project ontology
      polyline_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )

      # Instantiate an object instance from the polyline ontology node
      polyline_object_instance: ObjectInstance = polyline_ontology_object.create_instance()

      # The x,y coordinates of each polyline vertex are specified as follows
      polyline_object_instance.set_for_frames(
          coordinates=PolylineCoordinates(
              [PointCoordinate(.x1, .y1), PointCoordinate(.x2, .y2), PointCoordinate(.x3, .y3), PointCoordinate(.13, .456)]
          ),
          # Add the polyline to the specified frame number
          frames=<frame-number>,  # Replace with the actual frame number
          # There are multiple additional fields that can be set optionally:
          manual_annotation=True,
          confidence=1.0,
      )

      # Link the object instance to the label row
      label_row.add_object_instance(polyline_object_instance)

      # Save the label row with the polyline instance
      label_row.save()
      print("Label row updated with polyline instance.")

      ```

      ```python Example 1 theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import PolylineCoordinates, PointCoordinate

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify your label branch
      DATA_UNIT_TITLE = "apple_001.png"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Branch"  # Name of the polyline object in your ontology

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to label in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row
      label_row.initialise_labels()

      # Find a polyline annotation object in the project ontology
      polyline_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )

      # Instantiate an object instance from the polyline ontology node
      polyline_object_instance: ObjectInstance = polyline_ontology_object.create_instance()

      # The x,y coordinates of each polyline vertex are specified as follows
      polyline_object_instance.set_for_frames(
          coordinates=PolylineCoordinates(
              [PointCoordinate(.1, .1), PointCoordinate(.2, .2), PointCoordinate(.3, .3), PointCoordinate(.4, .4)]
          ),
          # Add the polyline to the image
          frames=0,  # Specify the frame number
          # There are multiple additional fields that can be set optionally:
          manual_annotation=True,
          confidence=1.0,
      )

      # Link the object instance to the label row
      label_row.add_object_instance(polyline_object_instance)

      # Save the label row with the polyline instance 
      label_row.save()
      print("Label row updated with polyline instance.")

      ```

      ```python Example 2 theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import PolylineCoordinates, PointCoordinate

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify your label branch
      DATA_UNIT_TITLE = "Cherries_video.mp4"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Branch"  # Name of the polyline object in your ontology

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to label in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row
      label_row.initialise_labels()

      # Find a polyline annotation object in the project ontology
      polyline_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )

      # Instantiate an object instance from the polyline ontology node
      polyline_object_instance: ObjectInstance = polyline_ontology_object.create_instance()

      # Coordinates for each frame
      coordinates_per_frame = {
          146: PolylineCoordinates(
              [PointCoordinate(.1, .1), PointCoordinate(.2, .1), PointCoordinate(.3, .2), PointCoordinate(.1, .3)]
          ),
          147: PolylineCoordinates(
              [PointCoordinate(.1, .1), PointCoordinate(.2, .1), PointCoordinate(.3, .2), PointCoordinate(.1, .3)]
          ),
          148: PolylineCoordinates(
              [PointCoordinate(.1, .1), PointCoordinate(.2, .1), PointCoordinate(.3, .2), PointCoordinate(.1, .3)]
          ),
      }

      # Set coordinates for each frame in the polyline object instance
      for frame_number, coordinates in coordinates_per_frame.items():
          polyline_object_instance.set_for_frames(
              coordinates=coordinates, frames=frame_number, manual_annotation=True
          )

      # Link the object instance to the label row
      label_row.add_object_instance(polyline_object_instance)

      # Save the label row with the polyline instance
      label_row.save()
      print("Label row updated with polyline instance.")

      ```

      ```python Example 3 theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import PolylineCoordinates, PointCoordinate

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify your label branch
      DATA_UNIT_TITLE = "apple_001.png"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Branch"  # Name of the polyline object in your ontology

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to label in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row
      label_row.initialise_labels()

      # Find a polyline annotation object in the project ontology
      polyline_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )

      # Polyline 1 - START
      # Instantiate an object instance from the polyline ontology node
      polyline_object_instance01: ObjectInstance = polyline_ontology_object.create_instance()

      # The x,y coordinates of each polyline vertex are specified as follows
      polyline_object_instance01.set_for_frames(
          coordinates=PolylineCoordinates(
              [PointCoordinate(.1, .1), PointCoordinate(.2, .2), PointCoordinate(.3, .3), PointCoordinate(.4, .4)]
          ),
          # Add the polyline to the image
          frames=0,
          # There are multiple additional fields that can be set optionally:
          manual_annotation=True,
          confidence=1.0,
      )

      # Link the object instance to the label row
      label_row.add_object_instance(polyline_object_instance01)
      # Polyline 1 - END

      # Polyline 2 - START
      # Instantiate an object instance from the polyline ontology node
      polyline_object_instance02: ObjectInstance = polyline_ontology_object.create_instance()

      # The x,y coordinates of each polyline vertex are specified as follows
      polyline_object_instance02.set_for_frames(
          coordinates=PolylineCoordinates(
              [PointCoordinate(.15, .15), PointCoordinate(.25, .25), PointCoordinate(.35, .35), PointCoordinate(.45, .45)]
          ),
          # Add the polyline to the image
          frames=0,
          # There are multiple additional fields that can be set optionally:
          manual_annotation=True,
      )

      # Link the object instance to the label row
      label_row.add_object_instance(polyline_object_instance02)
      # Polyline 2 - END

      # Polyline 3 - START
      # Instantiate an object instance from the polyline ontology node
      polyline_object_instance03: ObjectInstance = polyline_ontology_object.create_instance()

      # The x,y coordinates of each polyline vertex are specified as follows
      polyline_object_instance03.set_for_frames(
          coordinates=PolylineCoordinates(
              [PointCoordinate(.17, .17), PointCoordinate(.27, .27), PointCoordinate(.37, .37), PointCoordinate(.47, .47)]
          ),
          # Add the polyline to the image
          frames=0,
          # There are multiple additional fields that can be set optionally:
          manual_annotation=True,
      )

      # Link the object instance to the label row
      label_row.add_object_instance(polyline_object_instance03)
      # Polyline 3 - END

      # Save the label row with the polyline instances
      label_row.save()
      print("Label row updated with polyline instances.")
      ```

      ```python Example 4 theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import PolylineCoordinates, PointCoordinate

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify your label branch
      DATA_UNIT_TITLE = "Cherries_video.mp4"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Branch"  # Name of the polyline object in your ontology

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to label in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row
      label_row.initialise_labels()

      # Find a polyline annotation object in the project ontology
      polyline_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )

      # Polyline 1 - START
      # Instantiate an object instance from the polyline ontology node
      polyline_object_instance01: ObjectInstance = polyline_ontology_object.create_instance()

      coordinates_per_frame = {
          246: PolylineCoordinates(
              [PointCoordinate(.1, .1),
               PointCoordinate(.2, .1),
               PointCoordinate(.3, .2),
               PointCoordinate(.1, .3)]
          ),
          247: PolylineCoordinates(
              [PointCoordinate(.1, .1),
               PointCoordinate(.2, .1),
               PointCoordinate(.3, .2),
               PointCoordinate(.1, .3)]
          ),
          248: PolylineCoordinates(
              [PointCoordinate(.1, .1),
               PointCoordinate(.2, .1),
               PointCoordinate(.3, .2),
               PointCoordinate(.1, .3)]
          ),
      }
      for frame_number, coordinates in coordinates_per_frame.items():
          polyline_object_instance01.set_for_frames(
              coordinates=coordinates, frames=frame_number, manual_annotation=True
          )

      # Link the object instance to the label row
      label_row.add_object_instance(polyline_object_instance01)
      # Polyline 1 - END

      # Polyline 2 - START
      # Instantiate an object instance from the polyline ontology node
      polyline_object_instance02: ObjectInstance = polyline_ontology_object.create_instance()

      coordinates_per_frame = {
          346: PolylineCoordinates(
              [PointCoordinate(.11, .11),
               PointCoordinate(.21, .11),
               PointCoordinate(.31, .21),
               PointCoordinate(.11, .31)]
          ),
          347: PolylineCoordinates(
              [PointCoordinate(.11, .11),
               PointCoordinate(.21, .11),
               PointCoordinate(.31, .21),
               PointCoordinate(.11, .31)]
          ),
          348: PolylineCoordinates(
              [PointCoordinate(.11, .11),
               PointCoordinate(.21, .11),
               PointCoordinate(.31, .21),
               PointCoordinate(.11, .31)]
          ),
      }
      for frame_number, coordinates in coordinates_per_frame.items():
          polyline_object_instance02.set_for_frames(
              coordinates=coordinates, frames=frame_number, manual_annotation=True
          )

      # Link the object instance to the label row
      label_row.add_object_instance(polyline_object_instance02)
      # Polyline 2 - END

      # Polyline 3 - START
      # Instantiate an object instance from the polyline ontology node
      polyline_object_instance03: ObjectInstance = polyline_ontology_object.create_instance()

      coordinates_per_frame = {
          446: PolylineCoordinates(
              [PointCoordinate(.21, .21),
               PointCoordinate(.22, .21),
               PointCoordinate(.23, .22),
               PointCoordinate(.21, .23)]
          ),
          447: PolylineCoordinates(
              [PointCoordinate(.21, .21),
               PointCoordinate(.22, .21),
               PointCoordinate(.23, .22),
               PointCoordinate(.21, .23)]
          ),
          448: PolylineCoordinates(
              [PointCoordinate(.21, .21),
               PointCoordinate(.22, .21),
               PointCoordinate(.23, .22),
               PointCoordinate(.21, .23)]
          ),
      }
      for frame_number, coordinates in coordinates_per_frame.items():
          polyline_object_instance03.set_for_frames(
              coordinates=coordinates, frames=frame_number, manual_annotation=True
          )

      # Link the object instance to the label row
      label_row.add_object_instance(polyline_object_instance03)
      # Polyline 3 - END

      # Save the label row with the polyline instances
      label_row.save()
      print("Label row updated with polyline instances.")

      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="Keypoint">
    **Example 1**

    Imports a single keypoint (`Pedicel`) to a single image (`blueberry_003.png`).

    **Example 2**

    Imports three instances (tracking an object across three sequential frames: 143, 144, and 145) of a keypoint (`Pedicel`) to a video (`Blueberries_video.mp4`).

    **Example 3**

    Imports three keypoints (`Pedicel`) to a single image (`blueberry_003.png`).

    **Example 4:**

    Imports three instances (tracking 3 different objects across three frames: object 1 - frames 143, 144, 145, object 2 - frames 242, 244, 246, and object 3 - frames 343, 345, 347) of three keypoints (`Pedicel`) to a video (`Blueberries_video.mp4`).

    <CodeGroup>
      ```python Import Keypoint Template theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import PointCoordinate

      # Configuration
      SSH_PATH = "<file-path-to-ssh-private-key>"  # Path to your SSH private key
      PROJECT_ID = "<project-unique-id>"  # Unique project id
      CONSENSUS_BRANCH_NAME = "<your-label-branch-name>"  # Specify your label branch
      DATA_UNIT_TITLE = "<name-of-data-unit>"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "<object-name>"  # Name of the keypoint object in your ontology

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to label in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row
      label_row.initialise_labels()

      # Find a keypoint annotation object in the project ontology
      keypoint_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )

      # Instantiate an object instance from the keypoint ontology node
      keypoint_object_instance: ObjectInstance = keypoint_ontology_object.create_instance()

      # The x,y coordinates of the keypoint are specified as follows
      keypoint_object_instance.set_for_frames(
          coordinates=PointCoordinate(
              x=<value-for-x-axis>,  # Replace with the actual value for the x-axis
              y=<value-for-y-axis>   # Replace with the actual value for the y-axis
          ),
          # Add the keypoint to the specified frame number
          frames=<frame-number>,  # Replace with the actual frame number
          # There are multiple additional fields that can be set optionally:
          manual_annotation=True,
          confidence=1.0,
      )

      # Link the object instance to the label row
      label_row.add_object_instance(keypoint_object_instance)

      # Save the label row with the keypoint instance
      label_row.save()
      print("Label row updated with keypoint instance.")

      ```

      ```python Example 1 theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import PointCoordinate

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify your label branch
      DATA_UNIT_TITLE = "blueberry_003.png"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Pedicel"  # Name of the keypoint object in your ontology

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to label in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row
      label_row.initialise_labels()

      # Find a keypoint annotation object in the project ontology
      keypoint_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )

      # Instantiate an object instance from the keypoint ontology node
      keypoint_object_instance: ObjectInstance = keypoint_ontology_object.create_instance()

      # The x,y coordinates of the keypoint are specified as follows
      keypoint_object_instance.set_for_frames(
          coordinates=PointCoordinate(
              x=.1,
              y=.1
          ),
          # Add the keypoint to the specified frame number
          frames=<frame-number>,  # Replace with the actual frame number
          # There are multiple additional fields that can be set optionally:
          manual_annotation=True,
          confidence=1.0,
      )

      # Link the object instance to the label row
      label_row.add_object_instance(keypoint_object_instance)

      # Save the label row with the keypoint instance
      label_row.save()
      print("Label row updated with keypoint instance.")

      ```

      ```python Example 2 theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import PointCoordinate

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify your label branch
      DATA_UNIT_TITLE = "Blueberries_video.mp4"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Pedicel"  # Name of the keypoint object in your ontology

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to label in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row
      label_row.initialise_labels()

      # Find a keypoint annotation object in the project ontology
      keypoint_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )

      # Instantiate an object instance from the keypoint ontology node
      keypoint_object_instance: ObjectInstance = keypoint_ontology_object.create_instance()

      # Define coordinates for keypoints across frames
      coordinates_per_frame = {
          143: PointCoordinate(
              x=.1,
              y=.2
          ),
          144: PointCoordinate(
              x=.11,
              y=.22
          ),
          145: PointCoordinate(
              x=.12,
              y=.23
          ),
      }

      # Set keypoint coordinates for each frame
      for frame_number, coordinates in coordinates_per_frame.items():
          keypoint_object_instance.set_for_frames(
              coordinates=coordinates, 
              frames=frame_number, 
              manual_annotation=True,
              confidence=1.0  # Set confidence level as needed
          )

      # Link the object instance to the label row
      label_row.add_object_instance(keypoint_object_instance)

      # Save the label row with the keypoint instance
      label_row.save()
      print("Label row updated with keypoint instance.")

      ```

      ```python Example 3 theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import PointCoordinate

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify your label branch
      DATA_UNIT_TITLE = "blueberry_003.png"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Pedicel"  # Name of the keypoint object in your ontology

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to label in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row
      label_row.initialise_labels()

      # Find a keypoint annotation object in the project ontology
      keypoint_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )

      # Keypoint 1 - START
      # Instantiate an object instance from the keypoint ontology node
      keypoint_object_instance01: ObjectInstance = keypoint_ontology_object.create_instance()

      # The x,y coordinates of the keypoint are specified as follows
      keypoint_object_instance01.set_for_frames(
          coordinates=PointCoordinate(
              x=.1,
              y=.1
          ),
          # Add the keypoint to the specified frame number
          frames=<frame-number>,  # Replace with the actual frame number
          # Additional fields that can be set optionally:
          manual_annotation=True,
          confidence=1.0,
      )

      # Link the object instance to the label row
      label_row.add_object_instance(keypoint_object_instance01)
      # Keypoint 1 - END

      # Keypoint 2 - START
      # Instantiate an object instance from the keypoint ontology node
      keypoint_object_instance02: ObjectInstance = keypoint_ontology_object.create_instance()

      # The x,y coordinates of the keypoint are specified as follows
      keypoint_object_instance02.set_for_frames(
          coordinates=PointCoordinate(
              x=.2,
              y=.2
          ),
          # Add the keypoint to the specified frame number
          frames=<frame-number>,  # Replace with the actual frame number
          # Additional fields that can be set optionally:
          manual_annotation=True,
          confidence=1.0,
      )

      # Link the object instance to the label row
      label_row.add_object_instance(keypoint_object_instance02)
      # Keypoint 2 - END

      # Keypoint 3 - START
      # Instantiate an object instance from the keypoint ontology node
      keypoint_object_instance03: ObjectInstance = keypoint_ontology_object.create_instance()

      # The x,y coordinates of the keypoint are specified as follows
      keypoint_object_instance03.set_for_frames(
          coordinates=PointCoordinate(
              x=.3,
              y=.3
          ),
          # Add the keypoint to the specified frame number
          frames=<frame-number>,  # Replace with the actual frame number
          # Additional fields that can be set optionally:
          manual_annotation=True,
          confidence=1.0,
      )

      # Link the object instance to the label row
      label_row.add_object_instance(keypoint_object_instance03)
      # Keypoint 3 - END

      # Save the label row with the keypoint instances
      label_row.save()
      print("Label row updated with keypoint instances.")

      ```

      ```python Example 4 theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import PointCoordinate

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify your label branch
      DATA_UNIT_TITLE = "Blueberries_video.mp4"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Pedicel"  # Name of the keypoint object in your ontology

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to label in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row
      label_row.initialise_labels()

      # Find a keypoint annotation object in the project ontology
      keypoint_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )

      # Keypoint 1 - START
      # Instantiate an object instance from the keypoint ontology node
      keypoint_object_instance01: ObjectInstance = keypoint_ontology_object.create_instance()

      coordinates_per_frame = {
          143: PointCoordinate(
              x=.1,
              y=.2
          ),
          144: PointCoordinate(
              x=.11,
              y=.22
          ),
          145: PointCoordinate(
              x=.12,
              y=.23
          ),
      }
      for frame_number, coordinates in coordinates_per_frame.items():
          keypoint_object_instance01.set_for_frames(
              coordinates=coordinates, frames=frame_number, manual_annotation=True, confidence=1.0
          )

      # Link the object instance to the label row
      label_row.add_object_instance(keypoint_object_instance01)
      # Keypoint 1 - END

      # Keypoint 2 - START
      # Instantiate an object instance from the keypoint ontology node
      keypoint_object_instance02: ObjectInstance = keypoint_ontology_object.create_instance()

      coordinates_per_frame = {
          242: PointCoordinate(
              x=.21,
              y=.22
          ),
          244: PointCoordinate(
              x=.211,
              y=.222
          ),
          246: PointCoordinate(
              x=.212,
              y=.223
          ),
      }
      for frame_number, coordinates in coordinates_per_frame.items():
          keypoint_object_instance02.set_for_frames(
              coordinates=coordinates, frames=frame_number, manual_annotation=True, confidence=1.0
          )

      # Link the object instance to the label row
      label_row.add_object_instance(keypoint_object_instance02)
      # Keypoint 2 - END

      # Keypoint 3 - START
      # Instantiate an object instance from the keypoint ontology node
      keypoint_object_instance03: ObjectInstance = keypoint_ontology_object.create_instance()

      coordinates_per_frame = {
          343: PointCoordinate(
              x=.31,
              y=.32
          ),
          345: PointCoordinate(
              x=.311,
              y=.322
          ),
          347: PointCoordinate(
              x=.312,
              y=.323
          ),
      }
      for frame_number, coordinates in coordinates_per_frame.items():
          keypoint_object_instance03.set_for_frames(
              coordinates=coordinates, frames=frame_number, manual_annotation=True, confidence=1.0
          )

      # Link the object instance to the label row
      label_row.add_object_instance(keypoint_object_instance03)
      # Keypoint 3 - END

      # Save the label row with the keypoint instances
      label_row.save()
      print("Label row updated with keypoint instances.")

      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="Bitmask">
    **Example 1:**

    Imports a single bitmask (`Blueberry`) to a single image (`blueberry_003.jpg`). For simplicity, the bitmask covers the entire image (image dimensions: 1254x836).

    **Example 2:**

    Imports three instances (tracking an object across three sequential frames: 156, 157, and 159) of a bitmask (`Blueberry`) to a video (`Blueberries_video.mp4`). For simplicity, the bitmask covers the entire frame (video dimensions: 1920x1080).

    **Example 3:**

    Imports three bitmasks (`Blueberry`) to a single image (`blueberry_003.jpg`). For simplicity, the bitmasks cover the entire image (image dimensions: 1254x836).

    **Example 4:**

    Imports three instances (tracking 3 different objects across three frames: object 1 - frames 156, 157, 158, object 2 - frames 256, 258, 259, and object 3 - frames 355, 357, 359) of three bitmasks (`Blueberry`) to a video (`Blueberries_video.mp4`). For simplicity, the bitmasks cover the entire frame (video dimensions: 1920x1080).

    <CodeGroup>
      ```python Template theme={"dark"}
      # Import dependencies
      import numpy as np
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import BitmaskCoordinates

      # Configuration
      SSH_PATH = "<file-path-to-ssh-private-key>"  # Path to your SSH private key
      PROJECT_ID = "<project-unique-id>"  # Unique project id
      CONSENSUS_BRANCH_NAME = "<your-label-branch-name>"  # Specify your label branch
      DATA_UNIT_TITLE = "<data-unit-name>"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "<bitmask-object-name>"  # Name of the bitmask object in your ontology

      # Prepare the mask itself.
      # For simplicity, we can just mask the whole image
      # Note: the size of the mask must be identical to the size of the image
      numpy_coordinates = np.ones((<y-axis-value>, <x-axis-value>))  # Replace with actual values

      # Ensure the image is in boolean format
      numpy_coordinates = numpy_coordinates.astype(bool)

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to label in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row 
      label_row.initialise_labels()

      # Find a bitmask annotation object in the project ontology
      bitmask_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )

      # Instantiate an object instance from the bitmask ontology node
      bitmask_object_instance: ObjectInstance = bitmask_ontology_object.create_instance()

      # The coordinates for the bitmask are specified as follows
      bitmask_object_instance.set_for_frames(
          # Create coordinates from provided numpy bitmask
          coordinates=BitmaskCoordinates(numpy_coordinates),
          # Add the bitmask to the first frame
          frames=0,
          # There are multiple additional fields that can be set optionally:
          manual_annotation=True,
          confidence=1.0,
      )

      # Link the object instance to the label row
      label_row.add_object_instance(bitmask_object_instance)

      # Save the label row with the bitmask instance
      label_row.save()
      print("Label row updated with bitmask instance.")

      ```

      ```python Example 1 theme={"dark"}
      # Import dependencies
      import numpy as np
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import BitmaskCoordinates

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify your label branch
      DATA_UNIT_TITLE = "blueberry_003.jpg"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Blueberry"  # Name of the bitmask object in your ontology

      # Prepare the mask itself.
      # For simplicity, we can just mask the whole image
      # Note: the size of the mask must be identical to the size of the image
      numpy_coordinates = np.ones((836, 1254))

      # Ensure the image is in boolean format
      numpy_coordinates = numpy_coordinates.astype(bool)

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to label in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row 
      label_row.initialise_labels()

      # Find a bitmask annotation object in the project ontology
      bitmask_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )

      # Instantiate an object instance from the bitmask ontology node
      bitmask_object_instance: ObjectInstance = bitmask_ontology_object.create_instance()

      # The coordinates for the bitmask are specified as follows
      bitmask_object_instance.set_for_frames(
          # Create coordinates from provided numpy bitmask
          coordinates=BitmaskCoordinates(numpy_coordinates),
          # Add the bitmask to the first frame
          frames=0,
          # Additional fields that can be set optionally:
          manual_annotation=True,
          confidence=1.0,
      )

      # Link the object instance to the label row
      label_row.add_object_instance(bitmask_object_instance)

      # Save the label row with the bitmask instance
      label_row.save()
      print("Label row updated with bitmask instance.")

      ```

      ```python Example 2 theme={"dark"}
      # Import dependencies
      import numpy as np
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import BitmaskCoordinates

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify your label branch
      DATA_UNIT_TITLE = "Blueberries_video.mp4"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Blueberry"  # Name of the bitmask object in your ontology

      # Prepare the mask itself.
      # For simplicity, we'll mask the entire frame
      # Note: the size of the mask must be identical to the size of the image/frame
      numpy_coordinates = np.ones((1080, 1920))

      # Ensure the image/frame is in boolean format
      numpy_coordinates = numpy_coordinates.astype(bool)

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to label in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row 
      label_row.initialise_labels()

      # Find a bitmask annotation object in the project ontology
      bitmask_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )

      # Instantiate an object instance from the bitmask ontology node
      bitmask_object_instance: ObjectInstance = bitmask_ontology_object.create_instance()

      # Create and assign the bitmask coordinates for multiple frames
      coordinates_per_frame = {
          156: BitmaskCoordinates(numpy_coordinates),
          157: BitmaskCoordinates(numpy_coordinates),
          158: BitmaskCoordinates(numpy_coordinates),
      }

      for frame_number, coordinates in coordinates_per_frame.items():
          bitmask_object_instance.set_for_frames(
              coordinates=coordinates, frames=frame_number, manual_annotation=True, confidence=1.0
          )

      # Link the object instance to the label row
      label_row.add_object_instance(bitmask_object_instance)

      # Save the label row with the bitmask instance 
      label_row.save()
      print("Label row updated with bitmask instance.")

      ```

      ```python Example 3 theme={"dark"}
      # Import dependencies
      import numpy as np
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import BitmaskCoordinates

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify your label branch
      DATA_UNIT_TITLE = "blueberry_003.jpg"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Blueberry"  # Name of the bitmask object in your ontology

      # Prepare the mask itself.
      # For simplicity, we can just mask the whole image
      # Note: the size of the mask must be identical to the size of the image
      numpy_coordinates = np.ones((836, 1254))

      # Ensure the image is in boolean format
      numpy_coordinates = numpy_coordinates.astype(bool)

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to label in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row 
      label_row.initialise_labels()

      # Find a bitmask annotation object in the project ontology
      bitmask_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )

      # Bitmask 1 - START
      # Instantiate an object instance from the bitmask ontology node
      bitmask_object_instance01: ObjectInstance = bitmask_ontology_object.create_instance()

      # The coordinates for the bitmask are specified as follows
      bitmask_object_instance01.set_for_frames(
          # Create coordinates from provided numpy bitmask
          coordinates=BitmaskCoordinates(numpy_coordinates),
          # Add the bitmask to the first frame
          frames=0,
          # Additional fields that can be set optionally:
          manual_annotation=True,
          confidence=1.0,
      )

      # Link the object instance to the label row
      label_row.add_object_instance(bitmask_object_instance01)
      # Bitmask 1 - END

      # Bitmask 2 - START
      # Instantiate an object instance from the bitmask ontology node
      bitmask_object_instance02: ObjectInstance = bitmask_ontology_object.create_instance()

      # The coordinates for the bitmask are specified as follows
      bitmask_object_instance02.set_for_frames(
          # Create coordinates from provided numpy bitmask
          coordinates=BitmaskCoordinates(numpy_coordinates),
          # Add the bitmask to the first frame
          frames=0,
          # Additional fields that can be set optionally:
          manual_annotation=True,
          confidence=1.0,
      )

      # Link the object instance to the label row
      label_row.add_object_instance(bitmask_object_instance02)
      # Bitmask 2 - END

      # Bitmask 3 - START
      # Instantiate an object instance from the bitmask ontology node
      bitmask_object_instance03: ObjectInstance = bitmask_ontology_object.create_instance()

      # The coordinates for the bitmask are specified as follows
      bitmask_object_instance03.set_for_frames(
          # Create coordinates from provided numpy bitmask
          coordinates=BitmaskCoordinates(numpy_coordinates),
          # Add the bitmask to the first frame
          frames=0,
          # Additional fields that can be set optionally:
          manual_annotation=True,
          confidence=1.0,
      )

      # Link the object instance to the label row
      label_row.add_object_instance(bitmask_object_instance03)
      # Bitmask 3 - END

      # Save the label row with the bitmask instances
      label_row.save()
      print("Label row updated with bitmask instances.")

      ```

      ```python Example 4 theme={"dark"}
      # Import dependencies
      import numpy as np
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import BitmaskCoordinates

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify your label branch
      DATA_UNIT_TITLE = "Blueberries_video.mp4"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Blueberry"  # Name of the bitmask object in your ontology

      # Prepare the mask itself.
      # For simplicity, we'll mask the entire frame
      # Note: the size of the mask must be identical to the size of the image/frame
      numpy_coordinates = np.ones((1080, 1920))

      # Ensure the image/frame is in boolean format
      numpy_coordinates = numpy_coordinates.astype(bool)

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to label in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row 
      label_row.initialise_labels()

      # Find a bitmask annotation object in the project ontology
      bitmask_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )

      # Bitmask 1 - START
      # Instantiate an object instance from the bitmask ontology node
      bitmask_object_instance01: ObjectInstance = bitmask_ontology_object.create_instance()

      coordinates_per_frame = {
          156: BitmaskCoordinates(numpy_coordinates),
          157: BitmaskCoordinates(numpy_coordinates),
          158: BitmaskCoordinates(numpy_coordinates),
      }
      for frame_number, coordinates in coordinates_per_frame.items():
          bitmask_object_instance01.set_for_frames(
              coordinates=coordinates, frames=frame_number, manual_annotation=True, confidence=1.0
          )

      # Link the object instance to the label row
      label_row.add_object_instance(bitmask_object_instance01)
      # Bitmask 1 - END

      # Bitmask 2 - START
      # Instantiate an object instance from the bitmask ontology node
      bitmask_object_instance02: ObjectInstance = bitmask_ontology_object.create_instance()

      coordinates_per_frame = {
          256: BitmaskCoordinates(numpy_coordinates),
          258: BitmaskCoordinates(numpy_coordinates),
          259: BitmaskCoordinates(numpy_coordinates),
      }
      for frame_number, coordinates in coordinates_per_frame.items():
          bitmask_object_instance02.set_for_frames(
              coordinates=coordinates, frames=frame_number, manual_annotation=True, confidence=1.0
          )

      # Link the object instance to the label row
      label_row.add_object_instance(bitmask_object_instance02)
      # Bitmask 2 - END

      # Bitmask 3 - START
      # Instantiate an object instance from the bitmask ontology node
      bitmask_object_instance03: ObjectInstance = bitmask_ontology_object.create_instance()

      coordinates_per_frame = {
          355: BitmaskCoordinates(numpy_coordinates),
          357: BitmaskCoordinates(numpy_coordinates),
          359: BitmaskCoordinates(numpy_coordinates),
      }
      for frame_number, coordinates in coordinates_per_frame.items():
          bitmask_object_instance03.set_for_frames(
              coordinates=coordinates, frames=frame_number, manual_annotation=True, confidence=1.0
          )

      # Link the object instance to the label row
      label_row.add_object_instance(bitmask_object_instance03)
      # Bitmask 3 - END

      # Save the label row with the bitmask instances
      label_row.save()
      print("Label row updated with bitmask instances.")

      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="Object Primitives">
    <Info>Before you can import Object Primitive labels into Encord, the Object Primitive Template MUST exist in Encord. [Use the UI to create the Object Primitive Template](/platform-documentation/Annotate/annotate-ontologies/annotate-working-with-ontologies#object-primitives) so you can visually inspect the Object Primitive.</Info>

    **Import Object Primitive labels**

    *Example 1*

    Imports a single object primitive (Ontology object = `Strawberry` Object Primitive name = `Triangle`) to a single image (`strawberries_10.jpg`).

    *Example 2*

    Imports three instances (tracking an object across three sequential frames: 163, 164, and 165) of a object primitive (Ontology object = `Strawberry` Object Primitive name = `Triangle`) to a video (`Cherries_video.mp4`).

    *Example 3*

    Imports three object primitives (Ontology object = `Strawberry` Object Primitive name = `Triangle`) to a single image (`strawberries_10.jpg`).

    *Example 4*

    Imports three instances (tracking 3 different objects across three frames: object 1 - frames 173, 174, 175, object 2 - frames 183, 184, 185, and object 3 - frames 193, 194, 195) of three object primitives (Ontology object = `Strawberry` Object Primitive name = `Triangle`) to a video (`Cherries_video.mp4`).

    <CodeGroup>
      ```python Import Skeleton Template theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import SkeletonCoordinate, SkeletonCoordinates
      from encord.objects.skeleton_template import SkeletonTemplate

      # Configuration
      SSH_PATH = "<file-path-to-ssh-private-key>"  # Path to your SSH private key
      PROJECT_ID = "<project-unique-id>"  # Unique project id
      CONSENSUS_BRANCH_NAME = "<your-label-branch-name>"  # Specify your label branch
      DATA_UNIT_TITLE = "<name-of-data-unit>"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "<name-of-object-in-ontology>"  # Name of the object in your ontology
      SKELETON_TEMPLATE_NAME = "<name-of-object-primitive>"  # Name of the skeleton template

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to label in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row
      label_row.initialise_labels()

      # Find a skeleton annotation object in the project ontology
      skeleton_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )
      skeleton_template: SkeletonTemplate = project.ontology_structure.skeleton_templates[SKELETON_TEMPLATE_NAME]

      # Instantiate an object instance from the skeleton ontology node
      skeleton_object_instance: ObjectInstance = skeleton_ontology_object.create_instance()

      skeleton_hashes = [coord.feature_hash for coord in skeleton_template.skeleton.values()]
      skeleton_coordinates: SkeletonCoordinates = SkeletonCoordinates(values=[
          SkeletonCoordinate(
              x=0.x0, y=0.y0,  # Replace with actual coordinates
              name='point_0',
              color='#000000',
              value="point_0",
              feature_hash=skeleton_hashes[0]
          ),
          SkeletonCoordinate(
              x=0.x1, y=0.y1,  # Replace with actual coordinates
              name='point_1',
              color='#000000',
              value="point_1",
              feature_hash=skeleton_hashes[1]
          ),
          SkeletonCoordinate(
              x=0.x2, y=0.y2,  # Replace with actual coordinates
              name='point_2',
              color='#000000',
              value="point_2",
              feature_hash=skeleton_hashes[2]
          )
      ],
          name="<name-of-object-primitive>"  # Replace with the actual name
      )

      print(skeleton_coordinates)

      # The x,y coordinates of the skeleton are specified as follows
      skeleton_object_instance.set_for_frames(
          coordinates=skeleton_coordinates,
          # Add the skeleton to the image
          frames=0,
          # Additional fields that can be set optionally:
          manual_annotation=True,
          confidence=1.0,
      )

      # Link the object instance to the label row
      label_row.add_object_instance(skeleton_object_instance)

      # Save the label row with the skeleton instance
      label_row.save()
      print("Label row updated with skeleton instance.")


      ```

      ```python Example 1 theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import SkeletonCoordinate, SkeletonCoordinates
      from encord.objects.skeleton_template import SkeletonTemplate

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"  # Path to your SSH private key
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"  # Unique project id
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify your label branch
      DATA_UNIT_TITLE = "strawberries_10.jpg"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Strawberry"  # Name of the object in your ontology
      SKELETON_TEMPLATE_NAME = "Triangle"  # Name of the skeleton template

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to label in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row
      label_row.initialise_labels()

      # Find a skeleton annotation object in the project ontology
      skeleton_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )
      skeleton_template: SkeletonTemplate = project.ontology_structure.skeleton_templates[SKELETON_TEMPLATE_NAME]

      # Instantiate an object instance from the skeleton ontology node
      skeleton_object_instance: ObjectInstance = skeleton_ontology_object.create_instance()

      skeleton_hashes = [coord.feature_hash for coord in skeleton_template.skeleton.values()]
      skeleton_coordinates: SkeletonCoordinates = SkeletonCoordinates(values=[
          SkeletonCoordinate(
              x=0.25, y=0.25, 
              name='point_0', 
              color='#000000', 
              value="point_0", 
              feature_hash=skeleton_hashes[0]
          ), 
          SkeletonCoordinate(
              x=0.35, y=0.25, 
              name='point_1', 
              color='#000000', 
              value="point_1", 
              feature_hash=skeleton_hashes[1]
          ), 
          SkeletonCoordinate(
              x=0.25, y=0.35, 
              name='point_2', 
              color='#000000', 
              value="point_2", 
              feature_hash=skeleton_hashes[2]
          )
      ], 
      name=SKELETON_TEMPLATE_NAME)

      print(skeleton_coordinates)

      # The x,y coordinates of each skeleton vertex are specified as follows
      skeleton_object_instance.set_for_frames(
          coordinates=skeleton_coordinates,
          # Add the skeleton to the image
          frames=0,
          # There are multiple additional fields that can be set optionally:
          manual_annotation=True,
          confidence=1.0,
      )

      # Link the object instance to the label row
      label_row.add_object_instance(skeleton_object_instance)

      # Save the label row with the skeleton instance 
      label_row.save()
      print("Label row updated with skeleton instance.")

      ```

      ```python Example 2 theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import SkeletonCoordinate, SkeletonCoordinates
      from encord.objects.skeleton_template import SkeletonTemplate

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"  # Path to your SSH private key
      PROJECT_ID = "b45deb4f-0732-4a89-bdc2-c1c345a82c02"  # Unique project id
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify your label branch
      DATA_UNIT_TITLE = "Cherries_video.mp4"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Strawberry"  # Name of the object in your ontology
      SKELETON_TEMPLATE_NAME = "Triangle"  # Name of the skeleton template

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to label in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row 
      label_row.initialise_labels()

      # Find a skeleton annotation object in the project ontology
      skeleton_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )
      skeleton_template: SkeletonTemplate = project.ontology_structure.skeleton_templates[SKELETON_TEMPLATE_NAME]

      # Instantiate an object instance from the skeleton ontology node
      skeleton_object_instance: ObjectInstance = skeleton_ontology_object.create_instance()

      skeleton_hashes = [coord.feature_hash for coord in skeleton_template.skeleton.values()]

      coordinates_per_frame = {
          163: SkeletonCoordinates(
              values=[
                  SkeletonCoordinate(x=0.25, y=0.25, name='point_0', color='#000000', value="point_0", feature_hash=skeleton_hashes[0]),
                  SkeletonCoordinate(x=0.35, y=0.25, name='point_1', color='#000000', value="point_1", feature_hash=skeleton_hashes[1]),
                  SkeletonCoordinate(x=0.25, y=0.35, name='point_2', color='#000000', value="point_2", feature_hash=skeleton_hashes[2])
              ],
              name="Triangle"
          ),
          164: SkeletonCoordinates(
              values=[
                  SkeletonCoordinate(x=0.25, y=0.25, name='point_0', color='#000000', value="point_0", feature_hash=skeleton_hashes[0]),
                  SkeletonCoordinate(x=0.35, y=0.25, name='point_1', color='#000000', value="point_1", feature_hash=skeleton_hashes[1]),
                  SkeletonCoordinate(x=0.25, y=0.35, name='point_2', color='#000000', value="point_2", feature_hash=skeleton_hashes[2])
              ],
              name="Triangle"
          ),
          165: SkeletonCoordinates(
              values=[
                  SkeletonCoordinate(x=0.25, y=0.25, name='point_0', color='#000000', value="point_0", feature_hash=skeleton_hashes[0]),
                  SkeletonCoordinate(x=0.35, y=0.25, name='point_1', color='#000000', value="point_1", feature_hash=skeleton_hashes[1]),
                  SkeletonCoordinate(x=0.25, y=0.35, name='point_2', color='#000000', value="point_2", feature_hash=skeleton_hashes[2])
              ],
              name="Triangle"
          )
      }

      for frame_number, coordinates in coordinates_per_frame.items():
          skeleton_object_instance.set_for_frames(
              coordinates=coordinates, frames=frame_number, manual_annotation=True, confidence=1.0
          )

      # Link the object instance to the label row
      label_row.add_object_instance(skeleton_object_instance)

      # Save the label row with the skeleton instance
      label_row.save()
      print("Label row updated with skeleton instance.")

      ```

      ```python Example 3 theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import SkeletonCoordinate, SkeletonCoordinates
      from encord.objects.skeleton_template import SkeletonTemplate

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"  # Path to your SSH private key
      PROJECT_ID = "a4fe6c6a-2a13-4b3d-bd20-13d57421ecbb"  # Unique project id
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify your label branch
      DATA_UNIT_TITLE = "strawberries_10.jpg"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Strawberry"  # Name of the object in your ontology
      SKELETON_TEMPLATE_NAME = "Triangle"  # Name of the skeleton template

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to label in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row
      label_row.initialise_labels()

      # Find a skeleton annotation object in the project ontology
      skeleton_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )
      skeleton_template: SkeletonTemplate = project.ontology_structure.skeleton_templates[SKELETON_TEMPLATE_NAME]

      # OBJECT PRIMITIVE 1 - START
      # Instantiate an object instance from the skeleton ontology node
      skeleton_object_instance_01: ObjectInstance = skeleton_ontology_object.create_instance()

      skeleton_hashes = [coord.feature_hash for coord in skeleton_template.skeleton.values()]
      skeleton_coordinates: SkeletonCoordinates = SkeletonCoordinates(values=[
          SkeletonCoordinate(
              x=0.25, y=0.25, 
              name='point_0', 
              color='#000000', 
              value="point_0", 
              feature_hash=skeleton_hashes[0]
          ), 
          SkeletonCoordinate(
              x=0.35, y=0.25, 
              name='point_1', 
              color='#000000', 
              value="point_1", 
              feature_hash=skeleton_hashes[1]
          ), 
          SkeletonCoordinate(
              x=0.25, y=0.35, 
              name='point_2', 
              color='#000000', 
              value="point_2", 
              feature_hash=skeleton_hashes[2]
          )
      ], 
      name="Triangle")
      print(skeleton_coordinates)

      # Set the skeleton coordinates for the specified frames
      skeleton_object_instance_01.set_for_frames(
          coordinates=skeleton_coordinates,
          # Add the skeleton to the image
          frames=135-137, 
          # Additional fields that can be set optionally:
          manual_annotation=True,
          confidence=1.0,
      )

      # Link the object instance to the label row
      label_row.add_object_instance(skeleton_object_instance_01)
      # OBJECT PRIMITIVE 1 - END

      # OBJECT PRIMITIVE 2 - START
      # Instantiate an object instance from the skeleton ontology node
      skeleton_object_instance_02: ObjectInstance = skeleton_ontology_object.create_instance()

      skeleton_coordinates: SkeletonCoordinates = SkeletonCoordinates(values=[
          SkeletonCoordinate(
              x=0.45, y=0.45, 
              name='point_0', 
              color='#000000', 
              value="point_0", 
              feature_hash=skeleton_hashes[0]
          ), 
          SkeletonCoordinate(
              x=0.65, y=0.45, 
              name='point_1', 
              color='#000000', 
              value="point_1", 
              feature_hash=skeleton_hashes[1]
          ), 
          SkeletonCoordinate(
              x=0.45, y=0.65, 
              name='point_2', 
              color='#000000', 
              value="point_2", 
              feature_hash=skeleton_hashes[2]
          )
      ], 
      name="Triangle")
      print(skeleton_coordinates)

      # Set the skeleton coordinates for the specified frames
      skeleton_object_instance_02.set_for_frames(
          coordinates=skeleton_coordinates,
          # Add the skeleton to the image
          frames=0,
          # Additional fields that can be set optionally:
          manual_annotation=True,
          confidence=1.0,
      )

      # Link the object instance to the label row
      label_row.add_object_instance(skeleton_object_instance_02)
      # OBJECT PRIMITIVE 2 - END

      # OBJECT PRIMITIVE 3 - START
      # Instantiate an object instance from the skeleton ontology node
      skeleton_object_instance_03: ObjectInstance = skeleton_ontology_object.create_instance()

      skeleton_coordinates: SkeletonCoordinates = SkeletonCoordinates(values=[
          SkeletonCoordinate(
              x=0.75, y=0.75, 
              name='point_0', 
              color='#000000', 
              value="point_0", 
              feature_hash=skeleton_hashes[0]
          ), 
          SkeletonCoordinate(
              x=0.95, y=0.75, 
              name='point_1', 
              color='#000000', 
              value="point_1", 
              feature_hash=skeleton_hashes[1]
          ), 
          SkeletonCoordinate(
              x=0.75, y=0.95, 
              name='point_2', 
              color='#000000', 
              value="point_2", 
              feature_hash=skeleton_hashes[2]
          )
      ], 
      name="Triangle")
      print(skeleton_coordinates)

      # Set the skeleton coordinates for the specified frames
      skeleton_object_instance_03.set_for_frames(
          coordinates=skeleton_coordinates,
          # Add the skeleton to the image
          frames=0,
          # Additional fields that can be set optionally:
          manual_annotation=True,
          confidence=1.0,
      )

      # Link the object instance to the label row
      label_row.add_object_instance(skeleton_object_instance_03)
      # OBJECT PRIMITIVE 3 - END

      # Save the label row with the skeleton instances
      label_row.save()
      print("Label row updated with skeleton instances.")

      ```

      ```python Example 4 theme={"dark"}
      # Import dependencies
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Object, ObjectInstance
      from encord.objects.coordinates import SkeletonCoordinate, SkeletonCoordinates
      from encord.objects.skeleton_template import SkeletonTemplate

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"  # Path to your SSH private key
      PROJECT_ID = "0adfb083-9b69-4a09-8084-7fb432ecdfeb"  # Unique project id
      CONSENSUS_BRANCH_NAME = "my-label-branch-I"  # Specify your label branch
      DATA_UNIT_TITLE = "Cherries_video.mp4"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Strawberry"  # Name of the object in your ontology
      SKELETON_TEMPLATE_NAME = "Triangle"  # Name of the skeleton template

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to label in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row 
      label_row.initialise_labels()

      # Find a skeleton annotation object in the project ontology
      skeleton_ontology_object: Object = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE, type_=Object
      )
      skeleton_template: SkeletonTemplate = project.ontology_structure.skeleton_templates[SKELETON_TEMPLATE_NAME]

      # Skeleton 1 - START
      # Instantiate an object instance from the skeleton ontology node
      skeleton_object_instance_01: ObjectInstance = skeleton_ontology_object.create_instance()

      skeleton_hashes = [coord.feature_hash for coord in skeleton_template.skeleton.values()]

      coordinates_per_frame = { 
          173: SkeletonCoordinates(
              values=[
                  SkeletonCoordinate(x=0.25, y=0.25, name='point_0', color='#000000', value="point_0", feature_hash=skeleton_hashes[0]),
                  SkeletonCoordinate(x=0.35, y=0.25, name='point_1', color='#000000', value="point_1", feature_hash=skeleton_hashes[1]),
                  SkeletonCoordinate(x=0.25, y=0.35, name='point_2', color='#000000', value="point_2", feature_hash=skeleton_hashes[2])
              ],
              name="Triangle"
          ),
          174: SkeletonCoordinates(
              values=[
                  SkeletonCoordinate(x=0.25, y=0.25, name='point_0', color='#000000', value="point_0", feature_hash=skeleton_hashes[0]),
                  SkeletonCoordinate(x=0.35, y=0.25, name='point_1', color='#000000', value="point_1", feature_hash=skeleton_hashes[1]),
                  SkeletonCoordinate(x=0.25, y=0.35, name='point_2', color='#000000', value="point_2", feature_hash=skeleton_hashes[2])
              ],
              name="Triangle"
          ),
          175: SkeletonCoordinates(
              values=[
                  SkeletonCoordinate(x=0.25, y=0.25, name='point_0', color='#000000', value="point_0", feature_hash=skeleton_hashes[0]),
                  SkeletonCoordinate(x=0.35, y=0.25, name='point_1', color='#000000', value="point_1", feature_hash=skeleton_hashes[1]),
                  SkeletonCoordinate(x=0.25, y=0.35, name='point_2', color='#000000', value="point_2", feature_hash=skeleton_hashes[2])
              ],
              name="Triangle"
          )
      }

      for frame_number, coordinates in coordinates_per_frame.items():
          skeleton_object_instance_01.set_for_frames(
              coordinates=coordinates, frames=frame_number, manual_annotation=True, confidence=1.0
          )

      # Link the object instance to the label row
      label_row.add_object_instance(skeleton_object_instance_01)
      # Skeleton 1 - END

      # Skeleton 2 - START
      # Instantiate an object instance from the skeleton ontology node
      skeleton_object_instance_02: ObjectInstance = skeleton_ontology_object.create_instance()

      coordinates_per_frame = { 
          183: SkeletonCoordinates(
              values=[
                  SkeletonCoordinate(x=0.25, y=0.25, name='point_0', color='#000000', value="point_0", feature_hash=skeleton_hashes[0]),
                  SkeletonCoordinate(x=0.35, y=0.25, name='point_1', color='#000000', value="point_1", feature_hash=skeleton_hashes[1]),
                  SkeletonCoordinate(x=0.25, y=0.35, name='point_2', color='#000000', value="point_2", feature_hash=skeleton_hashes[2])
              ],
              name="Triangle"
          ),
          184: SkeletonCoordinates(
              values=[
                  SkeletonCoordinate(x=0.25, y=0.25, name='point_0', color='#000000', value="point_0", feature_hash=skeleton_hashes[0]),
                  SkeletonCoordinate(x=0.35, y=0.25, name='point_1', color='#000000', value="point_1", feature_hash=skeleton_hashes[1]),
                  SkeletonCoordinate(x=0.25, y=0.35, name='point_2', color='#000000', value="point_2", feature_hash=skeleton_hashes[2])
              ],
              name="Triangle"
          ),
          185: SkeletonCoordinates(
              values=[
                  SkeletonCoordinate(x=0.25, y=0.25, name='point_0', color='#000000', value="point_0", feature_hash=skeleton_hashes[0]),
                  SkeletonCoordinate(x=0.35, y=0.25, name='point_1', color='#000000', value="point_1", feature_hash=skeleton_hashes[1]),
                  SkeletonCoordinate(x=0.25, y=0.35, name='point_2', color='#000000', value="point_2", feature_hash=skeleton_hashes[2])
              ],
              name="Triangle"
          )
      }

      for frame_number, coordinates in coordinates_per_frame.items():
          skeleton_object_instance_02.set_for_frames(
              coordinates=coordinates, frames=frame_number, manual_annotation=True, confidence=1.0
          )

      # Link the object instance to the label row
      label_row.add_object_instance(skeleton_object_instance_02)
      # Skeleton 2 - END

      # Skeleton 3 - START
      # Instantiate an object instance from the skeleton ontology node
      skeleton_object_instance_03: ObjectInstance = skeleton_ontology_object.create_instance()

      coordinates_per_frame = { 
          193: SkeletonCoordinates(
              values=[
                  SkeletonCoordinate(x=0.25, y=0.25, name='point_0', color='#000000', value="point_0", feature_hash=skeleton_hashes[0]),
                  SkeletonCoordinate(x=0.35, y=0.25, name='point_1', color='#000000', value="point_1", feature_hash=skeleton_hashes[1]),
                  SkeletonCoordinate(x=0.25, y=0.35, name='point_2', color='#000000', value="point_2", feature_hash=skeleton_hashes[2])
              ],
              name="Triangle"
          ),
          194: SkeletonCoordinates(
              values=[
                  SkeletonCoordinate(x=0.25, y=0.25, name='point_0', color='#000000', value="point_0", feature_hash=skeleton_hashes[0]),
                  SkeletonCoordinate(x=0.35, y=0.25, name='point_1', color='#000000', value="point_1", feature_hash=skeleton_hashes[1]),
                  SkeletonCoordinate(x=0.25, y=0.35, name='point_2', color='#000000', value="point_2", feature_hash=skeleton_hashes[2])
              ],
              name="Triangle"
          ),
          195: SkeletonCoordinates(
              values=[
                  SkeletonCoordinate(x=0.25, y=0.25, name='point_0', color='#000000', value="point_0", feature_hash=skeleton_hashes[0]),
                  SkeletonCoordinate(x=0.35, y=0.25, name='point_1', color='#000000', value="point_1", feature_hash=skeleton_hashes[1]),
                  SkeletonCoordinate(x=0.25, y=0.35, name='point_2', color='#000000', value="point_2", feature_hash=skeleton_hashes[2])
              ],
              name="Triangle"
          )
      }

      for frame_number, coordinates in coordinates_per_frame.items():
          skeleton_object_instance_03.set_for_frames(
              coordinates=coordinates, frames=frame_number, manual_annotation=True, confidence=1.0
          )

      # Link the object instance to the label row
      label_row.add_object_instance(skeleton_object_instance_03)
      # Skeleton 3 - END

      # Save the label row with the skeleton instances 
      label_row.save()

      print("Label row updated with skeleton instances.")

      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="Radio Button">
    **Example 1:**

    Imports a radio button classification (`Blueberry or Cherry?`) to a single image (`blueberry_003.jpg`).

    **Example 2:**

    Imports a radio button classification (`Blueberry or Cherry?`) across a range of sequential frames: 193 to 197) to a video (`Blueberries_video.mp4`).

    <CodeGroup>
      ```python Radio Button Template theme={"dark"}
      # Import dependencies
      from __future__ import annotations
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Classification
      from encord.objects.options import Option

      # Configuration
      SSH_PATH = "<file-path-to-ssh-private-key>"  # Path to your SSH private key
      PROJECT_ID = "<unique-project-id>"  # Unique project id
      CONSENSUS_BRANCH_NAME = "<your-label-branch-name>"  # Specify your label branch
      DATA_UNIT_TITLE = "<data-unit-name>"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "<classification-name>"  # Name of the classification in your ontology
      RADIO_BUTTON_OPTION_TITLE = "<radio-button-option-title>"  # Title of the radio button option
      RADIO_BUTTON_OPTION = "<radio-button-option>"  # Specify the answer for the radio button option

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to apply classification in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row 
      label_row.initialise_labels()

      # Find the radio classification in the project ontology
      radio_ontology_classification: Classification = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE,
          type_=Classification,
      )

      # Find the specific radio button option
      blueberry_option = radio_ontology_classification.get_child_by_title(
          title=RADIO_BUTTON_OPTION_TITLE, type_=Option
      )

      # Create an instance of the radio classification
      radio_classification_instance = radio_ontology_classification.create_instance()

      # Set the answer for the classification instance
      radio_classification_instance.set_answer(
          answer=RADIO_BUTTON_OPTION
      )

      # Set the classification for the specified frame
      radio_classification_instance.set_for_frames(
          # Add the classification to the image
          frames=0,
          # Additional fields that can be set optionally:
          manual_annotation=True,
          confidence=1.0,
      )

      # Link the classification instance to the label row
      label_row.add_classification_instance(radio_classification_instance)

      # Save the label row with the classification instance
      label_row.save()

      print("Label row updated with classification instance.")

      ```

      ```python Example 1 theme={"dark"}
      # Import dependencies
      from __future__ import annotations
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Classification
      from encord.objects.options import Option

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"  # Path to your SSH private key
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"  # Unique project id
      CONSENSUS_BRANCH_NAME = "<your-label-branch-name>"  # Specify your label branch
      DATA_UNIT_TITLE = "blueberry_003.jpg"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Blueberry or Cherry?"  # Name of the classification in your ontology
      RADIO_BUTTON_OPTION_TITLE = "Blueberry"  # Title of the radio button option

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to apply classification in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row
      label_row.initialise_labels()

      # Find the radio classification in the project ontology
      radio_ontology_classification: Classification = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE,
          type_=Classification,
      )

      # Find the specific radio button option
      blueberry_option = radio_ontology_classification.get_child_by_title(
          title=RADIO_BUTTON_OPTION_TITLE, type_=Option
      )

      # Create an instance of the radio classification
      radio_classification_instance = radio_ontology_classification.create_instance()

      # Set the answer for the classification instance
      radio_classification_instance.set_answer(
          answer=blueberry_option
      )

      # Set the classification for the specified frame
      radio_classification_instance.set_for_frames(
          # Add the classification to the image
          frames=0,
          # Additional fields that can be set optionally:
          manual_annotation=True,
          confidence=1.0,
      )

      # Link the classification instance to the label row
      label_row.add_classification_instance(radio_classification_instance)

      # Save the label row with the classification instance 
      label_row.save()

      print("Label row updated with classification instance.")

      ```

      ```python Example 2 theme={"dark"}
      # Import dependencies
      from __future__ import annotations
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Classification
      from encord.objects.options import Option
      from encord.objects.frames import Range

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"  # Path to your SSH private key
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"  # Unique project id
      CONSENSUS_BRANCH_NAME = "<your-label-branch-name>"  # Specify your label branch
      DATA_UNIT_TITLE = "Blueberries_video.mp4"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Blueberry or Cherry?"  # Name of the classification in your ontology
      RADIO_BUTTON_OPTION_TITLE = "Blueberry"  # Title of the radio button option

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which classifications are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to add classification in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row 
      label_row.initialise_labels()

      # Find the radio classification in the project ontology
      radio_ontology_classification: Classification = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE,
          type_=Classification,
      )

      # Find the specific radio button option
      blueberry_option = radio_ontology_classification.get_child_by_title(
          title=RADIO_BUTTON_OPTION_TITLE, type_=Option
      )

      # Create an instance of the radio classification
      radio_classification_instance = radio_ontology_classification.create_instance()

      # Set the answer for the classification instance
      radio_classification_instance.set_answer(
          answer=blueberry_option,
      )

      # Set the classification for the specified frame range
      radio_classification_instance.set_for_frames(
          frames=Range(start=160, end=165),
          # Additional fields that can be set optionally:
          manual_annotation=True,
          confidence=1.0,
      )

      # Link the classification instance to the label row
      label_row.add_classification_instance(radio_classification_instance)

      # Save the label row with the classification instance
      label_row.save()

      print("Label row updated with classification instance.")

      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="Checklist">
    **Example 1:**

    Imports a checklist classification (`Many types of fruit?`) to a single image (`apple_003.jpg`). The selected items from the list are `apple` and `kiwi`.

    **Example 2:**

    Imports a checklist classification (`Many types of fruit?`) across a range of sequential frames: 193 to 197) to a video (`Blueberries_video.mp4`). The selected items from the list are `apple` and `kiwi`.

    <CodeGroup>
      ```python Checklist Template theme={"dark"}
      # Import dependencies
      from __future__ import annotations
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Classification
      from encord.objects.options import Option

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"  # Path to your SSH private key
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"  # Unique project id
      CONSENSUS_BRANCH_NAME = "<your-label-branch-name>"  # Specify your label branch
      DATA_UNIT_TITLE = "Blueberries_video.mp4"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Many types of fruit?"  # Name of the classification in your ontology
      APPLE_OPTION_TITLE = "Apple"  # Title of the apple option
      KIWI_OPTION_TITLE = "Kiwi"  # Title of the kiwi option

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to add classification in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row
      label_row.initialise_labels()

      # Find the checklist classification in the project ontology
      checklist_ontology_classification: Classification = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE,
          type_=Classification,
      )

      # Find the specific options in the checklist
      apple_option = checklist_ontology_classification.get_child_by_title(
          title=APPLE_OPTION_TITLE, type_=Option
      )

      kiwi_option = checklist_ontology_classification.get_child_by_title(
          title=KIWI_OPTION_TITLE, type_=Option
      )

      # Create an instance of the checklist classification
      checklist_classification_instance = checklist_ontology_classification.create_instance()

      # Set the answers for the classification instance
      checklist_classification_instance.set_answer(
          [apple_option, kiwi_option]
      )

      # Set the classification for the specified frame
      checklist_classification_instance.set_for_frames(
          # Add the classification to the image
          frames=177,
          # Additional fields that can be set optionally:
          manual_annotation=True,
          confidence=1.0,
      )

      # Link the classification instance to the label row
      label_row.add_classification_instance(checklist_classification_instance)

      # Save the label row with the classification instance
      label_row.save()

      print("Label row updated with checklist classification instance.")

      ```

      ```python Example 1 theme={"dark"}
      # Import dependencies
      from __future__ import annotations
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Classification
      from encord.objects.options import Option

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"  # Path to your SSH private key
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"  # Unique project id
      CONSENSUS_BRANCH_NAME = "<your-label-branch-name>"  # Specify your label branch
      DATA_UNIT_TITLE = "apple_003.jpg"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Many types of fruit?"  # Name of the classification in your ontology
      APPLE_OPTION_TITLE = "Apple"  # Title of the apple option
      KIWI_OPTION_TITLE = "Kiwi"  # Title of the kiwi option

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which labels are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to add classification in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row
      label_row.initialise_labels()

      # Find the checklist classification in the project ontology
      checklist_ontology_classification: Classification = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE,
          type_=Classification,
      )

      # Find the specific options in the checklist
      apple_option = checklist_ontology_classification.get_child_by_title(
          title=APPLE_OPTION_TITLE, type_=Option
      )

      kiwi_option = checklist_ontology_classification.get_child_by_title(
          title=KIWI_OPTION_TITLE, type_=Option
      )

      # Create an instance of the checklist classification
      checklist_classification_instance = checklist_ontology_classification.create_instance()

      # Set the answers for the classification instance
      checklist_classification_instance.set_answer(
          [apple_option, kiwi_option]
      )

      # Set the classification for the specified frame
      checklist_classification_instance.set_for_frames(
          # Add the classification to the image
          frames=0,
          # Additional fields that can be set optionally:
          manual_annotation=True,
      )

      # Link the classification instance to the label row
      label_row.add_classification_instance(checklist_classification_instance)

      # Save the label row with the classification instance
      label_row.save()
      print("Label row updated with checklist classification instance.")

      ```

      ```python Example 2 theme={"dark"}
      # Import dependencies
      from __future__ import annotations
      from pathlib import Path
      from encord import EncordUserClient, Project
      from encord.objects import Classification
      from encord.objects.options import Option
      from encord.objects.frames import Range

      # Configuration
      SSH_PATH = "/Users/chris-encord/sdk-ssh-private-key.txt"  # Path to your SSH private key
      PROJECT_ID = "7d4ead9c-4087-4832-a301-eb2545e7d43b"  # Unique project id
      CONSENSUS_BRANCH_NAME = "<your-label-branch-name>"  # Specify your label branch
      DATA_UNIT_TITLE = "Blueberries_video.mp4"  # Specific data unit title
      ONTOLOGY_OBJECT_TITLE = "Many types of fruit?"  # Name of the classification in your ontology
      APPLE_OPTION_TITLE = "Apple"  # Title of the apple option
      KIWI_OPTION_TITLE = "Kiwi"  # Title of the kiwi option

      # Create user client using access key
      user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
          Path(SSH_PATH).read_text()
      )

      # Get project for which classifications are to be added
      project: Project = user_client.get_project(PROJECT_ID)

      # Specify the data unit to add classification in the given branch
      label_row = project.list_label_rows_v2(
          branch_name=CONSENSUS_BRANCH_NAME,  # Filter by label branch
          data_title_eq=DATA_UNIT_TITLE
      )[0]

      # Initialize labels for the label row 
      label_row.initialise_labels()

      # Find the checklist classification in the project ontology
      checklist_ontology_classification: Classification = project.ontology_structure.get_child_by_title(
          title=ONTOLOGY_OBJECT_TITLE,
          type_=Classification,
      )

      # Find the specific options in the checklist
      apple_option = checklist_ontology_classification.get_child_by_title(
          title=APPLE_OPTION_TITLE, type_=Option
      )

      kiwi_option = checklist_ontology_classification.get_child_by_title(
          title=KIWI_OPTION_TITLE, type_=Option
      )

      # Create an instance of the checklist classification
      checklist_classification_instance = checklist_ontology_classification.create_instance()

      # Set the answers for the classification instance
      checklist_classification_instance.set_answer(
          [apple_option, kiwi_option]
      )

      # Set the classification for the specified frame range
      checklist_classification_instance.set_for_frames(
          frames=Range(start=193, end=197),
          # Additional fields that can be set optionally:
          manual_annotation=True,
      )

      # Link the classification instance to the label row
      label_row.add_classification_instance(checklist_classification_instance)

      # Save the label row with the classification instance
      label_row.save()
      print("Label row updated with checklist classification instance.")

      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

This simple example imports a bounding box model label to all data units in the label branch.

```python Store labels Boilerplate theme={"dark"}
# Import dependencies
import os
from encord import EncordUserClient, Project
from encord.objects import LabelRowV2, Object, OntologyStructure, ObjectInstance

from encord.objects.coordinates import BoundingBoxCoordinates, RotatableBoundingBoxCoordinates, PolygonCoordinates, PolylineCoordinates, PointCoordinate, BitmaskCoordinates


# Configuration
SSH_PATH = "file-path-to-your-ssh-key"
PROJECT_ID = "unique-id-for-project"

# Specify a label_rows_v2 branch name for your labels.
CONSENSUS_BRANCH_NAME = "name-of-your-label-branch"

assert SSH_PATH is not None, "SSH path cannot be None"
assert PROJECT_ID is not None, "Project id cannot be None"

# Authenticate with Encord
user_client = EncordUserClient.create_with_ssh_private_key(
    ssh_private_key_path=SSH_PATH
)

# Access the project and prepare the branch for labels
project = user_client.get_project(PROJECT_ID)
consensus_branch_rows = project.list_label_rows_v2(branch_name=CONSENSUS_BRANCH_NAME)

if len(consensus_branch_rows) > 0:
  print("Branch is:", consensus_branch_rows[0].branch_name)

ontology_object = project.ontology_structure.objects[0]
with project.create_bundle() as bundle:
    for row in consensus_branch_rows:
        row.initialise_labels(bundle=bundle)

for row in consensus_branch_rows:
    inst = ontology_object.create_instance()
    inst.set_for_frames(
        coordinates=BoundingBoxCoordinates(
            height=0.8,
            width=0.8,
            top_left_x=0.1,
            top_left_y=0.1,
        ),
        # Add the bounding box to the first frame
        frames=0,
        # There are multiple additional fields that can be set optionally:
        manual_annotation=False,
    )
    row.add_object_instance(inst)

with project.create_bundle() as bundle:
    for row in consensus_branch_rows:
    row.save(bundle=bundle)

```

This simple example imports a bounding box model label to all data units in the label branch.

```python Store labels Boilerplate theme={"dark"}
# Import dependencies
import os
from encord import EncordUserClient, Project
from encord.objects import LabelRowV2, Object, OntologyStructure, ObjectInstance

from encord.objects.coordinates import BoundingBoxCoordinates, RotatableBoundingBoxCoordinates, PolygonCoordinates, PolylineCoordinates, PointCoordinate, BitmaskCoordinates


# Configuration
SSH_PATH = "file-path-to-your-ssh-key"
PROJECT_HASH = "unique-id-for-project"

# Specify a label_rows_v2 branch name for your labels.
CONSENSUS_BRANCH_NAME = "name-of-your-label-branch"

assert SSH_PATH is not None, "SSH path cannot be None"
assert PROJECT_ID is not None, "Project ID cannot be None"

# Authenticate with Encord
user_client = EncordUserClient.create_with_ssh_private_key(
    ssh_private_key_path=SSH_PATH
)

# Access the project and prepare the branch for labels
project = user_client.get_project(PROJECT_HASH)
consensus_branch_rows = project.list_label_rows_v2(branch_name=CONSENSUS_BRANCH_NAME)

if len(consensus_branch_rows) > 0:
  print("Branch is:", consensus_branch_rows[0].branch_name)

ontology_object = project.ontology_structure.objects[0]
with project.create_bundle() as bundle:
    for row in consensus_branch_rows:
        row.initialise_labels(bundle=bundle)

for row in consensus_branch_rows:
    inst = ontology_object.create_instance()
    inst.set_for_frames(
        coordinates=BoundingBoxCoordinates(
            height=0.8,
            width=0.8,
            top_left_x=0.1,
            top_left_y=0.1,
        ),
        # Add the bounding box to the first frame
        frames=0,
        # There are multiple additional fields that can be set optionally:
        manual_annotation=False,
    )
    row.add_object_instance(inst)

with project.create_bundle() as bundle:
    for row in consensus_branch_rows:
    row.save(bundle=bundle)

```

### Import COCO Labels to Consensus Branches

The following code imports COCO labels as predictions for Active.

For more information on [importing COCO labels into Encord](/sdk-documentation/sdk-labels/sdk-import-coco-labels), refer to our documentation.

Replace the following:

* `<private_key_path>` with the file path to your SSH private key.

* `encord-<name-of-your-consensus-branch>` with the name of your label branch.

* `<project_hash>` with the Project ID for your Project.

* `COCOimportfile.json` with the full path of the COCO file containing the predictions you want to import.

```python COCO Label import as Predictions theme={"dark"}

import json
from pathlib import Path
from encord.utilities.coco.datastructure import FrameIndex
from encord import EncordUserClient
from encord.exceptions import OntologyError

# Authenticate client
SSH_PATH = "file-path-to-your-ssh-key"

# Specify a Project to import your predictions to. This Project must already exist in Encord.
PROJECT_HASH = "unique-id-for-project"

# Specify a label_rows_v2 branch name for your labels.
CONSENSUS_BRANCH_NAME = "encord-<name-of-your-consensus-branch>"

# Authenticate with Encord using the path to your private key
user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
    ssh_private_key_path=SSH_PATH
)

# Replace with your project ID
project = user_client.get_project(PROJECT_ID)

# Load the COCO annotations JSON file
# Replace 'COCOimportfile.json' with the full path to your COCO file
coco_file = Path("COCOimportfile.json")
labels_dict = json.loads(coco_file.read_text())

# Build a mapping from COCO category IDs to the feature hashes in your Encord Ontology. 
category_id_to_feature_hash = {}
ont_struct = project.ontology_structure
for coco_category in labels_dict["categories"]:
    try:
        ont_obj = ont_struct.get_child_by_title(coco_category["name"])
        category_id_to_feature_hash[coco_category["id"]] = ont_obj.feature_node_hash
    except OntologyError:
        print(f"Could not match {coco_category['name']} in the Ontology. Import will crash if these are present.")

# Build a mapping from COCO image IDs to Encord frame indices
# This is only applicable for images, image groups, image sequences, videos, and DICOM series
image_id_to_frame_index = {}
data_title_to_label_row = {lr.data_title: lr for lr in project.list_label_rows_v2(branch_name=CONSENSUS_BRANCH_NAME)}
for img in labels_dict['images']:
    if "video_title" in img.keys():
        lr = data_title_to_label_row[img["video_title"]]
        frame_num = int(img["file_name"].split('/')[-1].split(".")[0])
    else:
        lr = data_title_to_label_row[img['image_title']]
        frame_num = 0

    # Creates a mapping between the COCO image IDs and the corresponding frame indices in Encord
    # In this example, the target frame is 0 because the files in the sample project are single images
    image_id_to_frame_index[img['id']] = FrameIndex(lr.data_hash, frame=frame_num)

# Import the COCO labels into Encord
project.import_coco_labels(
    labels_dict,
    category_id_to_feature_hash,
    image_id_to_frame_index,
    branch_name=CONSENSUS_BRANCH_NAME,
)

```

## Verify Label Import

After importing your labels, verify that your labels imported.

The following code returns all labels and predictions on all branches.

```python theme={"dark"}

# Import dependencies
from encord import EncordUserClient
import json

SSH_PATH = "file-path-of-your-ssh-key"
PROJECT_HASH = "unique-id-for-your-project"

# Instantiate client. Replace \<private_key_path> with the path to the file containing your private key.
user_client = EncordUserClient.create_with_ssh_private_key(
    ssh_private_key_path=SSH_PATH
)

# Specify Project. Replace <project_hash> with the ID of the Project you want to export labels for.
project = user_client.get_project(PROJECT_HASH)

# Downloads a local copy of all the labels
# Without the include_all_label_branches flag only the MAIN branch labels export
label_rows = project.list_label_rows_v2(include_all_label_branches=True) 

# Initialize label rows using bundles
with project.create_bundle() as bundle:
    for label_row in label_rows:
        label_row.initialise_labels(bundle=bundle)

for label_row in label_rows:
    # Here we have the label row for the branch, but without labels themselves downloaded
    print(f"Title: {label_row.data_title}, branch: {label_row.branch_name}")

    # Print essential label information for all objects
    for object_instance in label_row.get_object_instances():
        print (f"objectHash: {object_instance.object_hash}")
        print (f"Object name: {object_instance.object_name}")
        print (f"featureHash: {object_instance.feature_hash}")
        print (f"uid: {object_instance.ontology_item.uid}")
        print (f"Object color: {object_instance.ontology_item.color}")
        print (f"Ontology shape: {object_instance.ontology_item.shape}")

        # Print the frame number and the location of the object on the frame
        for annotation in object_instance.get_annotations():
            print(f"Frame {annotation.frame} -> {annotation.coordinates}")

        # Print all attributes 
        for attribute in object_instance.ontology_item.attributes:
            print (attribute, object_instance)

    # Print all essential classification information
    for classification_instance in label_row.get_classification_instances():
        print (f"classificationHash: {classification_instance.classification_hash}")
        print (f"Classification name: {classification_instance.classification_name}")
        print (f"featureHash: {classification_instance.feature_hash}")
        print (f"Classification answer: {classification_instance.get_answer().value}")
        print (f"Classification answer hash: {classification_instance.get_answer().feature_node_hash}")


        # Print the frame number(s) that a classification appears on
        for annotation in classification_instance.get_annotations():
            print(f"Classification appears on frame: {annotation.frame}")

```
