Skip to content

Commit 72ae147

Browse files
authored
Merge pull request #340 from superannotateai/friday
Fix docs
2 parents 6fe3c50 + afa414b commit 72ae147

File tree

1 file changed

+36
-37
lines changed

1 file changed

+36
-37
lines changed

src/superannotate/lib/app/input_converters/conversion.py

Lines changed: 36 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -144,50 +144,49 @@ def export_annotation(
144144
project_type="Vector",
145145
task="object_detection",
146146
):
147+
"""
148+
Converts SuperAnnotate annotation formate to the other annotation formats. Currently available (project_type, task) combinations for converter
149+
presented below:
150+
151+
============== ======================
152+
From SA to COCO
153+
--------------------------------------
154+
project_type task
155+
============== ======================
156+
Pixel panoptic_segmentation
157+
Pixel instance_segmentation
158+
Vector instance_segmentation
159+
Vector object_detection
160+
Vector keypoint_detection
161+
============== ======================
162+
163+
:param input_dir: Path to the dataset folder that you want to convert.
164+
:type input_dir: Pathlike(str or Path)
165+
:param output_dir: Path to the folder, where you want to have converted dataset.
166+
:type output_dir: Pathlike(str or Path)
167+
:param dataset_format: One of the formats that are possible to convert. Available candidates are: ["COCO"]
168+
:type dataset_format: str
169+
:param dataset_name: Will be used to create json file in the output_dir.
170+
:type dataset_name: str
171+
:param project_type: SuperAnnotate project type is either 'Vector' or 'Pixel' (Default: 'Vector')
172+
'Vector' project creates <image_name>___objects.json for each image.
173+
'Pixel' project creates <image_name>___pixel.jsons and <image_name>___save.png annotation mask for each image.
174+
:type project_type: str
175+
:param task: Task can be one of the following: ['panoptic_segmentation', 'instance_segmentation',
176+
'keypoint_detection', 'object_detection']. (Default: "object_detection").
177+
'keypoint_detection' can be used to converts keypoints from/to available annotation format.
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.
179+
'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.
180+
'object_detection' converts objects from/to available annotation format
181+
:type task: str
182+
"""
147183

148184
if project_type in [
149185
ProjectType.VIDEO.name,
150186
ProjectType.DOCUMENT.name,
151187
]:
152188
raise AppException(LIMITED_FUNCTIONS[ProjectType.get_value(project_type)])
153189

154-
"""Converts SuperAnnotate annotation formate to the other annotation formats. Currently available (project_type, task) combinations for converter
155-
presented below:
156-
157-
============== ======================
158-
From SA to COCO
159-
--------------------------------------
160-
project_type task
161-
============== ======================
162-
Pixel panoptic_segmentation
163-
Pixel instance_segmentation
164-
Vector instance_segmentation
165-
Vector object_detection
166-
Vector keypoint_detection
167-
============== ======================
168-
169-
:param input_dir: Path to the dataset folder that you want to convert.
170-
:type input_dir: Pathlike(str or Path)
171-
:param output_dir: Path to the folder, where you want to have converted dataset.
172-
:type output_dir: Pathlike(str or Path)
173-
:param dataset_format: One of the formats that are possible to convert. Available candidates are: ["COCO"]
174-
:type dataset_format: str
175-
:param dataset_name: Will be used to create json file in the output_dir.
176-
:type dataset_name: str
177-
:param project_type: SuperAnnotate project type is either 'Vector' or 'Pixel' (Default: 'Vector')
178-
'Vector' project creates <image_name>___objects.json for each image.
179-
'Pixel' project creates <image_name>___pixel.jsons and <image_name>___save.png annotation mask for each image.
180-
:type project_type: str
181-
:param task: Task can be one of the following: ['panoptic_segmentation', 'instance_segmentation',
182-
'keypoint_detection', 'object_detection']. (Default: "object_detection").
183-
'keypoint_detection' can be used to converts keypoints from/to available annotation format.
184-
'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.
185-
'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.
186-
'object_detection' converts objects from/to available annotation format
187-
:type task: str
188-
189-
"""
190-
191190
params_info = [
192191
(input_dir, "input_dir", (str, Path)),
193192
(output_dir, "output_dir", (str, Path)),

0 commit comments

Comments
 (0)