class_docstr: Online Hard Example Mining Sampler for segmentation.
  
  Args:
      context (nn.Module): The context of sampler, subclass of
          :obj:`BaseDecodeHead`.
      thresh (float, optional): The threshold for hard example selection.
          Below which, are prediction with low confidence. If not
          specified, the hard examples will be pixels of top ``min_kept``
          loss. Default: None.
      min_kept (int, optional): The minimum number of predictions to keep.
          Default: 100000.
code: def __init__(self, context, thresh=None, min_kept=100000):
      super(OHEMPixelSampler, self).__init__()
      self.context = context
      assert min_kept > 1
      self.thresh = thresh
      self.min_kept = min_kept
  
file_path: lavis/lavis/common/annotator/uniformer/mmseg/core/seg/sampler/ohem_pixel_sampler.py
imports: import torch
  import torch.nn.functional
  from ..builder import PIXEL_SAMPLERS
  from .base_pixel_sampler import BasePixelSampler
label_desc: Use image node_id 1 to create a new OHEMPixelSampler object from inherited base classes: BasePixelSampler with example: obj = OHEMPixelSampler(context, thresh, min_kept)