label-studio-sdk 2.0.6__py3-none-any.whl → 2.0.8__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.
Files changed (67) hide show
  1. label_studio_sdk/__init__.py +32 -2
  2. label_studio_sdk/base_client.py +4 -0
  3. label_studio_sdk/converter/exports/yolo.py +89 -74
  4. label_studio_sdk/core/client_wrapper.py +1 -1
  5. label_studio_sdk/import_storage/azure_spi/client.py +30 -0
  6. label_studio_sdk/label_interface/control_tags.py +38 -0
  7. label_studio_sdk/label_interface/data_examples.json +10 -0
  8. label_studio_sdk/label_interface/interface.py +13 -0
  9. label_studio_sdk/label_interface/object_tags.py +9 -0
  10. label_studio_sdk/ml/client.py +124 -0
  11. label_studio_sdk/organizations/__init__.py +3 -2
  12. label_studio_sdk/organizations/client.py +540 -1
  13. label_studio_sdk/organizations/invites/__init__.py +2 -0
  14. label_studio_sdk/organizations/invites/client.py +368 -0
  15. label_studio_sdk/organizations/permissions/__init__.py +2 -0
  16. label_studio_sdk/organizations/permissions/client.py +1129 -0
  17. label_studio_sdk/organizations/types/__init__.py +5 -0
  18. label_studio_sdk/organizations/types/patched_default_role_request_custom_scripts_editable_by.py +7 -0
  19. label_studio_sdk/project_templates/__init__.py +2 -0
  20. label_studio_sdk/project_templates/client.py +909 -0
  21. label_studio_sdk/projects/__init__.py +30 -0
  22. label_studio_sdk/projects/client.py +355 -0
  23. label_studio_sdk/projects/stats/__init__.py +28 -0
  24. label_studio_sdk/projects/stats/client.py +1002 -43
  25. label_studio_sdk/projects/stats/types/__init__.py +30 -0
  26. label_studio_sdk/projects/stats/types/stats_agreement_annotator_response.py +26 -0
  27. label_studio_sdk/projects/stats/types/stats_data_filters_response.py +23 -0
  28. label_studio_sdk/projects/stats/types/stats_data_filters_response_user_filters.py +34 -0
  29. label_studio_sdk/projects/stats/types/stats_data_filters_response_user_filters_stats_item.py +22 -0
  30. label_studio_sdk/projects/stats/types/stats_finished_tasks_response.py +32 -0
  31. label_studio_sdk/projects/stats/types/stats_lead_time_response.py +23 -0
  32. label_studio_sdk/projects/stats/types/stats_lead_time_response_lead_time_stats_item.py +37 -0
  33. label_studio_sdk/projects/stats/types/stats_user_ground_truth_agreement_response.py +20 -0
  34. label_studio_sdk/projects/stats/types/stats_user_ground_truth_agreement_response_agreement.py +5 -0
  35. label_studio_sdk/projects/stats/types/stats_user_prediction_agreement_response.py +24 -0
  36. label_studio_sdk/projects/stats/types/stats_user_prediction_agreement_response_average_prediction_agreement_per_user.py +5 -0
  37. label_studio_sdk/projects/stats/types/stats_user_review_score_response.py +22 -0
  38. label_studio_sdk/projects/stats/types/stats_user_review_score_response_performance_score.py +5 -0
  39. label_studio_sdk/projects/stats/types/stats_user_review_score_response_review_score.py +5 -0
  40. label_studio_sdk/projects/types/__init__.py +2 -0
  41. label_studio_sdk/projects/types/projects_import_predictions_response.py +26 -0
  42. label_studio_sdk/prompts/versions/client.py +4 -16
  43. label_studio_sdk/types/__init__.py +26 -2
  44. label_studio_sdk/types/azure_service_principal_import_storage.py +5 -0
  45. label_studio_sdk/types/azure_service_principal_import_storage_request.py +5 -0
  46. label_studio_sdk/types/configurable_permission_option.py +25 -0
  47. label_studio_sdk/types/configurable_permission_option_default.py +7 -0
  48. label_studio_sdk/types/default_role.py +75 -0
  49. label_studio_sdk/types/default_role_custom_scripts_editable_by.py +7 -0
  50. label_studio_sdk/types/lse_organization.py +2 -2
  51. label_studio_sdk/types/lse_project.py +223 -0
  52. label_studio_sdk/types/lse_project_counts.py +46 -0
  53. label_studio_sdk/types/lse_project_sampling.py +7 -0
  54. label_studio_sdk/types/lse_project_skip_queue.py +7 -0
  55. label_studio_sdk/types/lse_task.py +1 -1
  56. label_studio_sdk/types/lse_task_serializer_for_reviewers.py +1 -1
  57. label_studio_sdk/types/organization_permission.py +31 -0
  58. label_studio_sdk/types/organization_permission_request.py +24 -0
  59. label_studio_sdk/types/paginated_lse_project_counts_list.py +23 -0
  60. label_studio_sdk/types/project_template.py +41 -0
  61. label_studio_sdk/types/project_template_request.py +38 -0
  62. label_studio_sdk/types/who_am_i_user.py +1 -0
  63. {label_studio_sdk-2.0.6.dist-info → label_studio_sdk-2.0.8.dist-info}/METADATA +1 -1
  64. {label_studio_sdk-2.0.6.dist-info → label_studio_sdk-2.0.8.dist-info}/RECORD +66 -31
  65. label_studio_sdk/types/default_role_enum.py +0 -5
  66. {label_studio_sdk-2.0.6.dist-info → label_studio_sdk-2.0.8.dist-info}/LICENSE +0 -0
  67. {label_studio_sdk-2.0.6.dist-info → label_studio_sdk-2.0.8.dist-info}/WHEEL +0 -0
@@ -457,6 +457,64 @@ class MlClient:
457
457
  raise ApiError(status_code=_response.status_code, body=_response.text)
458
458
  raise ApiError(status_code=_response.status_code, body=_response_json)
459
459
 
460
+ def predict_all_tasks(
461
+ self,
462
+ id: int,
463
+ *,
464
+ batch_size: typing.Optional[int] = None,
465
+ request_options: typing.Optional[RequestOptions] = None,
466
+ ) -> None:
467
+ """
468
+ Note: not available in the community edition of Label Studio.
469
+
470
+ Create predictions for all tasks using a specific ML backend so that you can set up an active learning strategy based on the confidence or uncertainty scores associated with the predictions. Creating predictions requires a Label Studio ML backend set up and configured for your project.
471
+
472
+ See [Set up machine learning](https://labelstud.io/guide/ml.html) for more details about a Label Studio ML backend.
473
+
474
+ Reference the ML backend ID in the path of this API call. Get the ML backend ID by [listing the ML backends for a project](https://labelstud.io/api/#operation/api_ml_list).
475
+
476
+ Parameters
477
+ ----------
478
+ id : int
479
+ A unique integer value identifying this ML backend.
480
+
481
+ batch_size : typing.Optional[int]
482
+ Computed number of tasks without predictions that the ML backend needs to predict.
483
+
484
+ request_options : typing.Optional[RequestOptions]
485
+ Request-specific configuration.
486
+
487
+ Returns
488
+ -------
489
+ None
490
+
491
+ Examples
492
+ --------
493
+ from label_studio_sdk import LabelStudio
494
+
495
+ client = LabelStudio(
496
+ api_key="YOUR_API_KEY",
497
+ )
498
+ client.ml.predict_all_tasks(
499
+ id=1,
500
+ )
501
+ """
502
+ _response = self._client_wrapper.httpx_client.request(
503
+ f"api/ml/{jsonable_encoder(id)}/predict",
504
+ method="POST",
505
+ params={
506
+ "batch_size": batch_size,
507
+ },
508
+ request_options=request_options,
509
+ )
510
+ try:
511
+ if 200 <= _response.status_code < 300:
512
+ return
513
+ _response_json = _response.json()
514
+ except JSONDecodeError:
515
+ raise ApiError(status_code=_response.status_code, body=_response.text)
516
+ raise ApiError(status_code=_response.status_code, body=_response_json)
517
+
460
518
  def train(
461
519
  self,
462
520
  id: int,
@@ -1064,6 +1122,72 @@ class AsyncMlClient:
1064
1122
  raise ApiError(status_code=_response.status_code, body=_response.text)
1065
1123
  raise ApiError(status_code=_response.status_code, body=_response_json)
1066
1124
 
1125
+ async def predict_all_tasks(
1126
+ self,
1127
+ id: int,
1128
+ *,
1129
+ batch_size: typing.Optional[int] = None,
1130
+ request_options: typing.Optional[RequestOptions] = None,
1131
+ ) -> None:
1132
+ """
1133
+ Note: not available in the community edition of Label Studio.
1134
+
1135
+ Create predictions for all tasks using a specific ML backend so that you can set up an active learning strategy based on the confidence or uncertainty scores associated with the predictions. Creating predictions requires a Label Studio ML backend set up and configured for your project.
1136
+
1137
+ See [Set up machine learning](https://labelstud.io/guide/ml.html) for more details about a Label Studio ML backend.
1138
+
1139
+ Reference the ML backend ID in the path of this API call. Get the ML backend ID by [listing the ML backends for a project](https://labelstud.io/api/#operation/api_ml_list).
1140
+
1141
+ Parameters
1142
+ ----------
1143
+ id : int
1144
+ A unique integer value identifying this ML backend.
1145
+
1146
+ batch_size : typing.Optional[int]
1147
+ Computed number of tasks without predictions that the ML backend needs to predict.
1148
+
1149
+ request_options : typing.Optional[RequestOptions]
1150
+ Request-specific configuration.
1151
+
1152
+ Returns
1153
+ -------
1154
+ None
1155
+
1156
+ Examples
1157
+ --------
1158
+ import asyncio
1159
+
1160
+ from label_studio_sdk import AsyncLabelStudio
1161
+
1162
+ client = AsyncLabelStudio(
1163
+ api_key="YOUR_API_KEY",
1164
+ )
1165
+
1166
+
1167
+ async def main() -> None:
1168
+ await client.ml.predict_all_tasks(
1169
+ id=1,
1170
+ )
1171
+
1172
+
1173
+ asyncio.run(main())
1174
+ """
1175
+ _response = await self._client_wrapper.httpx_client.request(
1176
+ f"api/ml/{jsonable_encoder(id)}/predict",
1177
+ method="POST",
1178
+ params={
1179
+ "batch_size": batch_size,
1180
+ },
1181
+ request_options=request_options,
1182
+ )
1183
+ try:
1184
+ if 200 <= _response.status_code < 300:
1185
+ return
1186
+ _response_json = _response.json()
1187
+ except JSONDecodeError:
1188
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1189
+ raise ApiError(status_code=_response.status_code, body=_response_json)
1190
+
1067
1191
  async def train(
1068
1192
  self,
1069
1193
  id: int,
@@ -1,5 +1,6 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from . import members
3
+ from .types import PatchedDefaultRoleRequestCustomScriptsEditableBy
4
+ from . import invites, members, permissions
4
5
 
5
- __all__ = ["members"]
6
+ __all__ = ["PatchedDefaultRoleRequestCustomScriptsEditableBy", "invites", "members", "permissions"]