def compute_features(net, im):
 if config.FLAG_CPU_MODE:
  net.blobs['data'].reshape(*im.shape)
  net.blobs['data'].data[...] = im
  net.forward()
  fc7 = net.blobs['fc7'].data
 else:
  fc7 = numpy.array(lasagne.layers.get_output(net['fc7'], im, deterministic=True).eval())
 return fc7

def compute_features ( net , im ) : if config . FLAG_CPU_MODE : net . blobs [ 'data' ] . reshape ( * im . shape ) net . blobs [ 'data' ] . data [ ... ] = im net . forward ( ) fc7 = net . blobs [ 'fc7' ] . data else : fc7 = numpy . array ( lasagne . layers . get_output ( net [ 'fc7' ] , im , deterministic = True ) . eval ( ) ) return fc7
compute fc7 features for im .