Deep Unsupervised Hashing by Global and Local Consistency