-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: LEAP-1692: Image export for COCO and YOLO (#383)
Co-authored-by: Max Tkachenko <[email protected]>
- Loading branch information
1 parent
6be5737
commit bbc2aef
Showing
3 changed files
with
78 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import pytest | ||
from unittest.mock import patch | ||
from label_studio_sdk.converter import Converter | ||
|
||
@pytest.mark.parametrize("format_name,expected_download_resources", [ | ||
("YOLO_WITH_IMAGES", True), | ||
("YOLO", False) | ||
]) | ||
def test_download_resources(format_name, expected_download_resources): | ||
"""Test that download_resources is True for YOLO_WITH_IMAGES and False for simple YOLO""" | ||
with patch.object(Converter, 'convert_to_yolo', return_value=None) as mock_convert: | ||
converter = Converter(config={}, project_dir=".") | ||
converter.convert( | ||
input_data="dummy_input", | ||
output_data="dummy_output", | ||
format=format_name, | ||
is_dir=False, | ||
) | ||
assert converter.download_resources == expected_download_resources | ||
mock_convert.assert_called_once() |