Skip to content

Commit 9d2325a

Browse files
[DE-4688] return processed_url for slice.items_and_annotations_generator - client (#443)
* [DE-4688] return processed_url for slice.items_and_annotations_generator - client * Trigger pipeline * Trigger pipeline
1 parent 4d0c295 commit 9d2325a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

nucleus/slice.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,13 @@ def append(
410410

411411
def items_and_annotation_generator(
412412
self,
413+
use_mirrored_images: bool = False,
413414
) -> Iterable[Dict[str, Union[DatasetItem, Dict[str, List[Annotation]]]]]:
414415
"""Provides a generator of all DatasetItems and Annotations in the slice.
415416
417+
Args:
418+
use_mirrored_images: If True, returns the location of the mirrored image hosted in Scale S3. Useful when the original image is no longer available.
419+
416420
Returns:
417421
Generator where each element is a dict containing the DatasetItem
418422
and all of its associated Annotations, grouped by type (e.g. box).
@@ -436,6 +440,7 @@ def items_and_annotation_generator(
436440
endpoint=f"slice/{self.id}/exportForTrainingPage",
437441
result_key=EXPORT_FOR_TRAINING_KEY,
438442
page_size=10000, # max ES page size
443+
chip=use_mirrored_images,
439444
)
440445
for data in json_generator:
441446
for ia in convert_export_payload([data], has_predictions=False):

0 commit comments

Comments
 (0)