class_docstr: SniperCOCODataSet
class_docstr_tok: ["SniperCOCODataSet"]
code: def __init__(
      self,
      dataset_dir=None,
      image_dir=None,
      anno_path=None,
      proposals_file=None,
      data_fields=["image"],
      sample_num=-1,
      load_crowd=False,
      allow_empty=True,
      empty_ratio=1.0,
      is_trainset=True,
      image_target_sizes=[2000, 1000],
      valid_box_ratio_ranges=[[-1, 0.1], [0.08, -1]],
      chip_target_size=500,
      chip_target_stride=200,
      use_neg_chip=False,
      max_neg_num_per_im=8,
      max_per_img=-1,
      nms_thresh=0.5,
  ):
      super(SniperCOCODataSet, self).__init__(
          dataset_dir=dataset_dir,
          image_dir=image_dir,
          anno_path=anno_path,
          data_fields=data_fields,
          sample_num=sample_num,
          load_crowd=load_crowd,
          allow_empty=allow_empty,
          empty_ratio=empty_ratio,
      )
      self.proposals_file = proposals_file
      self.proposals = None
      self.anno_cropper = None
      self.is_trainset = is_trainset
      self.image_target_sizes = image_target_sizes
      self.valid_box_ratio_ranges = valid_box_ratio_ranges
      self.chip_target_size = chip_target_size
      self.chip_target_stride = chip_target_stride
      self.use_neg_chip = use_neg_chip
      self.max_neg_num_per_im = max_neg_num_per_im
      self.max_per_img = max_per_img
      self.nms_thresh = nms_thresh
  
imports: import os
  import cv2
  import json
  import copy
  import numpy
  from ppdet.core.workspace import register, serializable
  from ppdet.data.crop_utils.annotation_cropper import AnnoCropper
  from .coco import COCODataSet
  from .dataset import _make_dataset, _is_valid_file
  from ppdet.utils.logger import setup_logger
label_desc: Use image node_id 1 to create a new SniperCOCODataSet object from inherited base classes: COCODataSet with example: obj = SniperCOCODataSet(dataset_dir, image_dir, anno_path, proposals_file, data_fields, sample_num, load_crowd, allow_empty, empty_ratio, is_trainset, image_target_sizes, valid_box_ratio_ranges, chip_target_size, chip_target_stride, use_neg_chip, max_neg_num_per_im, max_per_img, nms_thresh)