class_docstr: All about an annotation such as Mask, Category, BoundingBox.
class_docstr_tok: ["All","about","an","annotation","such","as","Mask",",","Category",",","BoundingBox","."]
docstr: Returns sahi.utils.shapely.ShapelyAnnotation representation of ObjectAnnotation.
docstr_tok: ["Returns","sahi.utils.shapely.ShapelyAnnotation","representation","of","ObjectAnnotation","."]
code: def to_shapely_annotation(self):
      """
      Returns sahi.utils.shapely.ShapelyAnnotation representation of ObjectAnnotation.
      """
      if self.mask:
          shapely_annotation = ShapelyAnnotation.from_coco_segmentation(
              segmentation=self.mask.to_coco_segmentation(),
          )
      else:
          shapely_annotation = ShapelyAnnotation.from_coco_bbox(
              bbox=self.bbox.to_xywh(),
          )
      return shapely_annotation
  
imports: import copy
  from typing import Dict, List, Optional
  import numpy
  from sahi.utils.coco import CocoAnnotation, CocoPrediction
  from sahi.utils.cv import get_bbox_from_bool_mask, get_bool_mask_from_coco_segmentation, get_coco_segmentation_from_bool_mask
  from sahi.utils.shapely import ShapelyAnnotation
label_desc: Use image node_id 10 for calling the ObjectAnnotation obj's underlying member method code with example usage: obj.to_shapely_annotation() and returns: shapely_annotation