From 79f0e696f3f6067a0841a37404fb546dedaa07cb Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 15 Apr 2019 16:26:03 +0200 Subject: cli suite working --- check/app/utils/im_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'check/app/utils/im_utils.py') diff --git a/check/app/utils/im_utils.py b/check/app/utils/im_utils.py index dfd5739..747e900 100644 --- a/check/app/utils/im_utils.py +++ b/check/app/utils/im_utils.py @@ -15,6 +15,7 @@ import torch import torch.nn as nn import torchvision.models as models import torchvision.transforms as transforms +import struct from torch.autograd import Variable from sklearn.metrics.pairwise import cosine_similarity import datetime @@ -214,7 +215,7 @@ def phash2int(phash): :returns: binary-encoded bigint """ phash.hash[-1] = False - phash_as_bigint = struct.unpack('Q', numpy.packbits(phash.hash))[0] + phash_as_bigint = struct.unpack('Q', np.packbits(phash.hash))[0] return phash_as_bigint def compute_phash_int(im): -- cgit v1.2.3-70-g09d2