Skip to content

Commit 9ba184b

Browse files
committed
adds support for heic/avif too
1 parent 0576175 commit 9ba184b

File tree

5 files changed

+6
-2
lines changed

5 files changed

+6
-2
lines changed

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ matplotlib
66
numpy>=1.18.5
77
opencv-python-headless==4.10.0.84
88
Pillow>=7.1.2
9+
pillow-avif-plugin>=1.5.0
10+
pillow-heif>=0.18.0
911
python-dateutil
1012
python-dotenv
1113
requests

roboflow/core/project.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
"image/webp",
2525
"image/tiff",
2626
"image/tif",
27+
"image/avif",
28+
"image/heic",
2729
}
2830

2931

roboflow/util/folderparser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from .image_utils import load_labelmap
99

10-
IMAGE_EXTENSIONS = {".jpg", ".jpeg", ".png", ".bmp", ".tiff", ".tif"}
10+
IMAGE_EXTENSIONS = {".jpg", ".jpeg", ".png", ".bmp", ".tiff", ".tif", ".avif", ".heic"}
1111
ANNOTATION_EXTENSIONS = {".txt", ".json", ".xml", ".csv", ".jsonl"}
1212
LABELMAPS_EXTENSIONS = {".labels", ".yaml", ".yml"}
1313

tests/images/whatsnew.avif

11.8 KB
Binary file not shown.

tests/test_project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def test_check_valid_image_with_accepted_formats(self):
1616
"hand-rabbit.PNG",
1717
"woodland-rabbit.png",
1818
"file_example_TIFF_1MB.tiff",
19+
"sky-rabbit.heic",
1920
]
2021

2122
for image in images_to_test:
@@ -24,7 +25,6 @@ def test_check_valid_image_with_accepted_formats(self):
2425
def test_check_valid_image_with_unaccepted_formats(self):
2526
images_to_test = [
2627
"sky-rabbit.gif",
27-
"sky-rabbit.heic",
2828
]
2929

3030
for image in images_to_test:

0 commit comments

Comments
 (0)