label-studio-sdk 1.0.11__py3-none-any.whl → 1.0.13__py3-none-any.whl

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.

Potentially problematic release.


This version of label-studio-sdk might be problematic. Click here for more details.

@@ -3,6 +3,7 @@
3
3
  from .types import (
4
4
  AccessTokenResponse,
5
5
  Annotation,
6
+ AnnotationCompletedBy,
6
7
  AnnotationFilterOptions,
7
8
  AnnotationLastAction,
8
9
  AnnotationsDmField,
@@ -85,6 +86,7 @@ from .types import (
85
86
  RedisImportStorageStatus,
86
87
  RefinedPromptResponse,
87
88
  RefinedPromptResponseRefinementStatus,
89
+ RotateTokenResponse,
88
90
  S3ExportStorage,
89
91
  S3ExportStorageStatus,
90
92
  S3ImportStorage,
@@ -200,6 +202,7 @@ __all__ = [
200
202
  "ActionsCreateRequestSelectedItemsExcluded",
201
203
  "ActionsCreateRequestSelectedItemsIncluded",
202
204
  "Annotation",
205
+ "AnnotationCompletedBy",
203
206
  "AnnotationFilterOptions",
204
207
  "AnnotationLastAction",
205
208
  "AnnotationsCreateBulkRequestSelectedItems",
@@ -307,6 +310,7 @@ __all__ = [
307
310
  "RedisImportStorageStatus",
308
311
  "RefinedPromptResponse",
309
312
  "RefinedPromptResponseRefinementStatus",
313
+ "RotateTokenResponse",
310
314
  "S3ExportStorage",
311
315
  "S3ExportStorageStatus",
312
316
  "S3ImportStorage",
@@ -11,13 +11,14 @@ from datetime import datetime
11
11
  from enum import Enum
12
12
  from glob import glob
13
13
  from shutil import copy2
14
- from typing import Optional
14
+ from typing import Optional, List, Tuple
15
15
 
16
16
  import ijson
17
17
  import ujson as json
18
18
  from PIL import Image
19
19
  from label_studio_sdk.converter import brush
20
20
  from label_studio_sdk.converter.audio import convert_to_asr_json_manifest
21
+ from label_studio_sdk.converter.keypoints import process_keypoints_for_coco, build_kp_order, update_categories_for_keypoints, keypoints_in_label_config, get_yolo_categories_for_keypoints
21
22
  from label_studio_sdk.converter.exports import csv2
22
23
  from label_studio_sdk.converter.utils import (
23
24
  parse_config,
@@ -34,6 +35,7 @@ from label_studio_sdk.converter.utils import (
34
35
  convert_annotation_to_yolo_obb,
35
36
  )
36
37
  from label_studio_sdk._extensions.label_studio_tools.core.utils.io import get_local_path
38
+ from label_studio_sdk.converter.exports.yolo import process_and_save_yolo_annotations
37
39
 
38
40
  logger = logging.getLogger(__name__)
39
41
 
@@ -59,6 +61,7 @@ class Format(Enum):
59
61
  YOLO_WITH_IMAGES = 14
60
62
  COCO_WITH_IMAGES = 15
61
63
  YOLO_OBB_WITH_IMAGES = 16
64
+ BRUSH_TO_COCO = 17
62
65
 
63
66
  def __str__(self):
64
67
  return self.name
@@ -108,13 +111,13 @@ class Converter(object):
108
111
  "description": "Popular machine learning format used by the COCO dataset for object detection and image "
109
112
  "segmentation tasks with polygons and rectangles.",
110
113
  "link": "https://labelstud.io/guide/export.html#COCO",
111
- "tags": ["image segmentation", "object detection"],
114
+ "tags": ["image segmentation", "object detection", "keypoints"],
112
115
  },
113
116
  Format.COCO_WITH_IMAGES: {
114
117
  "title": "COCO with Images",
115
118
  "description": "COCO format with images downloaded.",
116
119
  "link": "https://labelstud.io/guide/export.html#COCO",
117
- "tags": ["image segmentation", "object detection"],
120
+ "tags": ["image segmentation", "object detection", "keypoints"],
118
121
  },
119
122
  Format.VOC: {
120
123
  "title": "Pascal VOC XML",
@@ -127,13 +130,13 @@ class Converter(object):
127
130
  "description": "Popular TXT format is created for each image file. Each txt file contains annotations for "
128
131
  "the corresponding image file, that is object class, object coordinates, height & width.",
129
132
  "link": "https://labelstud.io/guide/export.html#YOLO",
130
- "tags": ["image segmentation", "object detection"],
133
+ "tags": ["image segmentation", "object detection", "keypoints"],
131
134
  },
132
135
  Format.YOLO_WITH_IMAGES: {
133
136
  "title": "YOLO with Images",
134
137
  "description": "YOLO format with images downloaded.",
135
138
  "link": "https://labelstud.io/guide/export.html#YOLO",
136
- "tags": ["image segmentation", "object detection"],
139
+ "tags": ["image segmentation", "object detection", "keypoints"],
137
140
  },
138
141
  Format.YOLO_OBB: {
139
142
  "title": "YOLOv8 OBB",
@@ -167,6 +170,13 @@ class Converter(object):
167
170
  "format expected by NVIDIA NeMo models.",
168
171
  "link": "https://labelstud.io/guide/export.html#ASR-MANIFEST",
169
172
  "tags": ["speech recognition"],
173
+ },
174
+ Format.BRUSH_TO_COCO: {
175
+
176
+ "title": "Brush labels to COCO",
177
+ "description": "Export your brush labels as COCO format for segmentation tasks. Converts RLE encoded masks to COCO polygons.",
178
+ "link": "https://labelstud.io/guide/export.html#COCO",
179
+ "tags": ["image segmentation", "brush annotations"],
170
180
  },
171
181
  }
172
182
 
@@ -197,6 +207,7 @@ class Converter(object):
197
207
  self._schema = None
198
208
  self.access_token = access_token
199
209
  self.hostname = hostname
210
+ self.is_keypoints = None
200
211
 
201
212
  if isinstance(config, dict):
202
213
  self._schema = config
@@ -293,6 +304,19 @@ class Converter(object):
293
304
  upload_dir=self.upload_dir,
294
305
  download_resources=self.download_resources,
295
306
  )
307
+ elif format == Format.BRUSH_TO_COCO:
308
+ items = (
309
+ self.iter_from_dir(input_data)
310
+ if is_dir
311
+ else self.iter_from_json_file(input_data)
312
+ )
313
+ from label_studio_sdk.converter.exports.brush_to_coco import convert_to_coco
314
+ image_dir = kwargs.get("image_dir")
315
+ convert_to_coco(
316
+ items,
317
+ output_data,
318
+ output_image_dir=image_dir
319
+ )
296
320
 
297
321
  def _get_data_keys_and_output_tags(self, output_tags=None):
298
322
  data_keys = set()
@@ -355,11 +379,14 @@ class Converter(object):
355
379
  and (
356
380
  "RectangleLabels" in output_tag_types
357
381
  or "PolygonLabels" in output_tag_types
382
+ or "KeyPointLabels" in output_tag_types
358
383
  )
359
384
  or "Rectangle" in output_tag_types
360
385
  and "Labels" in output_tag_types
361
386
  or "PolygonLabels" in output_tag_types
362
387
  and "Labels" in output_tag_types
388
+ or "KeyPointLabels" in output_tag_types
389
+ and "Labels" in output_tag_types
363
390
  ):
364
391
  all_formats.remove(Format.COCO.name)
365
392
  all_formats.remove(Format.COCO_WITH_IMAGES.name)
@@ -376,6 +403,7 @@ class Converter(object):
376
403
  ):
377
404
  all_formats.remove(Format.BRUSH_TO_NUMPY.name)
378
405
  all_formats.remove(Format.BRUSH_TO_PNG.name)
406
+ all_formats.remove(Format.BRUSH_TO_COCO.name)
379
407
  if not (
380
408
  ("Audio" in input_tag_types or "AudioPlus" in input_tag_types)
381
409
  and "TextArea" in output_tag_types
@@ -500,6 +528,9 @@ class Converter(object):
500
528
  if "original_height" in r:
501
529
  v["original_height"] = r["original_height"]
502
530
  outputs[r["from_name"]].append(v)
531
+ if self.is_keypoints:
532
+ v['id'] = r.get('id')
533
+ v['parentID'] = r.get('parentID')
503
534
 
504
535
  data = Converter.get_data(task, outputs, annotation)
505
536
  if "agreement" in task:
@@ -616,6 +647,7 @@ class Converter(object):
616
647
  os.makedirs(output_image_dir, exist_ok=True)
617
648
  images, categories, annotations = [], [], []
618
649
  categories, category_name_to_id = self._get_labels()
650
+ categories, category_name_to_id = update_categories_for_keypoints(categories, category_name_to_id, self._schema)
619
651
  data_key = self._data_keys[0]
620
652
  item_iterator = (
621
653
  self.iter_from_dir(input_data)
@@ -681,9 +713,10 @@ class Converter(object):
681
713
  logger.debug(f'Empty bboxes for {item["output"]}')
682
714
  continue
683
715
 
716
+ keypoint_labels = []
684
717
  for label in labels:
685
718
  category_name = None
686
- for key in ["rectanglelabels", "polygonlabels", "labels"]:
719
+ for key in ["rectanglelabels", "polygonlabels", "keypointlabels", "labels"]:
687
720
  if key in label and len(label[key]) > 0:
688
721
  category_name = label[key][0]
689
722
  break
@@ -753,11 +786,22 @@ class Converter(object):
753
786
  "area": get_polygon_area(x, y),
754
787
  }
755
788
  )
789
+ elif "keypointlabels" in label:
790
+ keypoint_labels.append(label)
756
791
  else:
757
792
  raise ValueError("Unknown label type")
758
793
 
759
794
  if os.getenv("LABEL_STUDIO_FORCE_ANNOTATOR_EXPORT"):
760
795
  annotations[-1].update({"annotator": get_annotator(item)})
796
+ if keypoint_labels:
797
+ kp_order = build_kp_order(self._schema)
798
+ annotations.append(process_keypoints_for_coco(
799
+ keypoint_labels,
800
+ kp_order,
801
+ annotation_id=len(annotations),
802
+ image_id=image_id,
803
+ category_name_to_id=category_name_to_id,
804
+ ))
761
805
 
762
806
  with io.open(output_file, mode="w", encoding="utf8") as fout:
763
807
  json.dump(
@@ -824,7 +868,14 @@ class Converter(object):
824
868
  else:
825
869
  output_label_dir = os.path.join(output_dir, "labels")
826
870
  os.makedirs(output_label_dir, exist_ok=True)
827
- categories, category_name_to_id = self._get_labels()
871
+ is_keypoints = keypoints_in_label_config(self._schema)
872
+
873
+ if is_keypoints:
874
+ # we use this attribute to add id and parentID to annotation data
875
+ self.is_keypoints = True
876
+ categories, category_name_to_id = get_yolo_categories_for_keypoints(self._schema)
877
+ else:
878
+ categories, category_name_to_id = self._get_labels()
828
879
  data_key = self._data_keys[0]
829
880
  item_iterator = (
830
881
  self.iter_from_dir(input_data)
@@ -901,82 +952,7 @@ class Converter(object):
901
952
  pass
902
953
  continue
903
954
 
904
- annotations = []
905
- for label in labels:
906
- category_name = None
907
- category_names = [] # considering multi-label
908
- for key in ["rectanglelabels", "polygonlabels", "labels"]:
909
- if key in label and len(label[key]) > 0:
910
- # change to save multi-label
911
- for category_name in label[key]:
912
- category_names.append(category_name)
913
-
914
- if len(category_names) == 0:
915
- logger.debug(
916
- "Unknown label type or labels are empty: " + str(label)
917
- )
918
- continue
919
-
920
- for category_name in category_names:
921
- if category_name not in category_name_to_id:
922
- category_id = len(categories)
923
- category_name_to_id[category_name] = category_id
924
- categories.append({"id": category_id, "name": category_name})
925
- category_id = category_name_to_id[category_name]
926
-
927
- if (
928
- "rectanglelabels" in label
929
- or "rectangle" in label
930
- or "labels" in label
931
- ):
932
- # yolo obb
933
- if is_obb:
934
- obb_annotation = convert_annotation_to_yolo_obb(label)
935
- if obb_annotation is None:
936
- continue
937
-
938
- top_left, top_right, bottom_right, bottom_left = (
939
- obb_annotation
940
- )
941
- x1, y1 = top_left
942
- x2, y2 = top_right
943
- x3, y3 = bottom_right
944
- x4, y4 = bottom_left
945
- annotations.append(
946
- [category_id, x1, y1, x2, y2, x3, y3, x4, y4]
947
- )
948
-
949
- # simple yolo
950
- else:
951
- annotation = convert_annotation_to_yolo(label)
952
- if annotation is None:
953
- continue
954
-
955
- (
956
- x,
957
- y,
958
- w,
959
- h,
960
- ) = annotation
961
- annotations.append([category_id, x, y, w, h])
962
-
963
- elif "polygonlabels" in label or "polygon" in label:
964
- if not ('points' in label):
965
- continue
966
- points_abs = [(x / 100, y / 100) for x, y in label["points"]]
967
- annotations.append(
968
- [category_id]
969
- + [coord for point in points_abs for coord in point]
970
- )
971
- else:
972
- raise ValueError(f"Unknown label type {label}")
973
- with open(label_path, "w") as f:
974
- for annotation in annotations:
975
- for idx, l in enumerate(annotation):
976
- if idx == len(annotation) - 1:
977
- f.write(f"{l}\n")
978
- else:
979
- f.write(f"{l} ")
955
+ categories, category_name_to_id = process_and_save_yolo_annotations(labels, label_path, category_name_to_id, categories, is_obb, is_keypoints, self._schema)
980
956
  with open(class_file, "w", encoding="utf8") as f:
981
957
  for c in categories:
982
958
  f.write(c["name"] + "\n")
@@ -0,0 +1,332 @@
1
+ """
2
+ Convert brush annotations and polygon annotations to COCO format.
3
+ This module handles RLE encoded brush masks and converts them to COCO segmentation format.
4
+ """
5
+ import logging
6
+ import random
7
+ import io
8
+ import os
9
+ import json
10
+ import numpy as np
11
+ import cv2
12
+ from copy import deepcopy
13
+ from datetime import datetime
14
+
15
+ from label_studio_sdk.converter.utils import ensure_dir, get_annotator
16
+ import label_studio_sdk.converter.brush as brush_module
17
+
18
+ logger = logging.getLogger(__name__)
19
+
20
+
21
+ def generate_random_color():
22
+ """Generates a random hex color for category visualization"""
23
+ return '#{:02x}{:02x}{:02x}'.format(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
24
+
25
+
26
+ def flatten(item):
27
+ """Flatten nested lists for segmentation format"""
28
+ if isinstance(item, list):
29
+ for subitem in item:
30
+ yield from flatten(subitem)
31
+ else:
32
+ yield item
33
+
34
+
35
+ def generate_contour_from_rle(rle, original_width, original_height):
36
+ """Convert RLE encoded masks to COCO segmentation format
37
+
38
+ Args:
39
+ rle: RLE encoded mask data
40
+ original_width: Width of the original image
41
+ original_height: Height of the original image
42
+
43
+ Returns:
44
+ tuple: (segmentation, bbox_list, area_list) in COCO format
45
+ """
46
+ # Ensure rle is bytes, not string
47
+ if isinstance(rle, str):
48
+ rle = rle.encode('utf-8')
49
+
50
+ # Decode RLE
51
+ try:
52
+ rle_binary = brush_module.decode_rle(rle)
53
+ except Exception as e:
54
+ logger.warning(f"Failed to decode RLE: {e}")
55
+ return [], [], []
56
+
57
+ # Reshape to image dimensions with 4 channels (RGBA)
58
+ try:
59
+ reshaped_image = np.reshape(rle_binary, [original_height, original_width, 4])
60
+ except Exception as e:
61
+ logger.warning(f"Failed to reshape RLE data: {e}")
62
+ return [], [], []
63
+
64
+ # Use only the alpha channel for contour detection
65
+ alpha_channel = np.array(reshaped_image[:, :, 3]).astype('uint8')
66
+
67
+ # Find contours
68
+ contours, _ = cv2.findContours(
69
+ alpha_channel, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE
70
+ )
71
+
72
+ segmentation = []
73
+ bbox_list = []
74
+ area_list = []
75
+ for contour in contours:
76
+ # OpenCV contours are in format [[[x1,y1]], [[x2,y2]], ...],
77
+ # we need to convert to a flat list [x1,y1,x2,y2,...]
78
+ contour_points = [point[0] for point in contour]
79
+
80
+ # Flatten to a single list
81
+ contour_flat = []
82
+ for point in contour_points:
83
+ contour_flat.extend(point.tolist())
84
+
85
+ # Check if we have at least 3 points (6 coordinates) for a valid polygon
86
+ if len(contour_points) >= 3:
87
+ segmentation.append(contour_flat)
88
+
89
+ x, y, w, h = cv2.boundingRect(contour)
90
+ bbox_list.append([x, y, w, h]) # Format: [top-left x, top-left y, width, height]
91
+
92
+ # Compute the area of the contour
93
+ area = cv2.contourArea(contour)
94
+ area_list.append(int(area))
95
+
96
+ return segmentation, bbox_list, area_list
97
+
98
+
99
+ def generate_contour_from_polygon(points, original_width, original_height):
100
+ """Convert polygon annotations to COCO segmentation format
101
+
102
+ Args:
103
+ points: List of [x, y] points in percentage format
104
+ original_width: Width of the original image
105
+ original_height: Height of the original image
106
+
107
+ Returns:
108
+ tuple: (segmentation, bbox, area) in COCO format
109
+ """
110
+ # Convert from percentage to absolute coordinates
111
+ modified_points = [
112
+ [round(x * original_width / 100), round(y * original_height / 100)]
113
+ for x, y in points
114
+ ]
115
+
116
+ # Initialize lists
117
+ segmentation = [list(flatten(modified_points))]
118
+
119
+ # Convert points to a NumPy array and reshape for OpenCV
120
+ contour = np.array(modified_points, dtype=np.float32).reshape((-1, 1, 2))
121
+
122
+ # Calculate bounding box
123
+ bbox = cv2.boundingRect(contour)
124
+ bbox = [int(coordinate) for coordinate in bbox]
125
+
126
+ # Compute the area of the contour
127
+ area = cv2.contourArea(contour)
128
+
129
+ return segmentation, bbox, int(area)
130
+
131
+
132
+ def convert_to_coco(items, output_dir, output_image_dir=None):
133
+ """Convert Label Studio annotations to COCO format
134
+
135
+ Args:
136
+ items: Iterable of annotation items
137
+ output_dir: Directory where to save the resulting COCO JSON
138
+ output_image_dir: Optional directory for images
139
+
140
+ Returns:
141
+ Path to the generated COCO JSON file
142
+ """
143
+ ensure_dir(output_dir)
144
+ output_file = os.path.join(output_dir, "result_coco.json")
145
+
146
+ if output_image_dir is not None:
147
+ ensure_dir(output_image_dir)
148
+ else:
149
+ output_image_dir = os.path.join(output_dir, "images")
150
+ os.makedirs(output_image_dir, exist_ok=True)
151
+
152
+ # Initialize COCO JSON structure
153
+ coco_data = {
154
+ 'images': [],
155
+ 'annotations': [],
156
+ 'categories': [],
157
+ 'info': {
158
+ 'year': datetime.now().year,
159
+ 'version': '1.0',
160
+ 'description': 'Converted from Label Studio',
161
+ 'contributor': 'Label Studio Converter',
162
+ 'date_created': str(datetime.now()),
163
+ }
164
+ }
165
+
166
+ category_map = {} # To track unique categories
167
+ annotation_id = 0
168
+
169
+ # Process each item
170
+ for image_id, item in enumerate(items):
171
+ # Extract image information
172
+ image_path = None
173
+ for key, value in item['input'].items():
174
+ if isinstance(value, str) and any(value.lower().endswith(ext) for ext in ['.jpg', '.jpeg', '.png', '.gif', '.bmp']):
175
+ image_path = value
176
+ break
177
+
178
+ if not image_path:
179
+ logger.warning(f"No image path found for item {item.get('id')}. Skipping.")
180
+ continue
181
+
182
+ image_info = {
183
+ 'id': image_id,
184
+ 'file_name': os.path.basename(image_path),
185
+ 'path': image_path,
186
+ 'width': None, # Will be filled from annotations
187
+ 'height': None # Will be filled from annotations
188
+ }
189
+
190
+ # Skip tasks without annotations
191
+ if not item['output']:
192
+ logger.warning(f"No annotations found for item {item.get('id')}")
193
+ continue
194
+
195
+ valid_annotations = False
196
+
197
+ # Process all annotations
198
+ for output_key, annotations in item['output'].items():
199
+ for annotation in annotations:
200
+ # Get image dimensions from the first annotation
201
+ if image_info['width'] is None and 'original_width' in annotation:
202
+ image_info['width'] = annotation['original_width']
203
+ image_info['height'] = annotation['original_height']
204
+
205
+ # Identify annotation type and extract labels
206
+ annotation_type = annotation.get('type', '').lower()
207
+ labels = []
208
+
209
+ if 'brushlabels' in annotation:
210
+ labels = annotation['brushlabels']
211
+ type_key = 'brushlabels'
212
+ elif 'polygonlabels' in annotation:
213
+ labels = annotation['polygonlabels']
214
+ type_key = 'polygonlabels'
215
+ elif 'rectanglelabels' in annotation:
216
+ labels = annotation['rectanglelabels']
217
+ type_key = 'rectanglelabels'
218
+ elif 'labels' in annotation:
219
+ labels = annotation['labels']
220
+ type_key = 'labels'
221
+ else:
222
+ logger.debug(f"Unsupported annotation type: {annotation_type}")
223
+ continue
224
+
225
+ # Process each label
226
+ for label in labels:
227
+ # Add new categories to the map
228
+ if label not in category_map:
229
+ category_id = len(category_map) + 1
230
+ category_map[label] = category_id
231
+ coco_data['categories'].append({
232
+ 'id': category_id,
233
+ 'name': label,
234
+ 'supercategory': '',
235
+ 'color': generate_random_color(),
236
+ 'metadata': {}
237
+ })
238
+
239
+ category_id = category_map[label]
240
+
241
+ # Convert annotation based on type
242
+ if 'rle' in annotation and type_key == 'brushlabels':
243
+
244
+ # check required keys exist
245
+ if not all(k in annotation for k in ['rle', 'original_width', 'original_height']):
246
+ logger.warning(f"Missing required keys for RLE annotation. Skipping.")
247
+ continue
248
+
249
+ # Process brush annotation (RLE encoded mask)
250
+ segmentations, bboxes, areas = generate_contour_from_rle(
251
+ annotation['rle'],
252
+ annotation['original_width'],
253
+ annotation['original_height']
254
+ )
255
+
256
+ # Create separate annotation for each contour
257
+ for i, (segmentation, bbox, area) in enumerate(zip(segmentations, bboxes, areas)):
258
+ coco_annotation = {
259
+ 'id': annotation_id,
260
+ 'image_id': image_id,
261
+ 'category_id': category_id,
262
+ 'segmentation': [segmentation], # COCO format requires double nesting
263
+ 'area': area,
264
+ 'bbox': bbox,
265
+ 'iscrowd': 0,
266
+ 'annotator': get_annotator(item, "unknown")
267
+ }
268
+ coco_data['annotations'].append(coco_annotation)
269
+ annotation_id += 1
270
+ valid_annotations = True
271
+
272
+ elif 'points' in annotation and type_key == 'polygonlabels':
273
+ # check required keys exist
274
+ if not all(k in annotation for k in ['points', 'original_width', 'original_height']):
275
+ logger.warning(f"Missing required keys for polygon annotation. Skipping.")
276
+ continue
277
+ # Process polygon annotation
278
+ segmentation, bbox, area = generate_contour_from_polygon(
279
+ annotation['points'],
280
+ annotation['original_width'],
281
+ annotation['original_height']
282
+ )
283
+
284
+ coco_annotation = {
285
+ 'id': annotation_id,
286
+ 'image_id': image_id,
287
+ 'category_id': category_id,
288
+ 'segmentation': segmentation,
289
+ 'area': area,
290
+ 'bbox': bbox,
291
+ 'iscrowd': 0,
292
+ 'annotator': get_annotator(item, "unknown")
293
+ }
294
+ coco_data['annotations'].append(coco_annotation)
295
+ annotation_id += 1
296
+ valid_annotations = True
297
+
298
+ elif annotation_type == 'rectanglelabels' or type_key == 'labels':
299
+ # check required keys exist
300
+ if not all(k in annotation for k in ['x', 'y', 'width', 'height', 'original_width', 'original_height']):
301
+ logger.warning(f"Missing required keys for rectangle annotation. Skipping.")
302
+ continue
303
+
304
+ # Convert from percentage to absolute coordinates
305
+ x = annotation['x'] * annotation['original_width'] / 100
306
+ y = annotation['y'] * annotation['original_height'] / 100
307
+ w = annotation['width'] * annotation['original_width'] / 100
308
+ h = annotation['height'] * annotation['original_height'] / 100
309
+
310
+ coco_annotation = {
311
+ 'id': annotation_id,
312
+ 'image_id': image_id,
313
+ 'category_id': category_id,
314
+ 'segmentation': [], # Empty for bounding boxes
315
+ 'area': w * h,
316
+ 'bbox': [x, y, w, h],
317
+ 'iscrowd': 0,
318
+ 'annotator': get_annotator(item, "unknown")
319
+ }
320
+ coco_data['annotations'].append(coco_annotation)
321
+ annotation_id += 1
322
+ valid_annotations = True
323
+
324
+ # Add image to the dataset if it has valid dimensions
325
+ if image_info['width'] is not None and image_info['height'] is not None and valid_annotations:
326
+ coco_data['images'].append(image_info)
327
+
328
+ # Write COCO JSON to file
329
+ with io.open(output_file, 'w', encoding='utf8') as f:
330
+ json.dump(coco_data, f, indent=2, ensure_ascii=False)
331
+
332
+ return output_file
@@ -0,0 +1,149 @@
1
+ import logging
2
+ from label_studio_sdk.converter.utils import convert_annotation_to_yolo, convert_annotation_to_yolo_obb
3
+ from label_studio_sdk.converter.keypoints import build_kp_order
4
+
5
+ logger = logging.getLogger(__name__)
6
+
7
+ def process_keypoints_for_yolo(labels, label_path,
8
+ category_name_to_id, categories,
9
+ is_obb, kp_order):
10
+ class_map = {c['name']: c['id'] for c in categories}
11
+
12
+ rectangles = {}
13
+ for item in labels:
14
+ if item['type'].lower() == 'rectanglelabels':
15
+ bbox_id = item['id']
16
+ cls_name = item['rectanglelabels'][0]
17
+ cls_idx = class_map.get(cls_name)
18
+ if cls_idx is None:
19
+ continue
20
+
21
+ x = item['x'] / 100.0
22
+ y = item['y'] / 100.0
23
+ width = item['width'] / 100.0
24
+ height = item['height'] / 100.0
25
+ x_c = x + width / 2.0
26
+ y_c = y + height / 2.0
27
+
28
+ rectangles[bbox_id] = {
29
+ 'class_idx': cls_idx,
30
+ 'x_center': x_c,
31
+ 'y_center': y_c,
32
+ 'width': width,
33
+ 'height': height,
34
+ 'kp_dict': {}
35
+ }
36
+
37
+ for item in labels:
38
+ if item['type'].lower() == 'keypointlabels':
39
+ parent_id = item.get('parentID')
40
+ if parent_id not in rectangles:
41
+ continue
42
+ label_name = item['keypointlabels'][0]
43
+ kp_x = item['x'] / 100.0
44
+ kp_y = item['y'] / 100.0
45
+ rectangles[parent_id]['kp_dict'][label_name] = (kp_x, kp_y, 2) # 2 = visible
46
+
47
+ lines = []
48
+ for rect in rectangles.values():
49
+ base = [
50
+ rect['class_idx'],
51
+ rect['x_center'],
52
+ rect['y_center'],
53
+ rect['width'],
54
+ rect['height']
55
+ ]
56
+ keypoints = []
57
+ for k in kp_order:
58
+ keypoints.extend(rect['kp_dict'].get(k, (0.0, 0.0, 0)))
59
+ line = ' '.join(map(str, base + keypoints))
60
+ lines.append(line)
61
+
62
+ with open(label_path, 'w', encoding='utf-8') as f:
63
+ f.write('\n'.join(lines))
64
+
65
+
66
+ def process_and_save_yolo_annotations(labels, label_path, category_name_to_id, categories, is_obb, is_keypoints, label_config):
67
+ if is_keypoints:
68
+ kp_order = build_kp_order(label_config)
69
+ process_keypoints_for_yolo(labels, label_path, category_name_to_id, categories, is_obb, kp_order)
70
+ return categories, category_name_to_id
71
+
72
+ annotations = []
73
+ for label in labels:
74
+ category_name = None
75
+ category_names = [] # considering multi-label
76
+ for key in ["rectanglelabels", "polygonlabels", "labels"]:
77
+ if key in label and len(label[key]) > 0:
78
+ # change to save multi-label
79
+ for category_name in label[key]:
80
+ category_names.append(category_name)
81
+
82
+ if len(category_names) == 0:
83
+ logger.debug(
84
+ "Unknown label type or labels are empty: " + str(label)
85
+ )
86
+ continue
87
+
88
+ for category_name in category_names:
89
+ if category_name not in category_name_to_id:
90
+ category_id = len(categories)
91
+ category_name_to_id[category_name] = category_id
92
+ categories.append({"id": category_id, "name": category_name})
93
+ category_id = category_name_to_id[category_name]
94
+
95
+ if (
96
+ "rectanglelabels" in label
97
+ or "rectangle" in label
98
+ or "labels" in label
99
+ ):
100
+ # yolo obb
101
+ if is_obb:
102
+ obb_annotation = convert_annotation_to_yolo_obb(label)
103
+ if obb_annotation is None:
104
+ continue
105
+
106
+ top_left, top_right, bottom_right, bottom_left = (
107
+ obb_annotation
108
+ )
109
+ x1, y1 = top_left
110
+ x2, y2 = top_right
111
+ x3, y3 = bottom_right
112
+ x4, y4 = bottom_left
113
+ annotations.append(
114
+ [category_id, x1, y1, x2, y2, x3, y3, x4, y4]
115
+ )
116
+
117
+ # simple yolo
118
+ else:
119
+ annotation = convert_annotation_to_yolo(label)
120
+ if annotation is None:
121
+ continue
122
+
123
+ (
124
+ x,
125
+ y,
126
+ w,
127
+ h,
128
+ ) = annotation
129
+ annotations.append([category_id, x, y, w, h])
130
+
131
+ elif "polygonlabels" in label or "polygon" in label:
132
+ if not ('points' in label):
133
+ continue
134
+ points_abs = [(x / 100, y / 100) for x, y in label["points"]]
135
+ annotations.append(
136
+ [category_id]
137
+ + [coord for point in points_abs for coord in point]
138
+ )
139
+ else:
140
+ raise ValueError(f"Unknown label type {label}")
141
+ with open(label_path, "w") as f:
142
+ for annotation in annotations:
143
+ for idx, l in enumerate(annotation):
144
+ if idx == len(annotation) - 1:
145
+ f.write(f"{l}\n")
146
+ else:
147
+ f.write(f"{l} ")
148
+
149
+ return categories, category_name_to_id
@@ -0,0 +1,146 @@
1
+ import os
2
+ import json
3
+
4
+
5
+ def keypoints_in_label_config(label_config):
6
+ """
7
+ Check if the label config contains keypoints.
8
+ :param label_config: Label config in JSON format.
9
+ :return: True if keypoints are present, False otherwise.
10
+ """
11
+ for cfg in label_config.values():
12
+ if cfg.get("type") == "KeyPointLabels":
13
+ return True
14
+ return False
15
+
16
+
17
+ def update_categories_for_keypoints(categories, category_name_to_id, label_config):
18
+ keypoint_labels = []
19
+ for cfg in label_config.values():
20
+ if cfg.get("type") == "KeyPointLabels":
21
+ keypoint_labels.extend(cfg.get("labels", []))
22
+ keypoint_labels = list(dict.fromkeys(keypoint_labels))
23
+
24
+ non_kp = [cat.copy() for cat in categories if cat["name"] not in keypoint_labels]
25
+
26
+ new_categories = []
27
+ new_mapping = {}
28
+ next_id = 0
29
+ for cat in non_kp:
30
+ cat["id"] = next_id
31
+ new_categories.append(cat)
32
+ new_mapping[cat["name"]] = next_id
33
+ next_id += 1
34
+
35
+ if keypoint_labels:
36
+ merged_id = next_id
37
+ merged_category = {
38
+ "id": merged_id,
39
+ "name": "default",
40
+ "supercategory": "default",
41
+ "keypoints": keypoint_labels,
42
+ "skeleton": []
43
+ }
44
+ new_categories.append(merged_category)
45
+ for kp_name in keypoint_labels:
46
+ new_mapping[kp_name] = merged_id
47
+
48
+ return new_categories, new_mapping
49
+
50
+
51
+ def build_kp_order(label_config):
52
+ kp_block = {}
53
+
54
+ for tag in label_config.values():
55
+ if tag.get("type") == "KeyPointLabels":
56
+ kp_block.update(tag.get("labels_attrs", {}))
57
+
58
+ pairs, used = [], set()
59
+
60
+ for name, attrs in kp_block.items():
61
+ try:
62
+ idx = int(attrs.get("model_index"))
63
+ except (TypeError, ValueError):
64
+ continue
65
+ if idx in used:
66
+ continue
67
+ pairs.append((idx, name))
68
+ used.add(idx)
69
+
70
+ pairs.sort(key=lambda p: p[0])
71
+ result = [name for _, name in pairs]
72
+ return result
73
+
74
+
75
+ def get_bbox_coco(keypoints, kp_order):
76
+ xs = [keypoints[3*i] for i in range(len(kp_order)) if keypoints[3*i + 2] > 0]
77
+ ys = [keypoints[3*i + 1] for i in range(len(kp_order)) if keypoints[3*i + 2] > 0]
78
+ if xs and ys:
79
+ x_min = min(xs)
80
+ y_min = min(ys)
81
+ x_max = max(xs)
82
+ y_max = max(ys)
83
+ width = x_max - x_min
84
+ height = y_max - y_min
85
+ bbox = [x_min, y_min, width, height]
86
+ else:
87
+ bbox = [0, 0, 0, 0]
88
+ return bbox
89
+
90
+
91
+ def process_keypoints_for_coco(keypoint_labels, kp_order, annotation_id, image_id, category_name_to_id):
92
+ keypoints = [0] * (len(kp_order) * 3)
93
+
94
+ for kp in keypoint_labels:
95
+ width, height = kp["original_width"], kp["original_height"]
96
+ x, y = kp['x'] / 100 * width, kp['y'] / 100 * height
97
+ labels = kp.get('keypointlabels', [])
98
+ v = 2 if labels else 0
99
+ for label in labels:
100
+ if label in kp_order:
101
+ idx = kp_order.index(label)
102
+ keypoints[3 * idx] = int(round(x))
103
+ keypoints[3 * idx + 1] = int(round(y))
104
+ keypoints[3 * idx + 2] = v
105
+
106
+ num_keypoints = sum(1 for i in range(len(kp_order)) if keypoints[3*i + 2] > 0)
107
+
108
+ bbox = get_bbox_coco(keypoints, kp_order)
109
+
110
+ category_id = category_name_to_id.get(kp_order[0], 0)
111
+ annotation = {
112
+ 'id': annotation_id,
113
+ 'image_id': image_id,
114
+ 'category_id': category_id,
115
+ 'keypoints': keypoints,
116
+ 'num_keypoints': num_keypoints,
117
+ 'bbox': bbox,
118
+ 'iscrowd': 0
119
+ }
120
+ return annotation
121
+
122
+
123
+ def get_yolo_categories_for_keypoints(label_config):
124
+ # Get all keypoint labels from the label config
125
+ keypoint_labels = []
126
+ for cfg in label_config.values():
127
+ if cfg.get("type") == "KeyPointLabels":
128
+ keypoint_labels.extend(cfg.get("labels", []))
129
+ keypoint_labels = list(dict.fromkeys(keypoint_labels)) # Remove duplicates
130
+
131
+ # Get all rectangle labels from the label config
132
+ rectangle_labels = []
133
+ for cfg in label_config.values():
134
+ if cfg.get("type") == "RectangleLabels":
135
+ rectangle_labels.extend(cfg.get("labels", []))
136
+ rectangle_labels = list(dict.fromkeys(rectangle_labels)) # Remove duplicates
137
+
138
+ # Create categories for each rectangle label
139
+ categories = []
140
+ category_name_to_id = {}
141
+
142
+ for i, label in enumerate(rectangle_labels):
143
+ categories.append({"id": i, "name": label, "keypoints": keypoint_labels})
144
+ category_name_to_id[label] = i
145
+
146
+ return categories, category_name_to_id
@@ -79,6 +79,12 @@ def get_export_args(parser):
79
79
  default=True,
80
80
  help="Set this flag if your annotations are in one JSON file instead of multiple JSON files from directory",
81
81
  )
82
+ parser.add_argument(
83
+ "--brush-to-coco",
84
+ dest="brush_to_coco",
85
+ action="store_true",
86
+ help="If set, brush annotations will be converted to COCO format"
87
+ )
82
88
 
83
89
 
84
90
  def get_all_args():
@@ -158,6 +164,14 @@ def export(args):
158
164
  c.convert_to_yolo(
159
165
  args.input, args.output, is_dir=not args.heartex_format, is_obb=True
160
166
  )
167
+ elif args.format == Format.BRUSH_TO_COCO:
168
+ c.convert(
169
+ args.input,
170
+ args.output,
171
+ Format.BRUSH_TO_COCO,
172
+ output_image_dir=args.image_dir,
173
+ is_dir=not args.heartex_format,
174
+ )
161
175
  else:
162
176
  raise FormatNotSupportedError()
163
177
 
@@ -19,7 +19,7 @@ class JwtSettingsClient:
19
19
 
20
20
  def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> JwtSettingsResponse:
21
21
  """
22
- Retrieve JWT settings for the currently active organization.
22
+ Retrieve JWT settings for the currently-active organization.
23
23
 
24
24
  Parameters
25
25
  ----------
@@ -134,7 +134,7 @@ class AsyncJwtSettingsClient:
134
134
 
135
135
  async def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> JwtSettingsResponse:
136
136
  """
137
- Retrieve JWT settings for the currently active organization.
137
+ Retrieve JWT settings for the currently-active organization.
138
138
 
139
139
  Parameters
140
140
  ----------
@@ -10,6 +10,8 @@ from ..core.api_error import ApiError
10
10
  from ..types.api_token_response import ApiTokenResponse
11
11
  from ..types.access_token_response import AccessTokenResponse
12
12
  from ..errors.unauthorized_error import UnauthorizedError
13
+ from ..types.rotate_token_response import RotateTokenResponse
14
+ from ..errors.bad_request_error import BadRequestError
13
15
  from ..core.client_wrapper import AsyncClientWrapper
14
16
 
15
17
  # this is used as the default value for optional parameters
@@ -225,6 +227,70 @@ class TokensClient:
225
227
  raise ApiError(status_code=_response.status_code, body=_response.text)
226
228
  raise ApiError(status_code=_response.status_code, body=_response_json)
227
229
 
230
+ def rotate(self, *, refresh: str, request_options: typing.Optional[RequestOptions] = None) -> RotateTokenResponse:
231
+ """
232
+ Blacklist existing refresh token, and get a new refresh token.
233
+
234
+ Parameters
235
+ ----------
236
+ refresh : str
237
+ JWT refresh token
238
+
239
+ request_options : typing.Optional[RequestOptions]
240
+ Request-specific configuration.
241
+
242
+ Returns
243
+ -------
244
+ RotateTokenResponse
245
+ Refresh token successfully rotated
246
+
247
+ Examples
248
+ --------
249
+ from label_studio_sdk import LabelStudio
250
+
251
+ client = LabelStudio(
252
+ api_key="YOUR_API_KEY",
253
+ )
254
+ client.tokens.rotate(
255
+ refresh="refresh",
256
+ )
257
+ """
258
+ _response = self._client_wrapper.httpx_client.request(
259
+ "api/token/rotate",
260
+ method="POST",
261
+ json={
262
+ "refresh": refresh,
263
+ },
264
+ headers={
265
+ "content-type": "application/json",
266
+ },
267
+ request_options=request_options,
268
+ omit=OMIT,
269
+ )
270
+ try:
271
+ if 200 <= _response.status_code < 300:
272
+ return typing.cast(
273
+ RotateTokenResponse,
274
+ parse_obj_as(
275
+ type_=RotateTokenResponse, # type: ignore
276
+ object_=_response.json(),
277
+ ),
278
+ )
279
+ if _response.status_code == 400:
280
+ raise BadRequestError(
281
+ typing.cast(
282
+ typing.Optional[typing.Any],
283
+ parse_obj_as(
284
+ type_=typing.Optional[typing.Any], # type: ignore
285
+ object_=_response.json(),
286
+ ),
287
+ )
288
+ )
289
+ _response_json = _response.json()
290
+ except JSONDecodeError:
291
+ raise ApiError(status_code=_response.status_code, body=_response.text)
292
+ raise ApiError(status_code=_response.status_code, body=_response_json)
293
+
228
294
 
229
295
  class AsyncTokensClient:
230
296
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -468,3 +534,77 @@ class AsyncTokensClient:
468
534
  except JSONDecodeError:
469
535
  raise ApiError(status_code=_response.status_code, body=_response.text)
470
536
  raise ApiError(status_code=_response.status_code, body=_response_json)
537
+
538
+ async def rotate(
539
+ self, *, refresh: str, request_options: typing.Optional[RequestOptions] = None
540
+ ) -> RotateTokenResponse:
541
+ """
542
+ Blacklist existing refresh token, and get a new refresh token.
543
+
544
+ Parameters
545
+ ----------
546
+ refresh : str
547
+ JWT refresh token
548
+
549
+ request_options : typing.Optional[RequestOptions]
550
+ Request-specific configuration.
551
+
552
+ Returns
553
+ -------
554
+ RotateTokenResponse
555
+ Refresh token successfully rotated
556
+
557
+ Examples
558
+ --------
559
+ import asyncio
560
+
561
+ from label_studio_sdk import AsyncLabelStudio
562
+
563
+ client = AsyncLabelStudio(
564
+ api_key="YOUR_API_KEY",
565
+ )
566
+
567
+
568
+ async def main() -> None:
569
+ await client.tokens.rotate(
570
+ refresh="refresh",
571
+ )
572
+
573
+
574
+ asyncio.run(main())
575
+ """
576
+ _response = await self._client_wrapper.httpx_client.request(
577
+ "api/token/rotate",
578
+ method="POST",
579
+ json={
580
+ "refresh": refresh,
581
+ },
582
+ headers={
583
+ "content-type": "application/json",
584
+ },
585
+ request_options=request_options,
586
+ omit=OMIT,
587
+ )
588
+ try:
589
+ if 200 <= _response.status_code < 300:
590
+ return typing.cast(
591
+ RotateTokenResponse,
592
+ parse_obj_as(
593
+ type_=RotateTokenResponse, # type: ignore
594
+ object_=_response.json(),
595
+ ),
596
+ )
597
+ if _response.status_code == 400:
598
+ raise BadRequestError(
599
+ typing.cast(
600
+ typing.Optional[typing.Any],
601
+ parse_obj_as(
602
+ type_=typing.Optional[typing.Any], # type: ignore
603
+ object_=_response.json(),
604
+ ),
605
+ )
606
+ )
607
+ _response_json = _response.json()
608
+ except JSONDecodeError:
609
+ raise ApiError(status_code=_response.status_code, body=_response.text)
610
+ raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -2,6 +2,7 @@
2
2
 
3
3
  from .access_token_response import AccessTokenResponse
4
4
  from .annotation import Annotation
5
+ from .annotation_completed_by import AnnotationCompletedBy
5
6
  from .annotation_filter_options import AnnotationFilterOptions
6
7
  from .annotation_last_action import AnnotationLastAction
7
8
  from .annotations_dm_field import AnnotationsDmField
@@ -84,6 +85,7 @@ from .redis_import_storage import RedisImportStorage
84
85
  from .redis_import_storage_status import RedisImportStorageStatus
85
86
  from .refined_prompt_response import RefinedPromptResponse
86
87
  from .refined_prompt_response_refinement_status import RefinedPromptResponseRefinementStatus
88
+ from .rotate_token_response import RotateTokenResponse
87
89
  from .s3export_storage import S3ExportStorage
88
90
  from .s3export_storage_status import S3ExportStorageStatus
89
91
  from .s3import_storage import S3ImportStorage
@@ -108,6 +110,7 @@ from .workspace import Workspace
108
110
  __all__ = [
109
111
  "AccessTokenResponse",
110
112
  "Annotation",
113
+ "AnnotationCompletedBy",
111
114
  "AnnotationFilterOptions",
112
115
  "AnnotationLastAction",
113
116
  "AnnotationsDmField",
@@ -190,6 +193,7 @@ __all__ = [
190
193
  "RedisImportStorageStatus",
191
194
  "RefinedPromptResponse",
192
195
  "RefinedPromptResponseRefinementStatus",
196
+ "RotateTokenResponse",
193
197
  "S3ExportStorage",
194
198
  "S3ExportStorageStatus",
195
199
  "S3ImportStorage",
@@ -3,6 +3,7 @@
3
3
  from ..core.pydantic_utilities import UniversalBaseModel
4
4
  import typing
5
5
  import pydantic
6
+ from .annotation_completed_by import AnnotationCompletedBy
6
7
  import datetime as dt
7
8
  from .annotation_last_action import AnnotationLastAction
8
9
  from ..core.pydantic_utilities import IS_PYDANTIC_V2
@@ -25,7 +26,7 @@ class Annotation(UniversalBaseModel):
25
26
  Time delta from creation time
26
27
  """
27
28
 
28
- completed_by: typing.Optional[int] = None
29
+ completed_by: typing.Optional[AnnotationCompletedBy] = None
29
30
  unique_id: typing.Optional[str] = None
30
31
  was_cancelled: typing.Optional[bool] = pydantic.Field(default=None)
31
32
  """
@@ -0,0 +1,6 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from .user_simple import UserSimple
5
+
6
+ AnnotationCompletedBy = typing.Union[UserSimple, int]
@@ -0,0 +1,22 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ import pydantic
5
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
6
+ import typing
7
+
8
+
9
+ class RotateTokenResponse(UniversalBaseModel):
10
+ refresh: str = pydantic.Field()
11
+ """
12
+ New JWT refresh token
13
+ """
14
+
15
+ if IS_PYDANTIC_V2:
16
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
17
+ else:
18
+
19
+ class Config:
20
+ frozen = True
21
+ smart_union = True
22
+ extra = pydantic.Extra.allow
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: label-studio-sdk
3
- Version: 1.0.11
3
+ Version: 1.0.13
4
4
  Summary:
5
5
  Requires-Python: >=3.9,<4
6
6
  Classifier: Intended Audience :: Developers
@@ -28,7 +28,8 @@ Requires-Dist: jsf (>=0.11.2,<0.12.0)
28
28
  Requires-Dist: jsonschema (>=4.23.0)
29
29
  Requires-Dist: lxml (>=4.2.5)
30
30
  Requires-Dist: nltk (>=3.9.1,<4.0.0)
31
- Requires-Dist: numpy (>=1.26.4,<2.0.0)
31
+ Requires-Dist: numpy (>=1.26.4,<3.0.0)
32
+ Requires-Dist: opencv-python (>=4.9.0,<5.0.0)
32
33
  Requires-Dist: pandas (>=0.24.0)
33
34
  Requires-Dist: pydantic (>=1.9.2)
34
35
  Requires-Dist: pydantic-core (>=2.18.2,<3.0.0)
@@ -1,4 +1,4 @@
1
- label_studio_sdk/__init__.py,sha256=qFFiMpqu4V-mUCD290rXW5oLBu8qL0A0RiRVWg4QKPw,10945
1
+ label_studio_sdk/__init__.py,sha256=_-HHT-pw6BSHqpL65CAaZLsirX14w9UxghASGcecRU8,11053
2
2
  label_studio_sdk/_extensions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  label_studio_sdk/_extensions/eval/categorical.py,sha256=MxH2Jl8Mc6HS2byBnlRgABZgwMutSQdH3tgspwCkxqk,2703
4
4
  label_studio_sdk/_extensions/label_studio_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -50,10 +50,12 @@ label_studio_sdk/comments/client.py,sha256=k359u7Q8YyPtaawoA1FW4dAuYzGVmeGM9rR2G
50
50
  label_studio_sdk/converter/__init__.py,sha256=qppSJed16HAiZbGons0yVrPRjszuWFia025Rm477q1c,201
51
51
  label_studio_sdk/converter/audio.py,sha256=U9oTULkeimodZhIkB16Gl3eJD8YzsbADWxW_r2tPcxw,1905
52
52
  label_studio_sdk/converter/brush.py,sha256=jRL3fLl_J06fVEX7Uat31ru0uUZ71C4zrXnX2qOcrIo,13370
53
- label_studio_sdk/converter/converter.py,sha256=l2BgDUNyfSDmU0g8jpxjLFTl00qoJ4_fxPFPUGJUk_s,50403
53
+ label_studio_sdk/converter/converter.py,sha256=Fx3IZpTRLe1_rHPwPYHYeaWsHnK2QJ7RnXpjyabI68Y,49731
54
54
  label_studio_sdk/converter/exports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
+ label_studio_sdk/converter/exports/brush_to_coco.py,sha256=YeVSyZxmXwLbqox7dS3IRuzR1mYTlUhg6YgK4Txq00U,13355
55
56
  label_studio_sdk/converter/exports/csv.py,sha256=F4t04tFsg5gBXTZNmkjw_NeEVsobRH_Y_vfFDi7R0Zw,2865
56
57
  label_studio_sdk/converter/exports/csv2.py,sha256=9FxcPtIDcuztDF-y4Z7Mm0AgbYUR1oMitYT6BlcOFes,3125
58
+ label_studio_sdk/converter/exports/yolo.py,sha256=0g57qBFDnTEIMJF8oD-vaPYJbtQeecJB74yWISt5EXo,5419
57
59
  label_studio_sdk/converter/funsd.py,sha256=QHoa8hzWQLkZQ87e9EgURit9kGGUCgDxoRONcSzmWlw,2544
58
60
  label_studio_sdk/converter/imports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
61
  label_studio_sdk/converter/imports/coco.py,sha256=FDUij8i329XRs3RFZEo-hKWseieyfE7vbQUtHYHpQs8,10312
@@ -61,7 +63,8 @@ label_studio_sdk/converter/imports/colors.py,sha256=F5_K4FIhOZl6LNEIVT2UU5L8HcmY
61
63
  label_studio_sdk/converter/imports/label_config.py,sha256=8RT2Jppvi1-Sl3ZNDA1uFyHr2NoU4-gM26S9iAEuQh8,1218
62
64
  label_studio_sdk/converter/imports/pathtrack.py,sha256=Xxxbw8fLLHTR57FEjVeeitjh35YbcIh_eVzuw2e5K9w,8096
63
65
  label_studio_sdk/converter/imports/yolo.py,sha256=kAJhsUV4ZxOEJE8yk7CvMGf_3w6aslqrj7OUOqHIwbo,8888
64
- label_studio_sdk/converter/main.py,sha256=tB1HbxV_prR67tEjk-YLk4pLJ5isxQAsyChxaktEIaQ,6004
66
+ label_studio_sdk/converter/keypoints.py,sha256=KACb3W4aoiM3GBvXehooFS2SqUD82zsLMAXpZgioNyw,4561
67
+ label_studio_sdk/converter/main.py,sha256=gfe5zPV2dnIk4ifG1AT95ExkzOSLzje0EOjnW0oC3q8,6442
65
68
  label_studio_sdk/converter/utils.py,sha256=VshPBwZLu2VPIGVsShKAkZwB_zKz0VvMkNRCwWeEqWg,18702
66
69
  label_studio_sdk/core/__init__.py,sha256=-t9txgeQZL_1FDw_08GEoj4ft1Cn9Dti6X0Drsadlr0,1519
67
70
  label_studio_sdk/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
@@ -148,7 +151,7 @@ label_studio_sdk/import_storage/s3s/client.py,sha256=iqJJ8d-DZ35lj8KKKsR6emA1cix
148
151
  label_studio_sdk/import_storage/types/__init__.py,sha256=LSPRtCZ04H1CRzFC6KQnse2KDh5Weeo9IPmRoluhvoc,203
149
152
  label_studio_sdk/import_storage/types/import_storage_list_types_response_item.py,sha256=jfoSmhutkqNO9vGtz6Soku6wQ8UA9-cmfiYwGSoaj10,642
150
153
  label_studio_sdk/jwt_settings/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
151
- label_studio_sdk/jwt_settings/client.py,sha256=X8bbRLbbQicaklvgvxZTqXqwcAjpzf3ywP81dMFD7-o,8161
154
+ label_studio_sdk/jwt_settings/client.py,sha256=v7e5oxvMBcpkh_JF7A3qeg-AlZlHMS82pmiMM_RKj7k,8161
152
155
  label_studio_sdk/label_interface/__init__.py,sha256=Eg6y3mAaYdKzJ5ZPhU_BTX2qoNPafthdxLD2I_rmXoU,38
153
156
  label_studio_sdk/label_interface/base.py,sha256=NCgY7ntk0WSc9O9iXu3g37-CxbZgCx_WO2pvOEHK-cg,2786
154
157
  label_studio_sdk/label_interface/control_tags.py,sha256=qLe4gsRxvppuNtrxfmgZHFX1ahM-XhePlrchZfnJiL0,30141
@@ -211,11 +214,12 @@ label_studio_sdk/tasks/types/__init__.py,sha256=F5n2075irgvO9TyLAXzp26Tybg_lxMC5
211
214
  label_studio_sdk/tasks/types/tasks_list_request_fields.py,sha256=5YXxQgyzoaL0QjSE-aLs_fepCUuzj28iqUndh5NxGGg,166
212
215
  label_studio_sdk/tasks/types/tasks_list_response.py,sha256=j1pNluAWQOQ8-d9YXQyRQAefnrl8uLQEB7_L55Z8DME,1136
213
216
  label_studio_sdk/tokens/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
214
- label_studio_sdk/tokens/client.py,sha256=BFoj9BY6APX12WujEGHtvMFbpQ_NYnQ5HGwxpM5l_kg,14662
217
+ label_studio_sdk/tokens/client.py,sha256=SvBcKXIsrTihMJC72Ifxv0U1N3gtLGz3JxqdXYA_hD4,19101
215
218
  label_studio_sdk/tokens/client_ext.py,sha256=chhzBuVYp0YeUrAnYVwDX5yJq5IJlomGhBQ1zvjZAkI,3976
216
- label_studio_sdk/types/__init__.py,sha256=5rtRvvxxS1gkkJZ9cNr1L12ln2No4H334rFATLS9VUs,8735
219
+ label_studio_sdk/types/__init__.py,sha256=fQykjzHpX04ftslk5I_hWSJQ_H9Kd8XJAmSv18EVOIc,8905
217
220
  label_studio_sdk/types/access_token_response.py,sha256=RV9FqkIiFR_9kmKueB-KiqjVyneiqUkMVueAlk5fUyc,624
218
- label_studio_sdk/types/annotation.py,sha256=8f9poNV7xJrsGKJrsmLTemLY-11L9J7-yIYEPA-qe-Y,3080
221
+ label_studio_sdk/types/annotation.py,sha256=AnHm2VjMasWZsaNXVSUzLYbpYrmM4NPZgWQh7WGa6ZQ,3157
222
+ label_studio_sdk/types/annotation_completed_by.py,sha256=0JTdVQqtgsRhVLoYnA02vq2aUWsg1AWG4wfVKUd9-iw,170
219
223
  label_studio_sdk/types/annotation_filter_options.py,sha256=84D7v0l8Gmn2sGyWh-3uQZy-mHc4qDWuwDTxqeou73E,929
220
224
  label_studio_sdk/types/annotation_last_action.py,sha256=g1CU8ypFyneqqf_eWtNH-lC6Q_h1i_IporC-Fq6nkxs,392
221
225
  label_studio_sdk/types/annotations_dm_field.py,sha256=v9wLW5vsM-j1-fvKVTBrfgqzhMAfM8O8HaoHbU39c6o,3245
@@ -298,6 +302,7 @@ label_studio_sdk/types/redis_import_storage.py,sha256=00CCOr8BS3luBBZjJx6buJbpjM
298
302
  label_studio_sdk/types/redis_import_storage_status.py,sha256=KmGl0_RWK20owkGdLZ2Tx19v7fZrSSBDhN-SScYh5hM,217
299
303
  label_studio_sdk/types/refined_prompt_response.py,sha256=CTFWlzKKisUroQfeLsawgFuuy-Njzm5hTyUxOJr0i90,1559
300
304
  label_studio_sdk/types/refined_prompt_response_refinement_status.py,sha256=k2VmjpYtv4E19KV0pjcgUmC_UEn3TOWUI0S3MbllaG4,215
305
+ label_studio_sdk/types/rotate_token_response.py,sha256=ZoHAfsN50MDLDiED75-So_wzPWLamUKkNXnqkuhjsBY,626
301
306
  label_studio_sdk/types/s3export_storage.py,sha256=TDHfvEljtCfuXBuMTc-gERvXcM6TIuIuy4QMWhjFCvg,3323
302
307
  label_studio_sdk/types/s3export_storage_status.py,sha256=HYCH0ZH90Oi-_1WgOo6d19rFm5JJ9M7tn5tVPL71P70,214
303
308
  label_studio_sdk/types/s3import_storage.py,sha256=2mLWZ0DlLPREqyH2OF0F1bExFmUzbDGan7UB4wDlPzg,3500
@@ -359,7 +364,7 @@ label_studio_sdk/workspaces/members/client.py,sha256=IVM52Yq_9zMQ3TUHT0AkZ5BTQ9a
359
364
  label_studio_sdk/workspaces/members/types/__init__.py,sha256=ZIa_rd7d6K9ZITjTU6fptyGgvjNDySksJ7Rbn4wyhD4,252
360
365
  label_studio_sdk/workspaces/members/types/members_create_response.py,sha256=7Hp5FSWm4xR5ZOEmEIglq5HYtM9KWZZBDp87jw7jYFg,668
361
366
  label_studio_sdk/workspaces/members/types/members_list_response_item.py,sha256=DIc5DJoVahI9olBis_iFgOJrAf05m2fCE8g4R5ZeDko,712
362
- label_studio_sdk-1.0.11.dist-info/LICENSE,sha256=ymVrFcHiJGjHeY30NWZgdV-xzNEtfuC63oK9ZeMDjhs,11341
363
- label_studio_sdk-1.0.11.dist-info/METADATA,sha256=lXJG4DPfXqNKy_ZcdQT9i2WnRqN4xL7bpkgNAfg7Cy4,5987
364
- label_studio_sdk-1.0.11.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
365
- label_studio_sdk-1.0.11.dist-info/RECORD,,
367
+ label_studio_sdk-1.0.13.dist-info/LICENSE,sha256=ymVrFcHiJGjHeY30NWZgdV-xzNEtfuC63oK9ZeMDjhs,11341
368
+ label_studio_sdk-1.0.13.dist-info/METADATA,sha256=-1jBn5dwOCPtA4yi0RN5kq7HY373qPlf5dSWNP1r7YU,6033
369
+ label_studio_sdk-1.0.13.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
370
+ label_studio_sdk-1.0.13.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.1
2
+ Generator: poetry-core 2.1.2
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any