1. A method for object retrieval and localization, comprising: performing, by one or more computing devices: obtaining an initial ranking of a collection of a plurality of images, with regard to a query object included in a query image, the initial ranking based on a similarity score for each of the images of the collection to the query object, the similarity score determined using a spatially-constrained similarity measure; generating a ranking of the collection with regard to each of one or more nearest neighbors to the query object as indicated by the initial ranking of the collection, said generating the ranking comprising: for each of the one or more nearest neighbors, searching the collection according to a localized object of the respective nearest neighbor to determine the similarity scores for the collection, the localized object being a best match object of the respective nearest neighbor to the query object in the query image; ranking the collection according to the similarity scores; and generating a new ranking of the collection with regard to the query object according to the initial ranking and the generated rankings with regard to each of the one or more nearest neighbors.