scale-nucleus 0.17.6__py3-none-any.whl → 0.17.6b0__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.
nucleus/dataset.py CHANGED
@@ -997,9 +997,9 @@ class Dataset:
997
997
  raise Exception("Must provide at least one list of internal IDs")
998
998
  payload = {
999
999
  NAME_KEY: name,
1000
- DATASET_ITEM_IDS_KEY: dataset_item_ids
1001
- if dataset_item_ids
1002
- else None,
1000
+ DATASET_ITEM_IDS_KEY: (
1001
+ dataset_item_ids if dataset_item_ids else None
1002
+ ),
1003
1003
  SCENE_IDS_KEY: scene_ids if scene_ids else None,
1004
1004
  OBJECT_IDS_KEY: [*(annotation_ids or []), *(prediction_ids or [])]
1005
1005
  or None,
@@ -1449,16 +1449,34 @@ class Dataset:
1449
1449
  )
1450
1450
  return convert_export_payload(api_payload[EXPORTED_ROWS])
1451
1451
 
1452
- def scene_and_annotation_generator(self, page_size=10):
1453
- """Provides a generator of all DatasetItems and Annotations in the dataset grouped by scene.
1452
+ def scene_and_annotation_generator(self, page_size: int = 10):
1453
+ """Provides a generator of all Scenes and Annotations in the dataset grouped by scene.
1454
1454
 
1455
+ Args:
1456
+ page_size: Number of scenes to fetch per page. Default is 10.
1455
1457
 
1456
1458
  Returns:
1457
- Generator where each element is a nested dict (representing a JSON) structured in the following way:
1459
+ Generator where each element is a nested dict containing scene and annotation information of the dataset structured as a JSON.
1460
+
1461
+ Track grouping is slightly more complicated and is done in the following order:
1462
+ 1. If track_id is defined in the annotations table, use it as the track id.
1463
+ 2. If track_reference_id is defined in the metadata field of the annotations table, use it as the track id.
1464
+ 3. If track_id is defined in the metadata field of the annotations table, use it as the track id.
1465
+ 4. If track_id is not defined and annotation_id is defined, use annotation_id as track id.
1466
+ 5. If annotation_id grouping is unsuccessful such that the annotation id is unique across all frames in the scene for all annotations, throw an error that the annotation format is incompatible.
1467
+ 6. If there is no track or annotation id, throw an error that the annotation format is incompatible.
1468
+
1469
+ If you use the generator and discover that no scenes were generated, check the response error message for more information. It is likely that the annotations are not in the correct format.
1458
1470
 
1471
+ ::
1459
1472
  Iterable[{
1460
- "file_location": str,
1461
- "metadata": Dict[str, Any],
1473
+ "scene": {
1474
+ "id": str,
1475
+ "reference_id": str,
1476
+ "metadata": Dict[str, Any]
1477
+ "type": str,
1478
+ "fileLocation": str,
1479
+ }
1462
1480
  "annotations": {
1463
1481
  "{trackId}": {
1464
1482
  "label": str,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: scale-nucleus
3
- Version: 0.17.6
3
+ Version: 0.17.6b0
4
4
  Summary: The official Python client library for Nucleus, the Data Platform for AI
5
5
  Home-page: https://scale.com/nucleus
6
6
  License: MIT
@@ -14,6 +14,7 @@ Classifier: Programming Language :: Python :: 3.8
14
14
  Classifier: Programming Language :: Python :: 3.9
15
15
  Classifier: Programming Language :: Python :: 3.10
16
16
  Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
17
18
  Provides-Extra: launch
18
19
  Provides-Extra: metrics
19
20
  Requires-Dist: Pillow (>=7.1.2)
@@ -26,7 +26,7 @@ nucleus/data_transfer_object/dataset_info.py,sha256=5P_gpvAyaqXxj2ZQuzLkGN2XROaN
26
26
  nucleus/data_transfer_object/dataset_size.py,sha256=oe-dXaMLpsQRDcJQRZ9Ja8JTagYz4dviZuTognEylp0,111
27
27
  nucleus/data_transfer_object/job_status.py,sha256=hxvyNdrdVdj3UpEfwvryKC_QCJQEC9ru6IPjhPFcK44,2038
28
28
  nucleus/data_transfer_object/scenes_list.py,sha256=iTHE6vA47bRB6ciyEU4LArUXEXco4ArnGvZTGTeK8xs,432
29
- nucleus/dataset.py,sha256=ekYreXpUY2kUyKJLJEopNXfezc0u9EzQyWlAYAtt3-8,92751
29
+ nucleus/dataset.py,sha256=pmtUpYKWgSReT-lxA1dODCL3VzY_8Tq7yuyNWL7CkUk,94080
30
30
  nucleus/dataset_item.py,sha256=y9ia47i31lX2wvw6EkVAxeHburMrrZpuyjEGlstWa2A,10166
31
31
  nucleus/dataset_item_uploader.py,sha256=BD0FTgimEFYmDbnOLIaQZS3OLDfLe5wumADDmgMX598,6684
32
32
  nucleus/deprecation_warning.py,sha256=5C9dVusR5UkUQnW2MrRkIXCfbc8ULc7xOaB134agNKk,976
@@ -85,8 +85,8 @@ nucleus/validate/scenario_test.py,sha256=pCmM157dblSciZCDTw-f47Fpy3OUZFgXmokdhIL
85
85
  nucleus/validate/scenario_test_evaluation.py,sha256=Q0WzaEE9uUbPVc4EHlCoKjhJcqMNt4QbyiiJx12VOR0,4075
86
86
  nucleus/validate/scenario_test_metric.py,sha256=AhVFOB1ULwBqlZ2X_Au1TXy4iQELljtzR4ZpeLB35So,1209
87
87
  nucleus/validate/utils.py,sha256=VjdIJj9Pii4z4L6xbvClAc7ra_J7cX0vWB_J2X6yrGE,185
88
- scale_nucleus-0.17.6.dist-info/LICENSE,sha256=jaTGyQSQIZeWMo5iyYqgbAYHR9Bdy7nOzgE-Up3m_-g,1075
89
- scale_nucleus-0.17.6.dist-info/METADATA,sha256=HHN0a8wl3wVYBELMNFiG5uQ1-59ke402OCTm_dkty6Q,7920
90
- scale_nucleus-0.17.6.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
91
- scale_nucleus-0.17.6.dist-info/entry_points.txt,sha256=fmqEzh6NZQyg9eFMILnWabKT8OWQTMSCdDzMiVq2zYs,32
92
- scale_nucleus-0.17.6.dist-info/RECORD,,
88
+ scale_nucleus-0.17.6b0.dist-info/LICENSE,sha256=jaTGyQSQIZeWMo5iyYqgbAYHR9Bdy7nOzgE-Up3m_-g,1075
89
+ scale_nucleus-0.17.6b0.dist-info/METADATA,sha256=U4EVzUIyio7za63G_XZz43WJ81rR_io-IfZHAWlqllo,7973
90
+ scale_nucleus-0.17.6b0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
91
+ scale_nucleus-0.17.6b0.dist-info/entry_points.txt,sha256=fmqEzh6NZQyg9eFMILnWabKT8OWQTMSCdDzMiVq2zYs,32
92
+ scale_nucleus-0.17.6b0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.6.1
2
+ Generator: poetry-core 1.9.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any