class_docstr: An extension that visualizes output of a detection model.
  
  This extension visualizes the predicted bounding boxes together with the
  ground truth bounding boxes.
  
  Internally, this extension takes examples from an iterator,
  predict bounding boxes from the images in the examples,
  and visualizes them using :meth:`chainercv.visualizations.vis_bbox`.
  The process can be illustrated in the following code.
  
  .. code:: python
  
      batch = next(iterator)
      # Convert batch -> imgs, gt_bboxes, gt_labels
      pred_bboxes, pred_labels, pred_scores = target.predict(imgs)
      # Visualization code
      for img, gt_bbox, gt_label, pred_bbox, pred_label, pred_score \
              in zip(imgs, gt_boxes, gt_labels,
                     pred_bboxes, pred_labels, pred_scores):
          # the ground truth
          vis_bbox(img, gt_bbox, gt_label)
          # the prediction
          vis_bbox(img, pred_bbox, pred_label, pred_score)
  
  .. note::
      :obj:`gt_bbox` and :obj:`pred_bbox` are float arrays
      of shape :math:`(R, 4)`, where :math:`R` is the number of
      bounding boxes in the image. Each bounding box is organized
      by :math:`(y_{min}, x_{min}, y_{max}, x_{max})` in the second axis.
  
      :obj:`gt_label` and :obj:`pred_label` are intenger arrays
      of shape :math:`(R,)`. Each label indicates the class of
      the bounding box.
  
      :obj:`pred_score` is a float array of shape :math:`(R,)`.
      Each score indicates how confident the prediction is.
  
  Args:
      iterator: Iterator object that produces images and ground truth.
      target: Link object used for detection.
      label_names (iterable of strings): Name of labels ordered according
          to label ids. If this is :obj:`None`, labels will be skipped.
      filename (str): Basename for the saved image. It can contain two
          keywords, :obj:`'{iteration}'` and :obj:`'{index}'`. They are
          replaced with the iteration of the trainer and the index of
          the sample when this extension save an image. The default value is
          :obj:`'detection_iter={iteration}_idx={index}.jpg'`.
class_docstr_tok: ["An","extension","that","visualizes","output","of","a","detection","model",".","This","extension","visualizes","the","predicted","bounding","boxes","together","with","the","ground","truth","bounding","boxes",".","Internally",",","this","extension","takes","examples","from","an","iterator",",","predict","bounding","boxes","from","the","images","in","the","examples",",","and","visualizes","them","using",":","meth",":","`","chainercv.visualizations.vis_bbox","`",".","The","process","can","be","illustrated","in","the","following","code",".","..","code",":",":","python","batch","=","next","(","iterator",")","#","Convert","batch","-",">","imgs",",","gt_bboxes",",","gt_labels","pred_bboxes",",","pred_labels",",","pred_scores","=","target.predict","(","imgs",")","#","Visualization","code","for","img",",","gt_bbox",",","gt_label",",","pred_bbox",",","pred_label",",","pred_score","\\","in","zip","(","imgs",",","gt_boxes",",","gt_labels",",","pred_bboxes",",","pred_labels",",","pred_scores",")",":","#","the","ground","truth","vis_bbox","(","img",",","gt_bbox",",","gt_label",")","#","the","prediction","vis_bbox","(","img",",","pred_bbox",",","pred_label",",","pred_score",")","..","note",":",":",":","obj",":","`","gt_bbox","`","and",":","obj",":","`","pred_bbox","`","are","float","arrays","of","shape",":","math",":","`","(","R",",","4",")","`",",","where",":","math",":","`","R","`","is","the","number","of","bounding","boxes","in","the","image",".","Each","bounding","box","is","organized","by",":","math",":","`","(","y_","{","min","}",",","x_","{","min","}",",","y_","{","max","}",",","x_","{","max","}",")","`","in","the","second","axis",".",":","obj",":","`","gt_label","`","and",":","obj",":","`","pred_label","`","are","intenger","arrays","of","shape",":","math",":","`","(","R",",",")","`",".","Each","label","indicates","the","class","of","the","bounding","box",".",":","obj",":","`","pred_score","`","is","a","float","array","of","shape",":","math",":","`","(","R",",",")","`",".","Each","score","indicates","how","confident","the","prediction","is",".","Args",":","iterator",":","Iterator","object","that","produces","images","and","ground","truth",".","target",":","Link","object","used","for","detection",".","label_names","(","iterable","of","strings",")",":","Name","of","labels","ordered","according","to","label","ids",".","If","this","is",":","obj",":","`","None","`",",","labels","will","be","skipped",".","filename","(","str",")",":","Basename","for","the","saved","image",".","It","can","contain","two","keywords",",",":","obj",":","`","'","{","iteration","}","'","`","and",":","obj",":","`","'","{","index","}","'","`",".","They","are","replaced","with","the","iteration","of","the","trainer","and","the","index","of","the","sample","when","this","extension","save","an","image",".","The","default","value","is",":","obj",":","`","'detection_iter=","{","iteration","}","_idx=","{","index","}",".jpg","'","`","."]
code: def __init__(
      self,
      iterator,
      target,
      label_names=None,
      filename="detection_iter={iteration}_idx={index}.jpg",
  ):
      _check_available()
  
      self.iterator = iterator
      self.target = target
      self.label_names = label_names
      self.filename = filename
  
file_path: chainercv/chainercv/extensions/vis_report/detection_vis_report.py
imports: import copy
  import os
  import warnings
  import chainer
  from chainercv.visualizations.vis_bbox import vis_bbox
label_desc: Use image node_id 1 to create a new DetectionVisReport object from inherited base classes: chainer.training.extension with example: obj = DetectionVisReport(iterator, target, label_names, filename)