#NEWLINE# def append_flipped_images( self ) : #NEWLINE# #INDENT# num_images = self . num_images #NEWLINE# widths = [ PIL . Image . open ( self . image_path_at ( i ) ) . size [ 0 ] for i in xrange ( num_images ) ] #NEWLINE# for i in xrange ( num_images ) : #NEWLINE# #INDENT# boxes = self . roidb [ i ] [ 'boxes' ] . copy ( ) #NEWLINE# oldx1 = boxes [ : , 0 ] . copy ( ) #NEWLINE# oldx2 = boxes [ : , 2 ] . copy ( ) #NEWLINE# boxes [ : , 0 ] = ( ( widths [ oldx1 ] - oldx2 ) - 1 ) #NEWLINE# boxes [ : , 2 ] = ( ( widths [ i ] - oldx1 ) - 1 ) #NEWLINE# assert ( boxes [ : , 2 ] >= boxes [ : , 0 ] ) . all ( ) #NEWLINE# entry = { #NEWLINE# #INDENT# 'boxes' : boxes , #NEWLINE# 'gt_overlaps' : self . roidb [ i ] [ 'gt_overlaps' ] , #NEWLINE# 'gt_classes' : self . roidb [ i ] [ 'gt_classes' ] , #NEWLINE# 'flipped' : True , #NEWLINE# #UNINDENT# } #NEWLINE# self . roidb . append ( entry ) #NEWLINE# #UNINDENT# self . _image_index = ( self . _image_index * 2 )