class_docstr: Class for handling detection model predictions.
class_docstr_tok: ["Class","for","handling","detection","model","predictions","."]
docstr: Creates ObjectPrediction from bbox, score, category_id, category_name, bool_mask.
  
  Arguments:
      bbox: list
          [minx, miny, maxx, maxy]
      score: float
          Prediction score between 0 and 1
      category_id: int
          ID of the object category
      category_name: str
          Name of the object category
      bool_mask: np.ndarray
          2D boolean mask array. Should be None if model doesn't output segmentation mask.
      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 after shifting, should be in
          the form of [height, width]
docstr_tok: ["Creates","ObjectPrediction","from","bbox",",","score",",","category_id",",","category_name",",","bool_mask",".","Arguments",":","bbox",":","list","[","minx",",","miny",",","maxx",",","maxy","]","score",":","float","Prediction","score","between","0","and","1","category_id",":","int","ID","of","the","object","category","category_name",":","str","Name","of","the","object","category","bool_mask",":","np.ndarray","2D","boolean","mask","array",".","Should","be","None","if","model","does","n't","output","segmentation","mask",".","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","after","shifting",",","should","be","in","the","form","of","[","height",",","width","]"]
code: def __init__(
      self,
      bbox: Optional[List[int]] = None,
      category_id: Optional[int] = None,
      category_name: Optional[str] = None,
      bool_mask: Optional[np.ndarray] = None,
      score: Optional[float] = 0,
      shift_amount: Optional[List[int]] = [0, 0],
      full_shape: Optional[List[int]] = None,
  ):
      """
      Creates ObjectPrediction from bbox, score, category_id, category_name, bool_mask.
  
      Arguments:
          bbox: list
              [minx, miny, maxx, maxy]
          score: float
              Prediction score between 0 and 1
          category_id: int
              ID of the object category
          category_name: str
              Name of the object category
          bool_mask: np.ndarray
              2D boolean mask array. Should be None if model doesn't output segmentation mask.
          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 after shifting, should be in
              the form of [height, width]
      """
      self.score = PredictionScore(score)
      super().__init__(
          bbox=bbox,
          category_id=category_id,
          bool_mask=bool_mask,
          category_name=category_name,
          shift_amount=shift_amount,
          full_shape=full_shape,
      )
  
imports: import copy
  from typing import Dict, List, Optional, Union
  import numpy
  from PIL import Image
  from sahi.annotation import ObjectAnnotation
  from sahi.utils.coco import CocoAnnotation, CocoPrediction
  from sahi.utils.cv import read_image_as_pil, visualize_object_predictions
  from sahi.utils.file import Path
label_desc: Use image node_id 1 to create a new ObjectPrediction object from inherited base classes: ObjectAnnotation with example: obj = ObjectPrediction(bbox, category_id, category_name, bool_mask, score, shift_amount, full_shape)