def im_proposals(net, im):
 blobs = {}
 (blobs['data'], blobs['im_info']) = _get_image_blob(im)
 net.blobs['data'].reshape(*blobs['data'].shape)
 net.blobs['im_info'].reshape(*blobs['im_info'].shape)
 blobs_out = net.forward(data=blobs['data'].astype(np.float32, copy=False), im_info=blobs['im_info'].astype(np.float32, copy=False))
 scale = blobs['im_info'][(0, 2)]
 boxes = (blobs_out['rois'][:, 1:].copy() / scale)
 scores = blobs_out['scores'].copy()
 return (boxes, scores)

def im_proposals ( net , im ) : blobs = { } ( blobs [ 'data' ] , blobs [ 'im_info' ] ) = _get_image_blob ( im ) net . blobs [ 'data' ] . reshape ( * blobs [ 'data' ] . shape ) net . blobs [ 'im_info' ] . reshape ( * blobs [ 'im_info' ] . shape ) blobs_out = net . forward ( data = blobs [ 'data' ] . astype ( np . float32 , copy = False ) , im_info = blobs [ 'im_info' ] . astype ( np . float32 , copy = False ) ) scale = blobs [ 'im_info' ] [ ( 0 , 2 ) ] boxes = ( blobs_out [ 'rois' ] [ : , 1 : ] . copy ( ) / scale ) scores = blobs_out [ 'scores' ] . copy ( ) return ( boxes , scores )
generate rpn proposals on a single image .