Skip to content

Commit 0576175

Browse files
committed
support for tiff images
1 parent 97d4838 commit 0576175

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

roboflow/core/project.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
"image/jpeg",
2323
"image/png",
2424
"image/webp",
25+
"image/tiff",
26+
"image/tif",
2527
}
2628

2729

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"}
10+
IMAGE_EXTENSIONS = {".jpg", ".jpeg", ".png", ".bmp", ".tiff", ".tif"}
1111
ANNOTATION_EXTENSIONS = {".txt", ".json", ".xml", ".csv", ".jsonl"}
1212
LABELMAPS_EXTENSIONS = {".labels", ".yaml", ".yml"}
1313

1.08 MB
Binary file not shown.

tests/test_project.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def test_check_valid_image_with_accepted_formats(self):
1515
"rabbit2.jpg",
1616
"hand-rabbit.PNG",
1717
"woodland-rabbit.png",
18+
"file_example_TIFF_1MB.tiff",
1819
]
1920

2021
for image in images_to_test:
@@ -32,7 +33,7 @@ def test_check_valid_image_with_unaccepted_formats(self):
3233
def test_upload_raises_upload_image_error(self):
3334
responses.add(
3435
responses.POST,
35-
f"{API_URL}/dataset/{PROJECT_NAME}/upload?api_key={ROBOFLOW_API_KEY}" f"&batch={DEFAULT_BATCH_NAME}",
36+
f"{API_URL}/dataset/{PROJECT_NAME}/upload?api_key={ROBOFLOW_API_KEY}&batch={DEFAULT_BATCH_NAME}",
3637
json={
3738
"error": {
3839
"message": "Invalid image.",
@@ -58,15 +59,15 @@ def test_upload_raises_upload_annotation_error(self):
5859
# Image upload
5960
responses.add(
6061
responses.POST,
61-
f"{API_URL}/dataset/{PROJECT_NAME}/upload?api_key={ROBOFLOW_API_KEY}" f"&batch={DEFAULT_BATCH_NAME}",
62+
f"{API_URL}/dataset/{PROJECT_NAME}/upload?api_key={ROBOFLOW_API_KEY}&batch={DEFAULT_BATCH_NAME}",
6263
json={"success": True, "id": image_id},
6364
status=200,
6465
)
6566

6667
# Annotation
6768
responses.add(
6869
responses.POST,
69-
f"{API_URL}/dataset/{PROJECT_NAME}/annotate/{image_id}?api_key={ROBOFLOW_API_KEY}" f"&name={image_name}",
70+
f"{API_URL}/dataset/{PROJECT_NAME}/annotate/{image_id}?api_key={ROBOFLOW_API_KEY}&name={image_name}",
7071
json={
7172
"error": {
7273
"message": "Image was already annotated.",

0 commit comments

Comments
 (0)