### Install pdqhash Source: https://github.com/faustomorales/pdqhash-python/blob/master/README.md Installs the pdqhash Python package using pip. This is the standard method for adding the library to your Python environment. ```bash pip install pdqhash ``` -------------------------------- ### Initialize Local Development Environment Source: https://github.com/faustomorales/pdqhash-python/blob/master/README.md Sets up the local development environment for the pdqhash-python project using the 'make init' command. Requires pipenv to be installed. ```bash make init ``` -------------------------------- ### Run Project Tests Source: https://github.com/faustomorales/pdqhash-python/blob/master/README.md Executes the project's test suite using the 'make test' command. This is part of the contribution guidelines. ```bash make test ``` -------------------------------- ### Run Tests in Docker Source: https://github.com/faustomorales/pdqhash-python/blob/master/README.md Runs the project's tests within a Docker container using the 'make docker_test' command. This ensures tests are run in a consistent environment. ```bash make docker_test ``` -------------------------------- ### Compute PDQ Hash and Dihedral Variations Source: https://github.com/faustomorales/pdqhash-python/blob/master/README.md Demonstrates computing the PDQ perceptual hash for an image and its various rotations and flips. It requires the OpenCV library (cv2) and os module for image path manipulation. ```python import pdqhash image = cv2.imread(os.path.join('tests', 'images', image_name)) image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) hash_vector, quality = pdqhash.compute(image) # Get all the rotations and flips in one pass. # hash_vectors is a list of vectors in the following order # - Original # - Rotated 90 degrees # - Rotated 180 degrees # - Rotated 270 degrees # - Flipped vertically # - Flipped horizontally # - Rotated 90 degrees and flipped vertically # - Rotated 90 degrees and flipped horizontally hash_vectors, quality = pdqhash.compute_dihedral(image) # Get the floating point values of the hash. hash_vector_float, quality = pdqhash.compute_float(image) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.