Skip to content

Instantly share code, notes, and snippets.

View ZZZWY's full-sized avatar
🏋️‍♂️
I'm OK

南波湾 ZZZWY

🏋️‍♂️
I'm OK
View GitHub Profile
@ficapy
ficapy / phash.py
Last active May 12, 2019 13:48
将phash得到的64位数据转换成bigint方便存储到数据库
from PIL import Image
import imagehash
def get_phash(file_path):
img = Image.open(file_path)
phash = imagehash.phash(img).hash.flatten()
phash_list = list(map(bool, phash))
if phash_list[0] is True: