Skip to content

Commit 0cbc4a9

Browse files
author
Matt Sokoloff
committed
remove mea changes to validation
1 parent 10a1d2a commit 0cbc4a9

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

labelbox/schema/bulk_import_request.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from typing_extensions import Literal
1414
from typing import (Any, List, Optional, BinaryIO, Dict, Iterable, Tuple, Union,
1515
Type, Set)
16-
from shapely.geometry import Polygon as SPolygon, Point as SPoint, LineString, box # type: ignore
1716

1817
import labelbox
1918
from labelbox import utils
@@ -65,7 +64,6 @@ def _make_request_data(project_id: str, name: str, content_length: int,
6564
def _send_create_file_command(
6665
client, request_data: dict, file_name: str,
6766
file_data: Tuple[str, Union[bytes, BinaryIO], str]) -> dict:
68-
6967
response = requests.post(
7068
client.endpoint,
7169
headers={"authorization": "Bearer %s" % client.api_key},
@@ -717,9 +715,6 @@ def is_geom_valid(cls, v):
717715
f"A polygon must have at least 3 points to be valid. Found {v}")
718716
return v
719717

720-
def to_shapely_poly(self) -> SPolygon:
721-
return SPolygon([[point.x, point.y] for point in self.polygon])
722-
723718

724719
class NDPolyline(NDBaseTool):
725720
ontology_type: Literal["line"] = "line"
@@ -732,32 +727,18 @@ def is_geom_valid(cls, v):
732727
f"A line must have at least 2 points to be valid. Found {v}")
733728
return v
734729

735-
def to_shapely_poly(self, buffer=70.) -> SPolygon:
736-
return LineString([[point.x, point.y] for point in self.line
737-
]).buffer(buffer)
738-
739730

740731
class NDRectangle(NDBaseTool):
741732
ontology_type: Literal["rectangle"] = "rectangle"
742733
bbox: Bbox = pydantic.Field(determinant=True)
743-
744734
#Could check if points are positive
745735

746-
def to_shapely_poly(self) -> SPolygon:
747-
return box(self.bbox.left, self.bbox.top,
748-
self.bbox.left + self.bbox.width,
749-
self.bbox.top + self.bbox.height)
750-
751736

752737
class NDPoint(NDBaseTool):
753738
ontology_type: Literal["point"] = "point"
754739
point: Point = pydantic.Field(determinant=True)
755-
756740
#Could check if points are positive
757741

758-
def to_shapely_poly(self, buffer=70.) -> SPolygon:
759-
return SPoint([self.point.x, self.point.y]).buffer(buffer)
760-
761742

762743
class EntityLocation(BaseModel):
763744
start: int

0 commit comments

Comments
 (0)