Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ All notable changes to this project will be documented in this file.
YOLOv10. Existing models remain available for inference, and YOLO dataset
formats remain supported ([#572](https://github.com/roboflow/roboflow-python/pull/572)).

### Fixed

- Directory uploads with `upload_dataset` now include `.webp` images and their
labels. They used to be skipped without a message
([#577](https://github.com/roboflow/roboflow-python/pull/577)).

## 1.7.3

### Added
Expand Down
2 changes: 1 addition & 1 deletion roboflow/util/folderparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from .image_utils import load_labelmap

IMAGE_EXTENSIONS = {".jpg", ".jpeg", ".png", ".bmp", ".tiff", ".tif", ".avif", ".heic"}
IMAGE_EXTENSIONS = {".jpg", ".jpeg", ".png", ".bmp", ".tiff", ".tif", ".webp", ".avif", ".heic"}
ANNOTATION_EXTENSIONS = {".txt", ".json", ".xml", ".csv", ".jsonl"}
LABELMAPS_EXTENSIONS = {".labels", ".yaml", ".yml"}

Expand Down
10 changes: 10 additions & 0 deletions tests/util/test_folderparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,16 @@ def test_coco_root_annotation_matches_images_in_subdirs(self):
self.assertEqual(len(ann_data["annotations"]), 1, "Should have one annotation")
self.assertEqual(ann_data["annotations"][0]["bbox"], [10, 20, 100, 200])

def test_lists_webp_images_with_their_labels(self):
with tempfile.TemporaryDirectory() as tmpdir:
os.makedirs(os.path.join(tmpdir, "train"))
for name in ("a.webp", "a.txt", "b.jpg", "b.txt"):
with open(os.path.join(tmpdir, "train", name), "w") as f:
f.write("0 0.5 0.5 0.5 0.5\n")
parsed = folderparser.parsefolder(tmpdir)
labels = {image["file"]: image["annotationfile"]["file"] for image in parsed["images"]}
self.assertEqual(labels, {"/train/a.webp": "/train/a.txt", "/train/b.jpg": "/train/b.txt"})


def _assertJsonMatchesFile(actual, filename):
with open(filename) as file:
Expand Down