Git Product home page Git Product logo

Comments (4)

Runisco avatar Runisco commented on August 28, 2024

This is screwing me over. I'm finding no way to use get_num_bits with any form of variable that converts it to a hex number. With all the excuses in the book, no str, no int even when it's hex.
Only way is to manually enter hex numbers, and then this is rendered useless.

from dhash.

benhoyt avatar benhoyt commented on August 28, 2024

Sorry, but I'm not really sure what you're asking. Most functions that convert to hex return a str in Python, for example the built-in hex() function. There's no such thing as a "hex type", at least not in the standard library.

If you want to use get_num_bits_different(), first call dhash_int() on both images (this returns an integer), then pass the results of those to get_num_bits_different(). For example, see here: https://github.com/Jetsetter/dhash/blob/master/dhash.py#L281-L283

from dhash.

Runisco avatar Runisco commented on August 28, 2024

image1 = Image.open('image_name.jpg')
hash1 = dhash_int(image1)

Traceback (most recent call last):
File "*", line 105, in
hash1 = dhash_int(image1)
NameError: name 'dhash_int' is not defined

from dhash.

benhoyt avatar benhoyt commented on August 28, 2024

How are you importing dhash? If you're using import dhash then you'll have to type dhash.dhash_int() Otherwise you can do from dhash import dhash_int and then use it directly.

from dhash.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.