class_docstr: This class represents a list of instances in an image.
  It stores the attributes of instances (e.g., boxes, masks, labels, scores) as "fields".
  All fields must have the same ``__len__`` which is the number of instances.
  
  All other (non-field) attributes of this class are considered private:
  they must start with '_' and are not modifiable by a user.
  
  Some basic usage:
  
  1. Set/get/check a field:
  
     .. code-block:: python
  
        instances.gt_boxes = Boxes(...)
        print(instances.pred_masks)  # a tensor of shape (N, H, W)
        print('gt_masks' in instances)
  
  2. ``len(instances)`` returns the number of instances
  3. Indexing: ``instances[indices]`` will apply the indexing on all the fields
     and returns a new :class:`Instances`.
     Typically, ``indices`` is a integer vector of indices,
     or a binary mask of length ``num_instances``
  
     .. code-block:: python
  
        category_3_detections = instances[instances.pred_classes == 3]
        confident_detections = instances[instances.scores > 0.9]
class_docstr_tok: ["This","class","represents","a","list","of","instances","in","an","image",".","It","stores","the","attributes","of","instances","(","e.g.",",","boxes",",","masks",",","labels",",","scores",")","as","``","fields","''",".","All","fields","must","have","the","same","``","__len__","``","which","is","the","number","of","instances",".","All","other","(","non-field",")","attributes","of","this","class","are","considered","private",":","they","must","start","with","'","_","'","and","are","not","modifiable","by","a","user",".","Some","basic","usage",":","1",".","Set\/get\/check","a","field",":","..","code-block",":",":","python","instances.gt_boxes","=","Boxes","(","...",")","print","(","instances.pred_masks",")","#","a","tensor","of","shape","(","N",",","H",",","W",")","print","(","'gt_masks","'","in","instances",")","2",".","``","len","(","instances",")","``","returns","the","number","of","instances","3",".","Indexing",":","``","instances","[","indices","]","``","will","apply","the","indexing","on","all","the","fields","and","returns","a","new",":","class",":","`","Instances","`",".","Typically",",","``","indices","``","is","a","integer","vector","of","indices",",","or","a","binary","mask","of","length","``","num_instances","``","..","code-block",":",":","python","category_3_detections","=","instances","[","instances.pred_classes","==","3","]","confident_detections","=","instances","[","instances.scores",">","0.9","]"]
docstr: Returns:
      tuple: height, width
docstr_tok: ["Returns",":","tuple",":","height",",","width"]
code: def image_size(self) -> Tuple[int, int]:
      """
      Returns:
          tuple: height, width
      """
      return self._image_size
  
file_path: detectron2/detectron2/structures/instances.py
imports: import itertools
  import warnings
  from typing import Any, Dict, List, Tuple, Union
  import torch
label_desc: Use image node_id 2 for calling the Instances obj's underlying member method code with example usage: obj.image_size() and returns: self