def load_image_and_hash(paths):
    funcs = [imagehash.average_hash, imagehash.phash, imagehash.dhash, imagehash.whash]
    petids = []
    hashes = []
    for path in paths:
        image = Image.open(path)
        imageid = path.split('/')[(- 1)].split('.')[0][:(- 2)]
        petids.append(imageid)
        hashes.append(np.array([f(image).hash for f in funcs]).reshape(256))
    return (petids, np.array(hashes).astype(np.int32))
def load_image_and_hash(paths):
    funcs = [imagehash.average_hash, imagehash.phash, imagehash.dhash, imagehash.whash]
    petids = []
    hashes = []
    for path in paths:
        image = Image.open(path)
        imageid = path.split('/')[(- 1)].split('.')[0][:(- 2)]
        petids.append(imageid)
        hashes.append(np.array([f(image).hash for f in funcs]).reshape(256))
    return (petids, np.array(hashes).astype(np.int32))