From ff7ad99d5494731fd4c73149a1efda80531cf511 Mon Sep 17 00:00:00 2001 From: vorozhkog <115161827+vorozhkog@users.noreply.github.com> Date: Mon, 4 Nov 2024 18:51:31 +0000 Subject: [PATCH 1/2] Fix Incremental ID (#28) * fix incremental id * fix unbound variable --------- Co-authored-by: vorozhkog --- src/functions.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/functions.py b/src/functions.py index 2bc6b28..88a6cd0 100644 --- a/src/functions.py +++ b/src/functions.py @@ -7,6 +7,7 @@ from supervisely.geometry import bitmap from supervisely.io.fs import mkdir +total_img_count = 0 def get_categories_map_from_meta(meta): obj_classes = meta.obj_classes @@ -87,6 +88,7 @@ def create_coco_annotation( include_captions, rectangle_mark, ): + global total_img_count for img_idx, (image_info, ann) in enumerate(zip(image_infos, anns)): image_coco_ann = dict( license="None", @@ -95,7 +97,7 @@ def create_coco_annotation( height=image_info.height, width=image_info.width, date_captured=image_info.created_at, - id=img_idx, # incremental id + id=img_idx + total_img_count, # incremental id sly_id=image_info.id # supervisely image id ) coco_ann["images"].append(image_coco_ann) @@ -148,6 +150,7 @@ def create_coco_annotation( ) ) progress.iter_done_report() + total_img_count += len(image_infos) return coco_ann, label_id, coco_captions, caption_id From 587c865174eb29188c255e28074b33b13684e648 Mon Sep 17 00:00:00 2001 From: Stan Soldatov <118521851+iwatkot@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:03:08 +0100 Subject: [PATCH 2/2] Replace 'supervise.ly' with 'supervisely.com' --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 751559d..ec93ca3 100644 --- a/README.md +++ b/README.md @@ -10,17 +10,17 @@ Results

-[![](https://img.shields.io/badge/supervisely-ecosystem-brightgreen)](https://ecosystem.supervise.ly/apps/supervisely-ecosystem/export-to-coco) -[![](https://img.shields.io/badge/slack-chat-green.svg?logo=slack)](https://supervise.ly/slack) +[![](https://img.shields.io/badge/supervisely-ecosystem-brightgreen)](https://ecosystem.supervisely.com/apps/supervisely-ecosystem/export-to-coco) +[![](https://img.shields.io/badge/slack-chat-green.svg?logo=slack)](https://supervisely.com/slack) ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/supervisely-ecosystem/export-to-coco) -[![views](https://app.supervise.ly/img/badges/views/supervisely-ecosystem/export-to-coco.png)](https://supervise.ly) -[![runs](https://app.supervise.ly/img/badges/runs/supervisely-ecosystem/export-to-coco.png)](https://supervise.ly) +[![views](https://app.supervisely.com/img/badges/views/supervisely-ecosystem/export-to-coco.png)](https://supervisely.com) +[![runs](https://app.supervisely.com/img/badges/runs/supervisely-ecosystem/export-to-coco.png)](https://supervisely.com) # Overview -App converts [Supervisely format](https://docs.supervise.ly/data-organization/00_ann_format_navi) project to [COCO format](https://cocodataset.org/#home) as a **downloadable .tar archive** +App converts [Supervisely format](https://docs.supervisely.com/data-organization/00_ann_format_navi) project to [COCO format](https://cocodataset.org/#home) as a **downloadable .tar archive** Application key points: @@ -31,12 +31,12 @@ Application key points: 👉 To exprot captions you need to create `caption` tag to the project (with `any_string` value type) and assign it to images with caption values. - ⚠️ Сonverts annotations without preserving holes. - 👉 To preserve holes in polygons or export polylines it's best to use [Export to COCO mask](https://ecosystem.supervise.ly/apps/export-to-coco-mask) + 👉 To preserve holes in polygons or export polylines it's best to use [Export to COCO mask](https://ecosystem.supervisely.com/apps/export-to-coco-mask) - Backward compatible with [Import COCO](https://github.com/supervisely-ecosystem/import-coco) # How to Use -1. Add [Export to COCO](https://ecosystem.supervise.ly/apps/export-to-coco) to your team from Ecosystem +1. Add [Export to COCO](https://ecosystem.supervisely.com/apps/export-to-coco) to your team from Ecosystem