superannotate 4.5.1b2__tar.gz → 4.5.2.dev2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {superannotate-4.5.1b2/src/superannotate.egg-info → superannotate-4.5.2.dev2}/PKG-INFO +2 -2
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/setup.py +1 -1
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/__init__.py +1 -3
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/analytics/aggregators.py +1 -7
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/analytics/common.py +0 -2
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/helpers.py +2 -6
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/__init__.py +0 -2
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/conversion.py +4 -54
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/baseStrategy.py +0 -37
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/coco_converters/coco_converter.py +2 -43
- superannotate-4.5.2.dev2/src/superannotate/lib/app/input_converters/converters/coco_converters/coco_to_sa_pixel.py +18 -0
- superannotate-4.5.2.dev2/src/superannotate/lib/app/input_converters/converters/coco_converters/sa_pixel_to_coco.py +31 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/converters.py +0 -3
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/labelbox_converters/labelbox_helper.py +0 -10
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/sa_json_helper.py +0 -15
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/supervisely_converters/supervisely_strategies.py +0 -7
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/voc_converters/voc_strategies.py +0 -6
- superannotate-4.5.2.dev2/src/superannotate/lib/app/input_converters/converters/voc_converters/voc_to_sa_pixel.py +78 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/export_from_sa_conversions.py +1 -9
- superannotate-4.5.2.dev2/src/superannotate/lib/app/input_converters/sa_conversion.py +9 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/interface/base_interface.py +3 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/interface/sdk_interface.py +223 -30
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/__init__.py +0 -4
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/entities/__init__.py +4 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/entities/base.py +13 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/entities/classes.py +3 -30
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/entities/filters.py +9 -1
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/entities/work_managament.py +111 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/enums.py +16 -2
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/service_types.py +8 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/serviceproviders.py +20 -1
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/usecases/annotations.py +5 -68
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/usecases/classes.py +26 -33
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/usecases/images.py +2 -48
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/usecases/models.py +57 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/usecases/projects.py +9 -5
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/infrastructure/controller.py +82 -67
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/infrastructure/query_builder.py +28 -4
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/infrastructure/serviceprovider.py +11 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/infrastructure/services/explore.py +1 -1
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/infrastructure/services/http_client.py +3 -0
- superannotate-4.5.2.dev2/src/superannotate/lib/infrastructure/services/item_service.py +54 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/infrastructure/services/work_management.py +27 -5
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2/src/superannotate.egg-info}/PKG-INFO +2 -2
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate.egg-info/SOURCES.txt +0 -4
- superannotate-4.5.1b2/src/superannotate/lib/app/input_converters/converters/coco_converters/coco_to_sa_pixel.py +0 -184
- superannotate-4.5.1b2/src/superannotate/lib/app/input_converters/converters/coco_converters/sa_pixel_to_coco.py +0 -88
- superannotate-4.5.1b2/src/superannotate/lib/app/input_converters/converters/labelbox_converters/labelbox_strategies.py +0 -42
- superannotate-4.5.1b2/src/superannotate/lib/app/input_converters/converters/labelbox_converters/labelbox_to_sa_pixel.py +0 -99
- superannotate-4.5.1b2/src/superannotate/lib/app/input_converters/converters/sagemaker_converters/sagemaker_to_sa_pixel.py +0 -126
- superannotate-4.5.1b2/src/superannotate/lib/app/input_converters/converters/supervisely_converters/supervisely_to_sa_pixel.py +0 -91
- superannotate-4.5.1b2/src/superannotate/lib/app/input_converters/converters/voc_converters/voc_to_sa_pixel.py +0 -139
- superannotate-4.5.1b2/src/superannotate/lib/app/input_converters/sa_conversion.py +0 -191
- superannotate-4.5.1b2/src/superannotate/lib/infrastructure/services/item_service.py +0 -144
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/LICENSE +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/MANIFEST.in +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/README.rst +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/requirements.txt +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/setup.cfg +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/__init__.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/__init__.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/analytics/__init__.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/bin/__init__.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/bin/superannotate.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/common.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/exceptions.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/__init__.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/coco_converters/__init__.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/coco_converters/coco_api.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/coco_converters/coco_strategies.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/coco_converters/coco_to_sa_vector.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/coco_converters/sa_vector_to_coco.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/dataloop_converters/__init__.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/dataloop_converters/dataloop_helper.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/dataloop_converters/dataloop_strategies.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/dataloop_converters/dataloop_to_sa_vector.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/googlecloud_converters/__init__.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/googlecloud_converters/googlecloud_strategies.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/googlecloud_converters/googlecloud_to_sa_vector.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/labelbox_converters/__init__.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/labelbox_converters/labelbox_to_sa_vector.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/sagemaker_converters/__init__.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/sagemaker_converters/sagemaker_strategies.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/sagemaker_converters/sagemaker_to_sa_vector.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/supervisely_converters/__init__.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/supervisely_converters/supervisely_helper.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/supervisely_converters/supervisely_to_sa_vector.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/vgg_converters/__init__.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/vgg_converters/vgg_helper.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/vgg_converters/vgg_strategies.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/vgg_converters/vgg_to_sa_vector.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/voc_converters/__init__.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/voc_converters/voc_helper.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/voc_converters/voc_to_sa_vector.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/vott_converters/__init__.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/vott_converters/vott_strategies.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/vott_converters/vott_to_sa_vector.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/yolo_converters/__init__.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/yolo_converters/yolo_strategies.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/converters/yolo_converters/yolo_to_sa_vector.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/input_converters/import_to_sa_conversions.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/interface/__init__.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/interface/cli_interface.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/interface/sdk/__init__.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/interface/sdk/folders.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/interface/sdk/project.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/interface/types.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/serializers.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/base_usecases.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/conditions.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/config.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/entities/folder.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/entities/integrations.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/entities/items.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/entities/multimodal_form.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/entities/project.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/entities/project_entities.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/exceptions.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/jsx_conditions.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/plugin.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/pydantic_v1.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/reporter.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/repositories.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/response.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/types.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/usecases/__init__.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/usecases/base.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/usecases/custom_fields.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/usecases/folders.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/usecases/integrations.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/usecases/items.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/utils.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/core/video_convertor.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/infrastructure/__init__.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/infrastructure/annotation_adapter.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/infrastructure/custom_entities.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/infrastructure/helpers.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/infrastructure/repositories.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/infrastructure/services/__init__.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/infrastructure/services/annotation.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/infrastructure/services/annotation_class.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/infrastructure/services/folder.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/infrastructure/services/integration.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/infrastructure/services/item.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/infrastructure/services/project.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/infrastructure/services/telemetry_scoring.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/infrastructure/stream_data_handler.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/infrastructure/utils.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/infrastructure/validators.py +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate.egg-info/dependency_links.txt +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate.egg-info/entry_points.txt +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate.egg-info/requires.txt +0 -0
- {superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: superannotate
|
|
3
|
-
Version: 4.5.
|
|
3
|
+
Version: 4.5.2.dev2
|
|
4
4
|
Summary: Python SDK to SuperAnnotate platform
|
|
5
5
|
Home-page: https://github.com/superannotateai/superannotate-python-sdk
|
|
6
6
|
Author: SuperAnnotate AI
|
|
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.13
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
-
Requires-Python: >=3.
|
|
17
|
+
Requires-Python: >=3.10
|
|
18
18
|
Description-Content-Type: text/x-rst
|
|
19
19
|
License-File: LICENSE
|
|
20
20
|
Requires-Dist: pydantic!=2.0.*,<3,>=1.10
|
|
@@ -3,7 +3,7 @@ import os
|
|
|
3
3
|
import sys
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
__version__ = "4.5.
|
|
6
|
+
__version__ = "4.5.2dev2"
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
os.environ.update({"sa_version": __version__})
|
|
@@ -17,7 +17,6 @@ from lib.core import PACKAGE_VERSION_INFO_MESSAGE
|
|
|
17
17
|
from lib.core import PACKAGE_VERSION_MAJOR_UPGRADE
|
|
18
18
|
from lib.core.exceptions import AppException
|
|
19
19
|
from lib.core.exceptions import FileChangedError
|
|
20
|
-
from superannotate.lib.app.input_converters import convert_project_type
|
|
21
20
|
from superannotate.lib.app.input_converters import export_annotation
|
|
22
21
|
from superannotate.lib.app.input_converters import import_annotation
|
|
23
22
|
from superannotate.lib.app.interface.sdk_interface import SAClient
|
|
@@ -37,7 +36,6 @@ __all__ = [
|
|
|
37
36
|
"FileChangedError",
|
|
38
37
|
"import_annotation",
|
|
39
38
|
"export_annotation",
|
|
40
|
-
"convert_project_type",
|
|
41
39
|
]
|
|
42
40
|
|
|
43
41
|
__author__ = "Superannotate"
|
|
@@ -9,7 +9,6 @@ from typing import Union
|
|
|
9
9
|
|
|
10
10
|
import lib.core as constances
|
|
11
11
|
import pandas as pd
|
|
12
|
-
from lib.core import PIXEL_ANNOTATION_POSTFIX
|
|
13
12
|
from lib.core import VECTOR_ANNOTATION_POSTFIX
|
|
14
13
|
from lib.core.exceptions import AppException
|
|
15
14
|
|
|
@@ -162,8 +161,6 @@ class DataAggregator:
|
|
|
162
161
|
self._annotation_suffix = ".json"
|
|
163
162
|
elif VECTOR_ANNOTATION_POSTFIX in fname.name:
|
|
164
163
|
self._annotation_suffix = VECTOR_ANNOTATION_POSTFIX
|
|
165
|
-
elif PIXEL_ANNOTATION_POSTFIX in fname.name:
|
|
166
|
-
self._annotation_suffix = PIXEL_ANNOTATION_POSTFIX
|
|
167
164
|
else:
|
|
168
165
|
self._annotation_suffix = ".json"
|
|
169
166
|
|
|
@@ -205,10 +202,7 @@ class DataAggregator:
|
|
|
205
202
|
self.check_classes_path()
|
|
206
203
|
annotation_paths = self.get_annotation_paths()
|
|
207
204
|
|
|
208
|
-
if self.project_type
|
|
209
|
-
constances.ProjectType.VECTOR,
|
|
210
|
-
constances.ProjectType.PIXEL,
|
|
211
|
-
):
|
|
205
|
+
if self.project_type is constances.ProjectType.VECTOR:
|
|
212
206
|
return self.aggregate_image_annotations_as_df(annotation_paths)
|
|
213
207
|
if self.project_type is constances.ProjectType.VIDEO:
|
|
214
208
|
return self.aggregate_video_annotations_as_df(annotation_paths)
|
{superannotate-4.5.1b2 → superannotate-4.5.2.dev2}/src/superannotate/lib/app/analytics/common.py
RENAMED
|
@@ -173,8 +173,6 @@ def aggregate_image_annotations_as_df(
|
|
|
173
173
|
|
|
174
174
|
if "___objects.json" in annotations_paths[0].name:
|
|
175
175
|
type_postfix = "___objects.json"
|
|
176
|
-
elif "___pixel.json" in annotations_paths[0].name:
|
|
177
|
-
type_postfix = "___pixel.json"
|
|
178
176
|
else:
|
|
179
177
|
type_postfix = ".json"
|
|
180
178
|
|
|
@@ -9,7 +9,6 @@ import boto3
|
|
|
9
9
|
import numpy as np
|
|
10
10
|
import pandas as pd
|
|
11
11
|
from lib.core import ATTACHED_VIDEO_ANNOTATION_POSTFIX
|
|
12
|
-
from lib.core import PIXEL_ANNOTATION_POSTFIX
|
|
13
12
|
from lib.core import VECTOR_ANNOTATION_POSTFIX
|
|
14
13
|
from lib.core.exceptions import AppException
|
|
15
14
|
|
|
@@ -36,7 +35,6 @@ def get_local_annotation_paths(
|
|
|
36
35
|
if i.name.endswith(
|
|
37
36
|
(
|
|
38
37
|
VECTOR_ANNOTATION_POSTFIX,
|
|
39
|
-
PIXEL_ANNOTATION_POSTFIX,
|
|
40
38
|
ATTACHED_VIDEO_ANNOTATION_POSTFIX,
|
|
41
39
|
)
|
|
42
40
|
)
|
|
@@ -66,10 +64,8 @@ def get_s3_annotation_paths(folder_path, s3_bucket, annotation_paths, recursive)
|
|
|
66
64
|
for data in paginator.paginate(Bucket=s3_bucket, Prefix=folder_path):
|
|
67
65
|
for annotation in data.get("Contents", []):
|
|
68
66
|
key = annotation["Key"]
|
|
69
|
-
if (
|
|
70
|
-
|
|
71
|
-
or key.endswith(PIXEL_ANNOTATION_POSTFIX)
|
|
72
|
-
or key.endswith(ATTACHED_VIDEO_ANNOTATION_POSTFIX)
|
|
67
|
+
if key.endswith(VECTOR_ANNOTATION_POSTFIX) or key.endswith(
|
|
68
|
+
ATTACHED_VIDEO_ANNOTATION_POSTFIX
|
|
73
69
|
):
|
|
74
70
|
if not recursive and "/" in key[len(folder_path) + 1 :]:
|
|
75
71
|
continue
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
from lib.app.input_converters.conversion import convert_project_type
|
|
2
1
|
from lib.app.input_converters.conversion import export_annotation
|
|
3
2
|
from lib.app.input_converters.conversion import import_annotation
|
|
4
3
|
|
|
5
4
|
|
|
6
5
|
__all__ = [
|
|
7
|
-
"convert_project_type",
|
|
8
6
|
"export_annotation",
|
|
9
7
|
"import_annotation",
|
|
10
8
|
]
|
|
@@ -6,17 +6,14 @@ import shutil
|
|
|
6
6
|
import tempfile
|
|
7
7
|
from argparse import Namespace
|
|
8
8
|
from pathlib import Path
|
|
9
|
-
from typing import Union
|
|
10
9
|
|
|
11
10
|
from lib.app.interface.base_interface import Tracker
|
|
12
11
|
from lib.core import LIMITED_FUNCTIONS
|
|
13
12
|
from lib.core.enums import ProjectType
|
|
14
13
|
from lib.core.exceptions import AppException
|
|
15
|
-
from typing_extensions import Literal
|
|
16
14
|
|
|
17
15
|
from .export_from_sa_conversions import export_from_sa
|
|
18
16
|
from .import_to_sa_conversions import import_to_sa
|
|
19
|
-
from .sa_conversion import sa_convert_project_type
|
|
20
17
|
|
|
21
18
|
|
|
22
19
|
ALLOWED_TASK_TYPES = [
|
|
@@ -27,12 +24,10 @@ ALLOWED_TASK_TYPES = [
|
|
|
27
24
|
"vector_annotation",
|
|
28
25
|
]
|
|
29
26
|
|
|
30
|
-
ALLOWED_PROJECT_TYPES = ["
|
|
27
|
+
ALLOWED_PROJECT_TYPES = ["Vector"]
|
|
31
28
|
|
|
32
29
|
ALLOWED_ANNOTATION_IMPORT_FORMATS = {
|
|
33
30
|
"COCO": [
|
|
34
|
-
("Pixel", "panoptic_segmentation"),
|
|
35
|
-
("Pixel", "instance_segmentation"),
|
|
36
31
|
("Vector", "keypoint_detection"),
|
|
37
32
|
("Vector", "instance_segmentation"),
|
|
38
33
|
("Vector", "object_detection"),
|
|
@@ -40,13 +35,11 @@ ALLOWED_ANNOTATION_IMPORT_FORMATS = {
|
|
|
40
35
|
"VOC": [
|
|
41
36
|
("Vector", "object_detection"),
|
|
42
37
|
("Vector", "instance_segmentation"),
|
|
43
|
-
("Pixel", "instance_segmentation"),
|
|
44
38
|
],
|
|
45
39
|
"LabelBox": [
|
|
46
40
|
("Vector", "object_detection"),
|
|
47
41
|
("Vector", "instance_segmentation"),
|
|
48
42
|
("Vector", "vector_annotation"),
|
|
49
|
-
("Pixel", "instance_segmentation"),
|
|
50
43
|
],
|
|
51
44
|
"DataLoop": [
|
|
52
45
|
("Vector", "object_detection"),
|
|
@@ -57,7 +50,6 @@ ALLOWED_ANNOTATION_IMPORT_FORMATS = {
|
|
|
57
50
|
("Vector", "vector_annotation"),
|
|
58
51
|
("Vector", "object_detection"),
|
|
59
52
|
("Vector", "instance_segmentation"),
|
|
60
|
-
("Pixel", "instance_segmentation"),
|
|
61
53
|
("Vector", "keypoint_detection"),
|
|
62
54
|
],
|
|
63
55
|
"VoTT": [
|
|
@@ -65,7 +57,7 @@ ALLOWED_ANNOTATION_IMPORT_FORMATS = {
|
|
|
65
57
|
("Vector", "instance_segmentation"),
|
|
66
58
|
("Vector", "vector_annotation"),
|
|
67
59
|
],
|
|
68
|
-
"SageMaker": [("
|
|
60
|
+
"SageMaker": [("Vector", "object_detection")],
|
|
69
61
|
"VGG": [
|
|
70
62
|
("Vector", "object_detection"),
|
|
71
63
|
("Vector", "instance_segmentation"),
|
|
@@ -77,8 +69,6 @@ ALLOWED_ANNOTATION_IMPORT_FORMATS = {
|
|
|
77
69
|
|
|
78
70
|
ALLOWED_ANNOTATION_EXPORT_FORMATS = {
|
|
79
71
|
"COCO": [
|
|
80
|
-
("Pixel", "panoptic_segmentation"),
|
|
81
|
-
("Pixel", "instance_segmentation"),
|
|
82
72
|
("Vector", "instance_segmentation"),
|
|
83
73
|
("Vector", "keypoint_detection"),
|
|
84
74
|
("Vector", "object_detection"),
|
|
@@ -166,8 +156,6 @@ def export_annotation(
|
|
|
166
156
|
--------------------------------------
|
|
167
157
|
project_type task
|
|
168
158
|
============== ======================
|
|
169
|
-
Pixel panoptic_segmentation
|
|
170
|
-
Pixel instance_segmentation
|
|
171
159
|
Vector instance_segmentation
|
|
172
160
|
Vector object_detection
|
|
173
161
|
Vector keypoint_detection
|
|
@@ -181,15 +169,13 @@ def export_annotation(
|
|
|
181
169
|
:type dataset_format: str
|
|
182
170
|
:param dataset_name: Will be used to create json file in the output_dir.
|
|
183
171
|
:type dataset_name: str
|
|
184
|
-
:param project_type: SuperAnnotate project type is
|
|
172
|
+
:param project_type: SuperAnnotate project type is 'Vector'
|
|
185
173
|
'Vector' project creates <image_name>___objects.json for each image.
|
|
186
|
-
'Pixel' project creates <image_name>___pixel.jsons and <image_name>___save.png annotation mask for each image.
|
|
187
174
|
:type project_type: str
|
|
188
175
|
:param task: Task can be one of the following: ['panoptic_segmentation', 'instance_segmentation',
|
|
189
176
|
'keypoint_detection', 'object_detection']. (Default: "object_detection").
|
|
190
177
|
'keypoint_detection' can be used to converts keypoints from/to available annotation format.
|
|
191
178
|
'panoptic_segmentation' will use panoptic mask for each image to generate bluemask for SuperAnnotate annotation format and use bluemask to generate panoptic mask for invert conversion. Panoptic masks should be in the input folder.
|
|
192
|
-
'instance_segmentation' 'Pixel' project_type converts instance masks and 'Vector' project_type generates bounding boxes and polygons from instance masks. Masks should be in the input folder if it is 'Pixel' project_type.
|
|
193
179
|
'object_detection' converts objects from/to available annotation format
|
|
194
180
|
:type task: str
|
|
195
181
|
"""
|
|
@@ -223,8 +209,6 @@ def export_annotation(
|
|
|
223
209
|
_passes_value_sanity(values_info)
|
|
224
210
|
if project_type == "Vector":
|
|
225
211
|
extension = "___objects.json"
|
|
226
|
-
elif project_type == "Pixel":
|
|
227
|
-
extension = "___pixel.json"
|
|
228
212
|
else:
|
|
229
213
|
extension = ".json"
|
|
230
214
|
with tempfile.TemporaryDirectory() as tmp_dir:
|
|
@@ -264,8 +248,6 @@ def import_annotation(
|
|
|
264
248
|
--------------------------------------
|
|
265
249
|
project_type task
|
|
266
250
|
============== ======================
|
|
267
|
-
Pixel panoptic_segmentation
|
|
268
|
-
Pixel instance_segmentation
|
|
269
251
|
Vector instance_segmentation
|
|
270
252
|
Vector object_detection
|
|
271
253
|
Vector keypoint_detection
|
|
@@ -276,7 +258,6 @@ def import_annotation(
|
|
|
276
258
|
--------------------------------------
|
|
277
259
|
project_type task
|
|
278
260
|
============== ======================
|
|
279
|
-
Pixel instance_segmentation
|
|
280
261
|
Vector instance_segmentation
|
|
281
262
|
Vector object_detection
|
|
282
263
|
============== ======================
|
|
@@ -289,7 +270,6 @@ def import_annotation(
|
|
|
289
270
|
Vector object_detection
|
|
290
271
|
Vector instance_segmentation
|
|
291
272
|
Vector vector_annotation
|
|
292
|
-
Pixel instance_segmentation
|
|
293
273
|
============== ======================
|
|
294
274
|
|
|
295
275
|
============== ======================
|
|
@@ -311,7 +291,6 @@ def import_annotation(
|
|
|
311
291
|
Vector keypoint_detection
|
|
312
292
|
Vector vector_annotation
|
|
313
293
|
Vector instance_segmentation
|
|
314
|
-
Pixel instance_segmentation
|
|
315
294
|
============== ======================
|
|
316
295
|
|
|
317
296
|
============== ======================
|
|
@@ -329,7 +308,6 @@ def import_annotation(
|
|
|
329
308
|
--------------------------------------
|
|
330
309
|
project_type task
|
|
331
310
|
============== ======================
|
|
332
|
-
Pixel instance_segmentation
|
|
333
311
|
Vector objcet_detection
|
|
334
312
|
============== ======================
|
|
335
313
|
|
|
@@ -368,15 +346,13 @@ def import_annotation(
|
|
|
368
346
|
:type dataset_format: str
|
|
369
347
|
:param dataset_name: Name of the json file in the input_dir, which should be converted.
|
|
370
348
|
:type dataset_name: str
|
|
371
|
-
:param project_type: SuperAnnotate project type is
|
|
349
|
+
:param project_type: SuperAnnotate project type is 'Vector'
|
|
372
350
|
'Vector' project creates <image_name>___objects.json for each image.
|
|
373
|
-
'Pixel' project creates <image_name>___pixel.jsons and <image_name>___save.png annotation mask for each image.
|
|
374
351
|
:type project_type: str
|
|
375
352
|
:param task: Task can be one of the following: ['panoptic_segmentation', 'instance_segmentation',
|
|
376
353
|
'keypoint_detection', 'object_detection', 'vector_annotation']. (Default: "object_detection").
|
|
377
354
|
'keypoint_detection' can be used to converts keypoints from/to available annotation format.
|
|
378
355
|
'panoptic_segmentation' will use panoptic mask for each image to generate bluemask for SuperAnnotate annotation format and use bluemask to generate panoptic mask for invert conversion. Panoptic masks should be in the input folder.
|
|
379
|
-
'instance_segmentation' 'Pixel' project_type converts instance masks and 'Vector' project_type generates bounding boxes and polygons from instance masks. Masks should be in the input folder if it is 'Pixel' project_type.
|
|
380
356
|
'object_detection' converts objects from/to available annotation format
|
|
381
357
|
'vector_annotation' can be used to convert all annotations (point, ellipse, circule, cuboid and etc) to SuperAnnotate vector project.
|
|
382
358
|
:param images_root: Additonal path to images directory in input_dir
|
|
@@ -427,29 +403,3 @@ def import_annotation(
|
|
|
427
403
|
_passes_converter_sanity(args, "import")
|
|
428
404
|
|
|
429
405
|
import_to_sa(args)
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
@Tracker
|
|
433
|
-
def convert_project_type(
|
|
434
|
-
input_dir: Union[str, Path],
|
|
435
|
-
output_dir: Union[str, Path],
|
|
436
|
-
convert_to: Literal["Vector", "Pixel"],
|
|
437
|
-
):
|
|
438
|
-
"""Converts SuperAnnotate 'Vector' project type to 'Pixel' or reverse.
|
|
439
|
-
|
|
440
|
-
:param input_dir: Path to the dataset folder that you want to convert.
|
|
441
|
-
:type input_dir: Pathlike(str or Path)
|
|
442
|
-
:param output_dir: Path to the folder where you want to have converted files.
|
|
443
|
-
:type output_dir: Pathlike(str or Path)
|
|
444
|
-
:param convert_to: the project type to which the current project should be converted.
|
|
445
|
-
:type convert_to: str
|
|
446
|
-
"""
|
|
447
|
-
params_info = [
|
|
448
|
-
(input_dir, "input_dir", (str, Path)),
|
|
449
|
-
(output_dir, "output_dir", (str, Path)),
|
|
450
|
-
]
|
|
451
|
-
_passes_type_sanity(params_info)
|
|
452
|
-
|
|
453
|
-
input_dir, output_dir = _change_type(input_dir, output_dir)
|
|
454
|
-
|
|
455
|
-
sa_convert_project_type(input_dir, output_dir, convert_to)
|
|
@@ -2,37 +2,23 @@
|
|
|
2
2
|
"""
|
|
3
3
|
import logging
|
|
4
4
|
|
|
5
|
-
from .coco_converters.coco_to_sa_pixel import coco_instance_segmentation_to_sa_pixel
|
|
6
|
-
from .coco_converters.coco_to_sa_pixel import coco_panoptic_segmentation_to_sa_pixel
|
|
7
5
|
from .coco_converters.coco_to_sa_vector import coco_instance_segmentation_to_sa_vector
|
|
8
6
|
from .coco_converters.coco_to_sa_vector import coco_keypoint_detection_to_sa_vector
|
|
9
7
|
from .coco_converters.coco_to_sa_vector import coco_object_detection_to_sa_vector
|
|
10
|
-
from .coco_converters.sa_pixel_to_coco import sa_pixel_to_coco_instance_segmentation
|
|
11
|
-
from .coco_converters.sa_pixel_to_coco import sa_pixel_to_coco_panoptic_segmentation
|
|
12
8
|
from .coco_converters.sa_vector_to_coco import sa_vector_to_coco_instance_segmentation
|
|
13
9
|
from .coco_converters.sa_vector_to_coco import sa_vector_to_coco_keypoint_detection
|
|
14
10
|
from .coco_converters.sa_vector_to_coco import sa_vector_to_coco_object_detection
|
|
15
11
|
from .dataloop_converters.dataloop_to_sa_vector import dataloop_to_sa
|
|
16
12
|
from .googlecloud_converters.googlecloud_to_sa_vector import googlecloud_to_sa_vector
|
|
17
|
-
from .labelbox_converters.labelbox_to_sa_pixel import (
|
|
18
|
-
labelbox_instance_segmentation_to_sa_pixel,
|
|
19
|
-
)
|
|
20
13
|
from .labelbox_converters.labelbox_to_sa_vector import labelbox_to_sa
|
|
21
|
-
from .sagemaker_converters.sagemaker_to_sa_pixel import (
|
|
22
|
-
sagemaker_instance_segmentation_to_sa_pixel,
|
|
23
|
-
)
|
|
24
14
|
from .sagemaker_converters.sagemaker_to_sa_vector import (
|
|
25
15
|
sagemaker_object_detection_to_sa_vector,
|
|
26
16
|
)
|
|
27
|
-
from .supervisely_converters.supervisely_to_sa_pixel import (
|
|
28
|
-
supervisely_instance_segmentation_to_sa_pixel,
|
|
29
|
-
)
|
|
30
17
|
from .supervisely_converters.supervisely_to_sa_vector import (
|
|
31
18
|
supervisely_keypoint_detection_to_sa_vector,
|
|
32
19
|
)
|
|
33
20
|
from .supervisely_converters.supervisely_to_sa_vector import supervisely_to_sa
|
|
34
21
|
from .vgg_converters.vgg_to_sa_vector import vgg_to_sa
|
|
35
|
-
from .voc_converters.voc_to_sa_pixel import voc_instance_segmentation_to_sa_pixel
|
|
36
22
|
from .voc_converters.voc_to_sa_vector import voc_instance_segmentation_to_sa_vector
|
|
37
23
|
from .voc_converters.voc_to_sa_vector import voc_object_detection_to_sa_vector
|
|
38
24
|
from .vott_converters.vott_to_sa_vector import vott_to_sa
|
|
@@ -48,17 +34,12 @@ CONVERSION_ALGORITHMS = {
|
|
|
48
34
|
"instance_segmentation": coco_instance_segmentation_to_sa_vector,
|
|
49
35
|
"object_detection": coco_object_detection_to_sa_vector,
|
|
50
36
|
},
|
|
51
|
-
"Pixel": {
|
|
52
|
-
"panoptic_segmentation": coco_panoptic_segmentation_to_sa_pixel,
|
|
53
|
-
"instance_segmentation": coco_instance_segmentation_to_sa_pixel,
|
|
54
|
-
},
|
|
55
37
|
},
|
|
56
38
|
"VOC": {
|
|
57
39
|
"Vector": {
|
|
58
40
|
"object_detection": voc_object_detection_to_sa_vector,
|
|
59
41
|
"instance_segmentation": voc_instance_segmentation_to_sa_vector,
|
|
60
42
|
},
|
|
61
|
-
"Pixel": {"instance_segmentation": voc_instance_segmentation_to_sa_pixel},
|
|
62
43
|
},
|
|
63
44
|
"LabelBox": {
|
|
64
45
|
"Vector": {
|
|
@@ -66,9 +47,6 @@ CONVERSION_ALGORITHMS = {
|
|
|
66
47
|
"instance_segmentation": labelbox_to_sa,
|
|
67
48
|
"vector_annotation": labelbox_to_sa,
|
|
68
49
|
},
|
|
69
|
-
"Pixel": {
|
|
70
|
-
"instance_segmentation": labelbox_instance_segmentation_to_sa_pixel
|
|
71
|
-
},
|
|
72
50
|
},
|
|
73
51
|
"DataLoop": {
|
|
74
52
|
"Vector": {
|
|
@@ -76,7 +54,6 @@ CONVERSION_ALGORITHMS = {
|
|
|
76
54
|
"instance_segmentation": dataloop_to_sa,
|
|
77
55
|
"vector_annotation": dataloop_to_sa,
|
|
78
56
|
},
|
|
79
|
-
"Pixel": {},
|
|
80
57
|
},
|
|
81
58
|
"Supervisely": {
|
|
82
59
|
"Vector": {
|
|
@@ -85,9 +62,6 @@ CONVERSION_ALGORITHMS = {
|
|
|
85
62
|
"object_detection": supervisely_to_sa,
|
|
86
63
|
"keypoint_detection": supervisely_keypoint_detection_to_sa_vector,
|
|
87
64
|
},
|
|
88
|
-
"Pixel": {
|
|
89
|
-
"instance_segmentation": supervisely_instance_segmentation_to_sa_pixel
|
|
90
|
-
},
|
|
91
65
|
},
|
|
92
66
|
"VoTT": {
|
|
93
67
|
"Vector": {
|
|
@@ -95,13 +69,9 @@ CONVERSION_ALGORITHMS = {
|
|
|
95
69
|
"object_detection": vott_to_sa,
|
|
96
70
|
"vector_annotation": vott_to_sa,
|
|
97
71
|
},
|
|
98
|
-
"Pixel": {},
|
|
99
72
|
},
|
|
100
73
|
"SageMaker": {
|
|
101
74
|
"Vector": {"object_detection": sagemaker_object_detection_to_sa_vector},
|
|
102
|
-
"Pixel": {
|
|
103
|
-
"instance_segmentation": sagemaker_instance_segmentation_to_sa_pixel
|
|
104
|
-
},
|
|
105
75
|
},
|
|
106
76
|
"VGG": {
|
|
107
77
|
"Vector": {
|
|
@@ -109,15 +79,12 @@ CONVERSION_ALGORITHMS = {
|
|
|
109
79
|
"instance_segmentation": vgg_to_sa,
|
|
110
80
|
"vector_annotation": vgg_to_sa,
|
|
111
81
|
},
|
|
112
|
-
"Pixel": {},
|
|
113
82
|
},
|
|
114
83
|
"GoogleCloud": {
|
|
115
84
|
"Vector": {"object_detection": googlecloud_to_sa_vector},
|
|
116
|
-
"Pixel": {},
|
|
117
85
|
},
|
|
118
86
|
"YOLO": {
|
|
119
87
|
"Vector": {"object_detection": yolo_object_detection_to_sa_vector},
|
|
120
|
-
"Pixel": {},
|
|
121
88
|
},
|
|
122
89
|
},
|
|
123
90
|
"to": {
|
|
@@ -127,10 +94,6 @@ CONVERSION_ALGORITHMS = {
|
|
|
127
94
|
"object_detection": sa_vector_to_coco_object_detection,
|
|
128
95
|
"keypoint_detection": sa_vector_to_coco_keypoint_detection,
|
|
129
96
|
},
|
|
130
|
-
"Pixel": {
|
|
131
|
-
"panoptic_segmentation": sa_pixel_to_coco_panoptic_segmentation,
|
|
132
|
-
"instance_segmentation": sa_pixel_to_coco_instance_segmentation,
|
|
133
|
-
},
|
|
134
97
|
},
|
|
135
98
|
},
|
|
136
99
|
}
|
|
@@ -19,7 +19,6 @@ logger = logging.getLogger("sa")
|
|
|
19
19
|
|
|
20
20
|
class CocoBaseStrategy(baseStrategy):
|
|
21
21
|
project_type_to_json_ending = {
|
|
22
|
-
"pixel": "___pixel.json",
|
|
23
22
|
"vector": "___objects.json",
|
|
24
23
|
}
|
|
25
24
|
|
|
@@ -97,8 +96,6 @@ class CocoBaseStrategy(baseStrategy):
|
|
|
97
96
|
"annotatorEmail",
|
|
98
97
|
"qaEmail",
|
|
99
98
|
]
|
|
100
|
-
if project_type == "pixel":
|
|
101
|
-
meta_keys.append("isSegmented")
|
|
102
99
|
|
|
103
100
|
new_json_data["metadata"] = dict.fromkeys(meta_keys)
|
|
104
101
|
|
|
@@ -179,12 +176,6 @@ class CocoBaseStrategy(baseStrategy):
|
|
|
179
176
|
|
|
180
177
|
sa_annotation_json["metadata"]["panoptic_mask"] = panoptic_mask
|
|
181
178
|
|
|
182
|
-
if self.project_type == "Pixel":
|
|
183
|
-
sa_annotation_json["metadata"]["sa_bluemask_path"] = str(
|
|
184
|
-
Path(self.export_root)
|
|
185
|
-
/ (sa_annotation_json["metadata"]["name"] + "___save.png")
|
|
186
|
-
)
|
|
187
|
-
|
|
188
179
|
if not isinstance(
|
|
189
180
|
sa_annotation_json["metadata"].get("height", None), int
|
|
190
181
|
) or not isinstance(sa_annotation_json["metadata"].get("width", None), int):
|
|
@@ -214,34 +205,6 @@ class CocoBaseStrategy(baseStrategy):
|
|
|
214
205
|
|
|
215
206
|
return img_height, img_width
|
|
216
207
|
|
|
217
|
-
def _prepare_single_image_commons_pixel(self, id_, metadata):
|
|
218
|
-
|
|
219
|
-
ImgCommons = namedtuple(
|
|
220
|
-
"ImgCommons", ["image_info", "ann_mask", "sa_bluemask_rgb", "flat_mask"]
|
|
221
|
-
)
|
|
222
|
-
sa_bluemask_path = metadata["sa_bluemask_path"]
|
|
223
|
-
|
|
224
|
-
image_info = self._make_image_info(
|
|
225
|
-
metadata["name"], metadata["height"], metadata["width"], id_
|
|
226
|
-
)
|
|
227
|
-
|
|
228
|
-
sa_bluemask_rgb = np.asarray(
|
|
229
|
-
Image.open(sa_bluemask_path).convert("RGB"), dtype=np.uint32
|
|
230
|
-
)
|
|
231
|
-
|
|
232
|
-
ann_mask = np.zeros(
|
|
233
|
-
(image_info["height"], image_info["width"]), dtype=np.uint32
|
|
234
|
-
)
|
|
235
|
-
flat_mask = (
|
|
236
|
-
(sa_bluemask_rgb[:, :, 0] << 16)
|
|
237
|
-
| (sa_bluemask_rgb[:, :, 1] << 8)
|
|
238
|
-
| (sa_bluemask_rgb[:, :, 2])
|
|
239
|
-
)
|
|
240
|
-
|
|
241
|
-
res = ImgCommons(image_info, ann_mask, sa_bluemask_rgb, flat_mask)
|
|
242
|
-
|
|
243
|
-
return res
|
|
244
|
-
|
|
245
208
|
def _prepare_single_image_commons_vector(self, id_, metadata):
|
|
246
209
|
|
|
247
210
|
ImgCommons = namedtuple("ImgCommons", ["image_info"])
|
|
@@ -256,9 +219,7 @@ class CocoBaseStrategy(baseStrategy):
|
|
|
256
219
|
|
|
257
220
|
def _prepare_single_image_commons(self, id_, metadata):
|
|
258
221
|
res = None
|
|
259
|
-
if self.project_type == "
|
|
260
|
-
res = self._prepare_single_image_commons_pixel(id_, metadata)
|
|
261
|
-
elif self.project_type == "Vector":
|
|
222
|
+
if self.project_type == "Vector":
|
|
262
223
|
res = self._prepare_single_image_commons_vector(id_, metadata)
|
|
263
224
|
return res
|
|
264
225
|
|
|
@@ -302,9 +263,7 @@ class CocoBaseStrategy(baseStrategy):
|
|
|
302
263
|
def make_anno_json_generator(self):
|
|
303
264
|
json_data = None
|
|
304
265
|
|
|
305
|
-
if self.project_type == "
|
|
306
|
-
jsons = list(Path(self.export_root).glob("*pixel.json"))
|
|
307
|
-
elif self.project_type == "Vector":
|
|
266
|
+
if self.project_type == "Vector":
|
|
308
267
|
jsons = list(Path(self.export_root).glob("*objects.json"))
|
|
309
268
|
|
|
310
269
|
self.set_num_total_images(len(jsons))
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""
|
|
2
|
+
COCO to SA conversion method
|
|
3
|
+
"""
|
|
4
|
+
import logging
|
|
5
|
+
|
|
6
|
+
from .coco_api import _maskfrRLE
|
|
7
|
+
from .coco_api import decode
|
|
8
|
+
|
|
9
|
+
logger = logging.getLogger("sa")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def annot_to_bitmask(annot):
|
|
13
|
+
if isinstance(annot["counts"], list):
|
|
14
|
+
bitmask = _maskfrRLE(annot)
|
|
15
|
+
elif isinstance(annot["counts"], str):
|
|
16
|
+
bitmask = decode(annot)
|
|
17
|
+
|
|
18
|
+
return bitmask
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import cv2 as cv
|
|
2
|
+
import numpy as np
|
|
3
|
+
|
|
4
|
+
from .coco_api import _area
|
|
5
|
+
from .coco_api import _toBbox
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def __instance_object_commons_per_instance(instance, id_generator, flat_mask):
|
|
9
|
+
if "parts" not in instance:
|
|
10
|
+
return None
|
|
11
|
+
|
|
12
|
+
anno_id = next(id_generator)
|
|
13
|
+
parts = [int(part["color"][1:], 16) for part in instance["parts"]]
|
|
14
|
+
category_id = instance["classId"]
|
|
15
|
+
|
|
16
|
+
instance_bitmask = np.isin(flat_mask, parts)
|
|
17
|
+
|
|
18
|
+
databytes = instance_bitmask * np.uint8(255)
|
|
19
|
+
contours, _ = cv.findContours(databytes, cv.RETR_EXTERNAL, cv.CHAIN_APPROX_NONE)
|
|
20
|
+
bbox = list(_toBbox(instance_bitmask))
|
|
21
|
+
area = int(_area(instance_bitmask.astype(np.uint8)))
|
|
22
|
+
return (bbox, area, contours, category_id, anno_id)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def instance_object_commons(instances, id_generator, flat_mask):
|
|
26
|
+
commons_lst = [
|
|
27
|
+
__instance_object_commons_per_instance(x, id_generator, flat_mask)
|
|
28
|
+
for x in instances
|
|
29
|
+
]
|
|
30
|
+
commons_lst = [x for x in commons_lst if x is not None]
|
|
31
|
+
return commons_lst
|
|
@@ -9,7 +9,6 @@ from .coco_converters.coco_strategies import CocoObjectDetectionStrategy
|
|
|
9
9
|
from .coco_converters.coco_strategies import CocoPanopticConverterStrategy
|
|
10
10
|
from .dataloop_converters.dataloop_strategies import DataLoopStrategy
|
|
11
11
|
from .googlecloud_converters.googlecloud_strategies import GoogleCloudStrategy
|
|
12
|
-
from .labelbox_converters.labelbox_strategies import LabelBoxStrategy
|
|
13
12
|
from .sagemaker_converters.sagemaker_strategies import SageMakerStrategy
|
|
14
13
|
from .supervisely_converters.supervisely_strategies import SuperviselyStrategy
|
|
15
14
|
from .vgg_converters.vgg_strategies import VGGStrategy
|
|
@@ -44,8 +43,6 @@ class Converter:
|
|
|
44
43
|
c_strategy = DataLoopStrategy(args)
|
|
45
44
|
elif args.dataset_format == "GoogleCloud":
|
|
46
45
|
c_strategy = GoogleCloudStrategy(args)
|
|
47
|
-
elif args.dataset_format == "LabelBox":
|
|
48
|
-
c_strategy = LabelBoxStrategy(args)
|
|
49
46
|
elif args.dataset_format == "SageMaker":
|
|
50
47
|
c_strategy = SageMakerStrategy(args)
|
|
51
48
|
elif args.dataset_format == "Supervisely":
|
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
|
|
3
|
-
import requests
|
|
4
3
|
|
|
5
4
|
logger = logging.getLogger("sa")
|
|
6
5
|
|
|
7
6
|
|
|
8
|
-
def image_downloader(url, file_name):
|
|
9
|
-
r = requests.get(url, stream=True)
|
|
10
|
-
if r.status_code == 200:
|
|
11
|
-
with open(file_name, "wb") as f:
|
|
12
|
-
f.write(r.content)
|
|
13
|
-
return True
|
|
14
|
-
return False
|
|
15
|
-
|
|
16
|
-
|
|
17
7
|
def _create_classes_id_map(json_data):
|
|
18
8
|
classes = {}
|
|
19
9
|
for d in json_data:
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
"""
|
|
2
|
-
"""
|
|
3
|
-
|
|
4
|
-
|
|
5
1
|
def _create_vector_instance(
|
|
6
2
|
instance_type,
|
|
7
3
|
points,
|
|
@@ -54,17 +50,6 @@ def _create_vector_instance(
|
|
|
54
50
|
return sa_instance
|
|
55
51
|
|
|
56
52
|
|
|
57
|
-
def _create_pixel_instance(parts, attributes, class_name=""):
|
|
58
|
-
sa_instance = {
|
|
59
|
-
"attributes": attributes,
|
|
60
|
-
"parts": parts,
|
|
61
|
-
}
|
|
62
|
-
if class_name:
|
|
63
|
-
sa_instance["className"] = class_name
|
|
64
|
-
|
|
65
|
-
return sa_instance
|
|
66
|
-
|
|
67
|
-
|
|
68
53
|
def _create_comment(points, comments):
|
|
69
54
|
sa_comment = {
|
|
70
55
|
"type": "comment",
|
|
@@ -27,13 +27,6 @@ class SuperviselyStrategy(baseStrategy):
|
|
|
27
27
|
sa_jsons = self.conversion_algorithm(
|
|
28
28
|
json_files, classes_id_map, meta_json, self.output_dir
|
|
29
29
|
)
|
|
30
|
-
elif (
|
|
31
|
-
self.conversion_algorithm.__name__
|
|
32
|
-
== "supervisely_instance_segmentation_to_sa_pixel"
|
|
33
|
-
):
|
|
34
|
-
sa_jsons = self.conversion_algorithm(
|
|
35
|
-
json_files, classes_id_map, self.output_dir
|
|
36
|
-
)
|
|
37
30
|
else:
|
|
38
31
|
sa_jsons = self.conversion_algorithm(
|
|
39
32
|
json_files, classes_id_map, self.task, self.output_dir
|