Unsupervised hashing with neural trees for image retrieval and person re-identification