Skip to content

Commit 1508722

Browse files
committed
nit to fix type hint
1 parent eb329db commit 1508722

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

labelbox/data/annotation_types/geometry/line.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import annotations
21
from typing import List, Optional, Union, Tuple
32

43
import geojson
@@ -28,7 +27,7 @@ def geometry(self) -> geojson.MultiLineString:
2827
[[[point.x, point.y] for point in self.points]])
2928

3029
@classmethod
31-
def from_shapely(cls, shapely_obj: SLineString) -> Line:
30+
def from_shapely(cls, shapely_obj: SLineString) -> "Line":
3231
"""Transforms a shapely object."""
3332
if not isinstance(shapely_obj, SLineString):
3433
raise TypeError(

labelbox/data/annotation_types/geometry/point.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import annotations
21
from typing import Optional, Tuple, Union
32

43
import geojson
@@ -27,7 +26,7 @@ def geometry(self) -> geojson.Point:
2726
return geojson.Point((self.x, self.y))
2827

2928
@classmethod
30-
def from_shapely(cls, shapely_obj: SPoint) -> Point:
29+
def from_shapely(cls, shapely_obj: SPoint) -> "Point":
3130
"""Transforms a shapely object."""
3231
if not isinstance(shapely_obj, SPoint):
3332
raise TypeError(

labelbox/data/annotation_types/geometry/polygon.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import annotations
21
from typing import List, Optional, Union, Tuple
32

43
import cv2
@@ -33,7 +32,7 @@ def geometry(self) -> geojson.Polygon:
3332
return geojson.Polygon([[(point.x, point.y) for point in self.points]])
3433

3534
@classmethod
36-
def from_shapely(cls, shapely_obj: SPolygon) -> Polygon:
35+
def from_shapely(cls, shapely_obj: SPolygon) -> "Polygon":
3736
"""Transforms a shapely object."""
3837
#we only consider 0th index because we only allow for filled polygons
3938
if not isinstance(shapely_obj, SPolygon):

labelbox/data/annotation_types/geometry/rectangle.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import annotations
21
from typing import Optional, Type, Union, Tuple
32

43
import cv2
@@ -33,7 +32,7 @@ def geometry(self) -> geojson.geometry.Geometry:
3332
]])
3433

3534
@classmethod
36-
def from_shapely(cls, shapely_obj: SPolygon) -> Rectangle:
35+
def from_shapely(cls, shapely_obj: SPolygon) -> "Rectangle":
3736
"""Transforms a shapely object.
3837
3938
If the provided shape is a non-rectangular polygon, a rectangle will be

0 commit comments

Comments
 (0)