text: import numpy as np
  import matplotlib.pyplot as plt
  
  def vis_detections(im, class_name, dets,ax, thresh=0.5, pb=True):
      """Draw detected bounding boxes."""
      inds = np.where(dets[:, -1] >= thresh)[0]
      if len(inds) == 0:
          return
  
      for i in inds:
          bbox = dets[i, :4]
          score = dets[i, -1]
  
          ax.add_patch(
              plt.Rectangle((bbox[0], bbox[1]),
                            bbox[2] - bbox[0],
                            bbox[3] - bbox[1], fill=False,
                            edgecolor='red', linewidth=3.5)
              )
          if pb:
              ax.text(bbox[0], bbox[1] - 2,
                  '{:s} {:.3f}'.format(class_name, score),
                  bbox=dict(facecolor='blue', alpha=0.5),
                  fontsize=14, color='white')
  
      ax.set_title(('{} detections with '
                    'p({} | box) >= {:.1f}').format(class_name, class_name,
                                                    thresh),
                    fontsize=14)
      plt.axis('off')
      plt.tight_layout()
      plt.draw()