File tree Expand file tree Collapse file tree 4 files changed +4
-8
lines changed
labelbox/data/annotation_types/geometry Expand file tree Collapse file tree 4 files changed +4
-8
lines changed Original file line number Diff line number Diff line change 1- from __future__ import annotations
21from typing import List , Optional , Union , Tuple
32
43import 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 (
Original file line number Diff line number Diff line change 1- from __future__ import annotations
21from typing import Optional , Tuple , Union
32
43import 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 (
Original file line number Diff line number Diff line change 1- from __future__ import annotations
21from typing import List , Optional , Union , Tuple
32
43import 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 ):
Original file line number Diff line number Diff line change 1- from __future__ import annotations
21from typing import Optional , Type , Union , Tuple
32
43import 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
You can’t perform that action at this time.
0 commit comments