Skip to content

Commit

Permalink
Merge pull request #49 from meedan/cv2-4044-alegre-sync-images
Browse files Browse the repository at this point in the history
CV2-4044 fix missing self reference
  • Loading branch information
DGaffney authored Dec 1, 2023
2 parents 4ed34f0 + 6fad721 commit 7eb1b0e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/model/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from lib import schemas

class Model(Model):
def compute_pdq(iobytes: io.BytesIO) -> str:
def compute_pdq(self, iobytes: io.BytesIO) -> str:
"""Compute perceptual hash using ImageHash library
:param im: Numpy.ndarray
:returns: Imagehash.ImageHash
Expand Down
2 changes: 1 addition & 1 deletion test/lib/model/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_compute_pdq(self, mock_pdq_hasher):
image_content = file.read()
mock_hasher_instance = mock_pdq_hasher.return_value
mock_hasher_instance.fromBufferedImage.return_value.getHash.return_value.dumpBitsFlat.return_value = '1001'
result = Model.compute_pdq(io.BytesIO(image_content))
result = Model().compute_pdq(io.BytesIO(image_content))
self.assertEqual(result, '0011100000111011010110100001001110001011110100100010101011010111010110101010000111001010111000001010111111110000000101110010000011111110111110100100011111010010110110101111101100111001000000010010100101010111110001001101101011000110001000001110010000111100')

@patch("urllib.request.urlopen")
Expand Down

0 comments on commit 7eb1b0e

Please sign in to comment.