Skip to content

Commit

Permalink
Nested datasets and shift to new engine.
Browse files Browse the repository at this point in the history
  • Loading branch information
iwatkot committed Mar 12, 2024
1 parent 1e8bb13 commit ba86362
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,16 @@ def from_sly_to_pascal(api: sly.Api):
images = api.image.get_list(dataset.id)
for batch in sly.batched(images):
image_ids = [image_info.id for image_info in batch]
image_paths = [os.path.join(result_images_dir, image_info.name) for image_info in batch]
image_paths = [
os.path.join(result_images_dir, f"{dataset.id}_{image_info.name}")
for image_info in batch
]

api.image.download_paths(dataset.id, image_ids, image_paths)
ann_infos = api.annotation.download_batch(dataset.id, image_ids)
for image_info, ann_info in zip(batch, ann_infos):
img_title, img_ext = os.path.splitext(image_info.name)
img_title = f"{dataset.id}_{img_title}"
cur_img_filename = image_info.name

if is_trainval == 1:
Expand Down

0 comments on commit ba86362

Please sign in to comment.