diff --git a/imagededup/utils/image_utils.py b/imagededup/utils/image_utils.py index 7de6521d..c922c629 100644 --- a/imagededup/utils/image_utils.py +++ b/imagededup/utils/image_utils.py @@ -7,7 +7,7 @@ from imagededup.utils.logger import return_logger -IMG_FORMATS = ['JPEG', 'PNG', 'BMP', 'MPO', 'PPM', 'TIFF', 'GIF'] +IMG_FORMATS = ['JPEG', 'PNG', 'BMP', 'MPO', 'PPM', 'TIFF', 'GIF', 'WEBP'] logger = return_logger(__name__) diff --git a/mkdocs/docs/user_guide/encoding_generation.md b/mkdocs/docs/user_guide/encoding_generation.md index c8511335..674efe12 100644 --- a/mkdocs/docs/user_guide/encoding_generation.md +++ b/mkdocs/docs/user_guide/encoding_generation.md @@ -45,7 +45,7 @@ The 'method-name' corresponds to one of the deduplication methods available and - If an image in the image directory can't be loaded, no encodings are generated for the image. Hence, there is no entry for the image in the returned encodings dictionary. -- Supported image formats: 'JPEG', 'PNG', 'BMP', 'MPO', 'PPM', 'TIFF', 'GIF', 'SVG', 'PGM', 'PBM'. +- Supported image formats: 'JPEG', 'PNG', 'BMP', 'MPO', 'PPM', 'TIFF', 'GIF', 'SVG', 'PGM', 'PBM', 'WEBP'. #### Examples @@ -74,7 +74,7 @@ array if cnn is used. #### Considerations - If the image can't be loaded, no encodings are generated for the image and *None* is returned. -- Supported image formats: 'JPEG', 'PNG', 'BMP', 'MPO', 'PPM', 'TIFF', 'GIF', 'SVG', 'PGM', 'PBM'. +- Supported image formats: 'JPEG', 'PNG', 'BMP', 'MPO', 'PPM', 'TIFF', 'GIF', 'SVG', 'PGM', 'PBM', 'WEBP'. #### Examples diff --git a/tests/data/formats_images/ukbench09380.webp b/tests/data/formats_images/ukbench09380.webp new file mode 100644 index 00000000..ae84d0a0 Binary files /dev/null and b/tests/data/formats_images/ukbench09380.webp differ diff --git a/tests/test_cnn.py b/tests/test_cnn.py index 576a64f9..54d32547 100644 --- a/tests/test_cnn.py +++ b/tests/test_cnn.py @@ -92,6 +92,7 @@ def test__get_cnn_features_batch(cnn): 'ukbench09380.jpeg', 'ukbench09380.png', 'ukbench09380.svg', + 'ukbench09380.webp', ] assert list(sorted(result.keys(), key=str.lower)) == expected_predicted_files @@ -204,6 +205,7 @@ def test_encode_images(cnn): 'ukbench09380.jpeg', 'ukbench09380.png', 'ukbench09380.svg', + 'ukbench09380.webp', ] assert list(sorted(result.keys(), key=str.lower)) == expected_predicted_files @@ -225,6 +227,7 @@ def test_encode_images(cnn): 'ukbench09380.jpeg', 'ukbench09380.png', 'ukbench09380.svg', + 'ukbench09380.webp', ] assert list(sorted(result.keys(), key=str.lower)) == expected_predicted_files