def _vis_minibatch(im_blob, rois_blob, labels_blob, overlaps):
 import matplotlib.pyplot as plt
 for i in xrange(rois_blob.shape[0]):
  rois = rois_blob[i, :]
  im_ind = rois[0]
  roi = rois[1:]
  im = im_blob[im_ind, :, :, :].transpose((1, 2, 0)).copy()
  im += cfg.PIXEL_MEANS
  im = im[:, :, (2, 1, 0)]
  im = im.astype(np.uint8)
  cls = labels_blob[i]
  plt.imshow(im)
  print 'class: ', cls, ' overlap: ', overlaps[i]
  plt.gca().add_patch(plt.Rectangle((roi[0], roi[1]), (roi[2] - roi[0]), (roi[3] - roi[1]), fill=False, edgecolor='r', linewidth=3))
  plt.show()

def _vis_minibatch ( im_blob , rois_blob , labels_blob , overlaps ) : import matplotlib . pyplot as plt for i in xrange ( rois_blob . shape [ 0 ] ) : rois = rois_blob [ i , : ] im_ind = rois [ 0 ] roi = rois [ 1 : ] im = im_blob [ im_ind , : , : , : ] . transpose ( ( 1 , 2 , 0 ) ) . copy ( ) im += cfg . PIXEL_MEANS im = im [ : , : , ( 2 , 1 , 0 ) ] im = im . astype ( np . uint8 ) cls = labels_blob [ i ] plt . imshow ( im ) print 'class: ' , cls , ' overlap: ' , overlaps [ i ] plt . gca ( ) . add_patch ( plt . Rectangle ( ( roi [ 0 ] , roi [ 1 ] ) , ( roi [ 2 ] - roi [ 0 ] ) , ( roi [ 3 ] - roi [ 1 ] ) , fill = False , edgecolor = 'r' , linewidth = 3 ) ) plt . show ( )
visualize a mini-batch for debugging .