Skip to content

Commit c2baea1

Browse files
author
Matt Sokoloff
committed
yapf
1 parent 54b0d18 commit c2baea1

File tree

10 files changed

+25
-60
lines changed

10 files changed

+25
-60
lines changed

labelbox/data/annotation_types/geometry/rectangle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def geometry(self) -> geojson.geometry.Geometry:
2727
]])
2828

2929
def raster(self, height: int, width: int,
30-
color = (255, 255, 255)) -> np.ndarray:
30+
color=(255, 255, 255)) -> np.ndarray:
3131
"""
3232
Draw the rectangle onto a 3d mask
3333

labelbox/data/annotation_types/label.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
VideoClassificationAnnotation, VideoObjectAnnotation)
1515

1616

17-
1817
class Label(BaseModel):
1918
data: Union[VideoData, RasterData, TextData]
2019
annotations: List[Union[ClassificationAnnotation, ObjectAnnotation,

labelbox/data/ontology.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
11
from typing import Dict, List, Tuple
22

33
from labelbox.schema import ontology
4-
from .annotation_types import (
5-
Text,
6-
Dropdown,
7-
Checklist,
8-
Radio,
9-
ClassificationAnnotation,
10-
ObjectAnnotation,
11-
Mask,
12-
Point,
13-
Line,
14-
Polygon,
15-
Rectangle,
16-
TextEntity
17-
)
4+
from .annotation_types import (Text, Dropdown, Checklist, Radio,
5+
ClassificationAnnotation, ObjectAnnotation, Mask,
6+
Point, Line, Polygon, Rectangle, TextEntity)
187

198

209
def get_feature_schema_lookup(

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
"backoff==1.10.0",
2424
"backports-datetime-fromisoformat==1.0.0; python_version < '3.7.0'",
2525
"dataclasses==0.7; python_version < '3.7.0'", "ndjson==0.3.1",
26-
"requests>=2.22.0", "google-api-core>=1.22.1", "pydantic>=1.8,<2.0", "shapely", "geojson", "numpy", "rasterio", "PILLOW", "opencv-python", "typeguard", "tqdm"
26+
"requests>=2.22.0", "google-api-core>=1.22.1", "pydantic>=1.8,<2.0",
27+
"shapely", "geojson", "numpy", "rasterio", "PILLOW", "opencv-python",
28+
"typeguard", "tqdm"
2729
],
2830
classifiers=[
2931
'Development Status :: 3 - Alpha',

tests/data/annotation_types/classification/test_classification.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import pytest
22
from pydantic import ValidationError
33

4-
from labelbox.data.annotation_types import (
5-
Checklist,
6-
ClassificationAnswer,
7-
Dropdown,
8-
Radio,
9-
Text,
10-
ClassificationAnnotation
11-
)
4+
from labelbox.data.annotation_types import (Checklist, ClassificationAnswer,
5+
Dropdown, Radio, Text,
6+
ClassificationAnnotation)
127

138

149
def test_classification_answer():

tests/data/annotation_types/data/test_text.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
from labelbox.data.annotation_types import TextData
55

6+
67
def test_validate_schema():
78
with pytest.raises(ValidationError):
89
data = TextData()

tests/data/annotation_types/geometry/test_mask.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ def test_mask():
4949
gt1 = Rectangle(start=Point(x=0, y=0),
5050
end=Point(x=10, y=10)).raster(height=raster1.shape[0],
5151
width=raster1.shape[1],
52-
color=(255,255,255))
52+
color=(255, 255, 255))
5353
gt2 = Rectangle(start=Point(x=20, y=20),
5454
end=Point(x=30, y=30)).raster(height=raster2.shape[0],
5555
width=raster2.shape[1],
56-
color=(0,255,255))
56+
color=(0, 255, 255))
5757
assert (raster1 == gt1).all()
5858
assert (raster2 == gt2).all()

tests/data/annotation_types/test_annotation.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
21
import pytest
32
from pydantic import ValidationError
43

5-
from labelbox.data.annotation_types import (
6-
Text,
7-
Point,
8-
Line,
9-
ClassificationAnnotation,
10-
ObjectAnnotation,
11-
VideoClassificationAnnotation,
12-
VideoObjectAnnotation,
13-
TextEntity
14-
)
15-
4+
from labelbox.data.annotation_types import (Text, Point, Line,
5+
ClassificationAnnotation,
6+
ObjectAnnotation,
7+
VideoClassificationAnnotation,
8+
VideoObjectAnnotation, TextEntity)
169

1710

1811
def test_annotation():

tests/data/annotation_types/test_collection.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,9 @@
44
import numpy as np
55
import pytest
66

7-
from labelbox.data.annotation_types import (
8-
LabelList,
9-
LabelGenerator,
10-
ObjectAnnotation,
11-
RasterData,
12-
Line,
13-
Mask,
14-
Point,
15-
Label
16-
)
7+
from labelbox.data.annotation_types import (LabelList, LabelGenerator,
8+
ObjectAnnotation, RasterData, Line,
9+
Mask, Point, Label)
1710
from labelbox import OntologyBuilder, Tool
1811

1912

tests/data/annotation_types/test_label.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
import numpy as np
22

33
from labelbox import OntologyBuilder, Tool, Classification as OClassification, Option
4-
from labelbox.data.annotation_types import (
5-
ClassificationAnswer,
6-
Radio,
7-
Text,
8-
ClassificationAnnotation,
9-
ObjectAnnotation,
10-
Point,
11-
Line,
12-
RasterData,
13-
Label
14-
)
4+
from labelbox.data.annotation_types import (ClassificationAnswer, Radio, Text,
5+
ClassificationAnnotation,
6+
ObjectAnnotation, Point, Line,
7+
RasterData, Label)
158

169

1710
def test_schema_assignment_geometry():

0 commit comments

Comments
 (0)