unitlab 3.1.2__tar.gz → 3.1.3__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.
Files changed (45) hide show
  1. {unitlab-3.1.2 → unitlab-3.1.3}/PKG-INFO +2 -2
  2. {unitlab-3.1.2 → unitlab-3.1.3}/README.md +1 -1
  3. {unitlab-3.1.2 → unitlab-3.1.3}/pyproject.toml +1 -1
  4. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/resources/annotation_imports.py +7 -3
  5. {unitlab-3.1.2 → unitlab-3.1.3}/tests/test_annotation_imports.py +1 -1
  6. {unitlab-3.1.2 → unitlab-3.1.3}/.gitignore +0 -0
  7. {unitlab-3.1.2 → unitlab-3.1.3}/LICENSE.md +0 -0
  8. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/__init__.py +0 -0
  9. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/__main__.py +0 -0
  10. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/_config.py +0 -0
  11. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/_downloader.py +0 -0
  12. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/_grouping.py +0 -0
  13. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/_http.py +0 -0
  14. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/_nuscenes.py +0 -0
  15. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/_scene_uploader.py +0 -0
  16. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/_scenes.py +0 -0
  17. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/_uploader.py +0 -0
  18. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/_waiter.py +0 -0
  19. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/cli.py +0 -0
  20. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/client.py +0 -0
  21. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/exceptions.py +0 -0
  22. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/ontology.py +0 -0
  23. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/py.typed +0 -0
  24. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/resources/__init__.py +0 -0
  25. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/resources/_base.py +0 -0
  26. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/resources/assets.py +0 -0
  27. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/resources/cloud.py +0 -0
  28. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/resources/datasets.py +0 -0
  29. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/resources/embeddings.py +0 -0
  30. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/resources/ontologies.py +0 -0
  31. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/resources/projects.py +0 -0
  32. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/resources/releases.py +0 -0
  33. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/resources/workflow.py +0 -0
  34. {unitlab-3.1.2 → unitlab-3.1.3}/src/unitlab/types.py +0 -0
  35. {unitlab-3.1.2 → unitlab-3.1.3}/tests/test_cli.py +0 -0
  36. {unitlab-3.1.2 → unitlab-3.1.3}/tests/test_client.py +0 -0
  37. {unitlab-3.1.2 → unitlab-3.1.3}/tests/test_downloader.py +0 -0
  38. {unitlab-3.1.2 → unitlab-3.1.3}/tests/test_embeddings.py +0 -0
  39. {unitlab-3.1.2 → unitlab-3.1.3}/tests/test_http.py +0 -0
  40. {unitlab-3.1.2 → unitlab-3.1.3}/tests/test_nuscenes.py +0 -0
  41. {unitlab-3.1.2 → unitlab-3.1.3}/tests/test_scene_cli.py +0 -0
  42. {unitlab-3.1.2 → unitlab-3.1.3}/tests/test_scene_uploads.py +0 -0
  43. {unitlab-3.1.2 → unitlab-3.1.3}/tests/test_scenes.py +0 -0
  44. {unitlab-3.1.2 → unitlab-3.1.3}/tests/test_tiled_uploads.py +0 -0
  45. {unitlab-3.1.2 → unitlab-3.1.3}/tests/test_uploader.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: unitlab
3
- Version: 3.1.2
3
+ Version: 3.1.3
4
4
  Summary: Python SDK for the Unitlab.ai data annotation platform
5
5
  Project-URL: Homepage, https://unitlab.ai
6
6
  Project-URL: Documentation, https://docs.unitlab.ai
@@ -441,7 +441,7 @@ Supported inputs are COCO JSON, Unitlab exports (UUEF item JSON, Audio JSON and
441
441
  GeoJSON, as `.json` or `.geojson`), `unitlab-image/1` and `unitlab-video/1`. They
442
442
  cover image, video, medical, document, audio, time series, text, HTML, geospatial
443
443
  and pathology items. A UUEF file holds one item: import each file as its own batch.
444
- Each JSON file is limited to 600 MiB. The backend matches original media paths/IDs,
444
+ Each JSON file is limited to 80 MiB. The backend matches original media paths/IDs,
445
445
  with a unique-filename fallback; ambiguous names require an explicit mapping.
446
446
  YOLO text/ZIP files and other tools' project files are not accepted by this importer.
447
447
 
@@ -408,7 +408,7 @@ Supported inputs are COCO JSON, Unitlab exports (UUEF item JSON, Audio JSON and
408
408
  GeoJSON, as `.json` or `.geojson`), `unitlab-image/1` and `unitlab-video/1`. They
409
409
  cover image, video, medical, document, audio, time series, text, HTML, geospatial
410
410
  and pathology items. A UUEF file holds one item: import each file as its own batch.
411
- Each JSON file is limited to 600 MiB. The backend matches original media paths/IDs,
411
+ Each JSON file is limited to 80 MiB. The backend matches original media paths/IDs,
412
412
  with a unique-filename fallback; ambiguous names require an explicit mapping.
413
413
  YOLO text/ZIP files and other tools' project files are not accepted by this importer.
414
414
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "unitlab"
7
- version = "3.1.2"
7
+ version = "3.1.3"
8
8
  description = "Python SDK for the Unitlab.ai data annotation platform"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -13,7 +13,11 @@ from ._base import Namespace, identifier
13
13
  if TYPE_CHECKING:
14
14
  from unitlab.client import UnitlabClient
15
15
 
16
- MAX_FILE_BYTES = 600 * 1024 * 1024
16
+ # The server's cap (nbackend annotation_import_service.MAX_FILE_BYTES): a batch
17
+ # stores its parsed rows as one jsonb value, which PostgreSQL caps at ~256 MiB,
18
+ # and parsed rows take 2.2-2.8x the file. Checked here so a larger file fails
19
+ # before its upload instead of with the server's 400 after it.
20
+ MAX_FILE_BYTES = 80 * 1024 * 1024
17
21
  # Preview and commit re-check every row and item on the server; live runs on
18
22
  # large files took over a minute, past the client's 60 s default.
19
23
  SERVER_WORK_TIMEOUT = 300
@@ -55,7 +59,7 @@ class AnnotationImports(Namespace):
55
59
  """Upload COCO, Unitlab export or native JSON and return a label preview.
56
60
 
57
61
  Supply a local ``annotation_file`` or a saved ``cloud_storage`` handle/ID
58
- and ``annotation_key``. JSON files are limited to 600 MiB each. Media must
62
+ and ``annotation_key``. JSON files are limited to 80 MiB each. Media must
59
63
  already belong to this project; use ``UploadBatch.wait()`` after upload.
60
64
 
61
65
  Exactly one prediction namespace, ``source_name`` or ``source_id``, is
@@ -118,7 +122,7 @@ class AnnotationImports(Namespace):
118
122
  stream = stack.enter_context(path.open("rb"))
119
123
  stream.seek(0, 2)
120
124
  if stream.tell() > MAX_FILE_BYTES:
121
- raise ValueError(f"{name} must be 600 MiB or smaller.")
125
+ raise ValueError(f"{name} must be 80 MiB or smaller.")
122
126
  stream.seek(0)
123
127
  files[name] = (path.name, stream, "application/json")
124
128
  if files:
@@ -267,7 +267,7 @@ def test_file_size_limit_and_closed_streams_on_request_failure(
267
267
  project.annotation_imports.create(labels, source_name="model")
268
268
  assert opened and all(stream.closed for stream in opened)
269
269
  monkeypatch.setattr("unitlab.resources.annotation_imports.MAX_FILE_BYTES", 1)
270
- with pytest.raises(ValueError, match="600 MiB"):
270
+ with pytest.raises(ValueError, match="80 MiB"):
271
271
  project.annotation_imports.create(labels, source_name="model")
272
272
  assert len(opened) == 1
273
273
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes