def compute_ukbench_score(src, imlist):
 nbr_images = len(imlist)
 pos = zeros((nbr_images, 4))
 for i in range(nbr_images):
  pos[i] = [(w[1] - 1) for w in src.query(imlist[i])[:4]]
 score = (array([((pos[i] // 4) == (i // 4)) for i in range(nbr_images)]) * 1.0)
 return (sum(score) / nbr_images)

def compute_ukbench_score ( src , imlist ) : nbr_images = len ( imlist ) pos = zeros ( ( nbr_images , 4 ) ) for i in range ( nbr_images ) : pos [ i ] = [ ( w [ 1 ] - 1 ) for w in src . query ( imlist [ i ] ) [ : 4 ] ] score = ( array ( [ ( ( pos [ i ] // 4 ) == ( i // 4 ) ) for i in range ( nbr_images ) ] ) * 1.0 ) return ( sum ( score ) / nbr_images )
returns the average number of correct images on the top four results of queries .