diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-04-15 16:26:03 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-04-15 16:26:03 +0200 |
| commit | 79f0e696f3f6067a0841a37404fb546dedaa07cb (patch) | |
| tree | a064f2841dc532f81fcf04eb84300e679fda2b27 /check/app/utils/im_utils.py | |
| parent | e257e83f313a2976347b0a30f58e66b7bcbc1235 (diff) | |
cli suite working
Diffstat (limited to 'check/app/utils/im_utils.py')
| -rw-r--r-- | check/app/utils/im_utils.py | 3 |
1 files changed, 2 insertions, 1 deletions
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): |
