class_docstr: All about an annotation such as Mask, Category, BoundingBox.
class_docstr_tok: ["All","about","an","annotation","such","as","Mask",",","Category",",","BoundingBox","."]
docstr: Creates ObjectAnnotation from imantics.annotation.Annotation
  
  Args:
      annotation: imantics.annotation.Annotation
      shift_amount: List
          To shift the box and mask predictions from sliced image to full
          sized image, should be in the form of [shift_x, shift_y]
      full_shape: List
          Size of the full image, should be in the form of [height, width]
docstr_tok: ["Creates","ObjectAnnotation","from","imantics.annotation.Annotation","Args",":","annotation",":","imantics.annotation.Annotation","shift_amount",":","List","To","shift","the","box","and","mask","predictions","from","sliced","image","to","full","sized","image",",","should","be","in","the","form","of","[","shift_x",",","shift_y","]","full_shape",":","List","Size","of","the","full","image",",","should","be","in","the","form","of","[","height",",","width","]"]
code: def from_imantics_annotation(
      cls,
      annotation,
      shift_amount: Optional[List[int]] = [0, 0],
      full_shape: Optional[List[int]] = None,
  ):
      """
      Creates ObjectAnnotation from imantics.annotation.Annotation
  
      Args:
          annotation: imantics.annotation.Annotation
          shift_amount: List
              To shift the box and mask predictions from sliced image to full
              sized image, should be in the form of [shift_x, shift_y]
          full_shape: List
              Size of the full image, should be in the form of [height, width]
      """
      return cls(
          category_id=annotation.category.id,
          bool_mask=annotation.mask.array,
          category_name=annotation.category.name,
          shift_amount=shift_amount,
          full_shape=full_shape,
      )
  
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 6 for calling the ObjectAnnotation obj's underlying member method code with example usage: obj.from_imantics_annotation(cls, annotation, shift_amount, full_shape) and returns: cls