Skip to content

Commit 5efd92b

Browse files
authored
[AL-4858][AL-4860] Reduce imports and hide NDJsonConverter
2 parents 033906a + 5c0d581 commit 5efd92b

File tree

19 files changed

+167
-33
lines changed

19 files changed

+167
-33
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
# Changelog
2+
# Version 3.38.0 (2023-xx-xx)
3+
4+
### Added
5+
* All imports are available via `import labelbox as lb` and `import labelbox.types as lb_types`.
6+
7+
## Changed
8+
* `LabelImport.create_from_objects()`, `MALPredictionImport.create_from_objects()`, `MEAPredictionImport.create_from_objects()`, `Project.upload_annotations()`, `ModelRun.add_predictions()` now support Python Types for annotations.
29

310
# Version 3.37.0 (2023-02-08)
411
## Added

labelbox/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@
2020
from labelbox.schema.ontology import Ontology, OntologyBuilder, Classification, Option, Tool, FeatureSchema
2121
from labelbox.schema.role import Role, ProjectRole
2222
from labelbox.schema.invite import Invite, InviteLimit
23-
from labelbox.schema.data_row_metadata import DataRowMetadataOntology
23+
from labelbox.schema.data_row_metadata import DataRowMetadataOntology, DataRowMetadataField, DataRowMetadata, DeleteDataRowMetadata
2424
from labelbox.schema.model_run import ModelRun, DataSplit
2525
from labelbox.schema.benchmark import Benchmark
2626
from labelbox.schema.iam_integration import IAMIntegration
2727
from labelbox.schema.resource_tag import ResourceTag
2828
from labelbox.schema.project_resource_tag import ProjectResourceTag
2929
from labelbox.schema.media_type import MediaType
3030
from labelbox.schema.slice import Slice, CatalogSlice
31+
from labelbox.schema.queue_mode import QueueMode

labelbox/data/annotation_types/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,9 @@
3434
from .metrics import ConfusionMatrixAggregation
3535
from .metrics import ScalarMetricValue
3636
from .metrics import ConfusionMatrixMetricValue
37+
38+
from .data.tiled_image import EPSG
39+
from .data.tiled_image import EPSGTransformer
40+
from .data.tiled_image import TiledBounds
41+
from .data.tiled_image import TiledImageData
42+
from .data.tiled_image import TileLayer

labelbox/data/annotation_types/collection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,4 +298,4 @@ def __next__(self):
298298
return self._process(value)
299299

300300

301-
LabelCollection = Union[LabelList, LabelGenerator]
301+
LabelCollection = Union[LabelList, LabelGenerator, Iterable[Label]]

labelbox/data/annotation_types/geometry/geometry.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33

44
import geojson
55
import numpy as np
6-
from shapely import geometry as geom
76
from pydantic import BaseModel
87

8+
from shapely import geometry as geom
9+
910

1011
class Geometry(BaseModel, ABC):
1112
"""Abstract base class for geometry objects

labelbox/data/annotation_types/geometry/line.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import numpy as np
55
import cv2
66
from pydantic import validator
7+
78
from shapely.geometry import LineString as SLineString
89

910
from .point import Point

labelbox/data/annotation_types/geometry/mask.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
import numpy as np
44
from pydantic.class_validators import validator
5-
from shapely.geometry import MultiPolygon, Polygon
65
import cv2
76

7+
from shapely.geometry import MultiPolygon, Polygon
8+
89
from ..data import MaskData
910
from .geometry import Geometry
1011

labelbox/data/annotation_types/geometry/polygon.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import geojson
55
import numpy as np
66
from pydantic import validator
7+
78
from shapely.geometry import Polygon as SPolygon
89

910
from .geometry import Geometry

labelbox/data/annotation_types/geometry/rectangle.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import cv2
44
import geojson
55
import numpy as np
6+
67
from shapely.geometry import Polygon as SPolygon
78

89
from .geometry import Geometry

labelbox/data/metrics/iou/calculation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from typing import List, Optional, Tuple, Union
22
from itertools import product
33

4-
from shapely.geometry import Polygon
54
import numpy as np
5+
from shapely.geometry import Polygon
66

77
from ..group import get_feature_pairs, get_identifying_key, has_no_annotations, has_no_matching_annotations
88
from ...annotation_types import (ObjectAnnotation, ClassificationAnnotation,

0 commit comments

Comments
 (0)