Skip to content

Commit 263b75e

Browse files
Fix some linting
1 parent e4bd408 commit 263b75e

File tree

3 files changed

+45
-154
lines changed

3 files changed

+45
-154
lines changed

tests/docs/label_cuboids_pcd_3d_basic_example.py

Lines changed: 22 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -34,37 +34,27 @@
3434
"scene-1094": {
3535
0: {
3636
"label_ref": "person_001",
37-
"coordinates": CuboidCoordinates(
38-
position=(9, 9, 9),
39-
orientation=(0.11, 0.77, 0.33),
40-
size=(0.2, 0.2, 0.2)
41-
),
37+
"coordinates": CuboidCoordinates(position=(9, 9, 9), orientation=(0.11, 0.77, 0.33), size=(0.2, 0.2, 0.2)),
4238
}
4339
},
4440
"scene-0916": {
4541
0: [
4642
{
4743
"label_ref": "person_002",
4844
"coordinates": CuboidCoordinates(
49-
position=(0.4, 0.4, 0.4),
50-
orientation=(0.0, 0.0, 0.4),
51-
size=(0.1, 0.1, 0.1)
45+
position=(0.4, 0.4, 0.4), orientation=(0.0, 0.0, 0.4), size=(0.1, 0.1, 0.1)
5246
),
5347
},
5448
{
5549
"label_ref": "person_003",
5650
"coordinates": CuboidCoordinates(
57-
position=(0.2, 0.2, 0.0),
58-
orientation=(0.0, 0.0, 0.1),
59-
size=(0.5, 0.5, 0.5)
51+
position=(0.2, 0.2, 0.0), orientation=(0.0, 0.0, 0.1), size=(0.5, 0.5, 0.5)
6052
),
6153
},
6254
{
6355
"label_ref": "person_004",
6456
"coordinates": CuboidCoordinates(
65-
position=(0.2, 0.2, 0.0),
66-
orientation=(0.0, 0.0, 0.1),
67-
size=(0.7, 0.7, 0.7)
57+
position=(0.2, 0.2, 0.0), orientation=(0.0, 0.0, 0.1), size=(0.7, 0.7, 0.7)
6858
),
6959
},
7060
],
@@ -73,34 +63,26 @@
7363
0: {
7464
"label_ref": "person_005",
7565
"coordinates": CuboidCoordinates(
76-
position=(0.4, 0.4, 0.0),
77-
orientation=(0.0, 0.0, 0.4),
78-
size=(0.12, 0.12, 0.12)
66+
position=(0.4, 0.4, 0.0), orientation=(0.0, 0.0, 0.4), size=(0.12, 0.12, 0.12)
7967
),
8068
},
8169
2: [
8270
{
8371
"label_ref": "person_006",
8472
"coordinates": CuboidCoordinates(
85-
position=(0.1, 0.1, 0.0),
86-
orientation=(0.0, 0.0, 0.2),
87-
size=(0.5, 0.5, 0.5)
73+
position=(0.1, 0.1, 0.0), orientation=(0.0, 0.0, 0.2), size=(0.5, 0.5, 0.5)
8874
),
8975
},
9076
{
9177
"label_ref": "person_007",
9278
"coordinates": CuboidCoordinates(
93-
position=(0.1, 0.1, 0.0),
94-
orientation=(0.0, 0.0, 0.2),
95-
size=(0.0132, 0.0132, 0.0132)
79+
position=(0.1, 0.1, 0.0), orientation=(0.0, 0.0, 0.2), size=(0.0132, 0.0132, 0.0132)
9680
),
9781
},
9882
{
9983
"label_ref": "person_008",
10084
"coordinates": CuboidCoordinates(
101-
position=(0.2, 0.2, 0.0),
102-
orientation=(0.0, 0.0, 0.1),
103-
size=(0.8, 0.8, 0.8)
85+
position=(0.2, 0.2, 0.0), orientation=(0.0, 0.0, 0.1), size=(0.8, 0.8, 0.8)
10486
),
10587
},
10688
],
@@ -109,34 +91,26 @@
10991
0: {
11092
"label_ref": "person_009",
11193
"coordinates": CuboidCoordinates(
112-
position=(0.4, 0.4, 0.0),
113-
orientation=(0.0, 0.0, 0.4),
114-
size=(0.012, 0.012, 0.012)
94+
position=(0.4, 0.4, 0.0), orientation=(0.0, 0.0, 0.4), size=(0.012, 0.012, 0.012)
11595
),
11696
},
11797
3: [
11898
{
11999
"label_ref": "person_010",
120100
"coordinates": CuboidCoordinates(
121-
position=(0.4, 0.4, 0.0),
122-
orientation=(0.0, 0.0, 0.4),
123-
size=(0.5, 0.5, 0.5)
101+
position=(0.4, 0.4, 0.0), orientation=(0.0, 0.0, 0.4), size=(0.5, 0.5, 0.5)
124102
),
125103
},
126104
{
127105
"label_ref": "person_011",
128106
"coordinates": CuboidCoordinates(
129-
position=(0.3, 0.3, 0.0),
130-
orientation=(0.0, 0.0, 0.3),
131-
size=(0.13, 0.13, 0.13)
107+
position=(0.3, 0.3, 0.0), orientation=(0.0, 0.0, 0.3), size=(0.13, 0.13, 0.13)
132108
),
133109
},
134110
{
135111
"label_ref": "person_012",
136112
"coordinates": CuboidCoordinates(
137-
position=(0.2, 0.2, 0.0),
138-
orientation=(0.0, 0.0, 0.1),
139-
size=(0.9, 0.9, 0.9)
113+
position=(0.2, 0.2, 0.0), orientation=(0.0, 0.0, 0.1), size=(0.9, 0.9, 0.9)
140114
),
141115
},
142116
],
@@ -146,77 +120,59 @@
146120
{
147121
"label_ref": "person_013",
148122
"coordinates": CuboidCoordinates(
149-
position=(0.5, 0.5, 0.0),
150-
orientation=(0.0, 0.0, 0.5),
151-
size=(0.11, 0.11, 0.11)
123+
position=(0.5, 0.5, 0.0), orientation=(0.0, 0.0, 0.5), size=(0.11, 0.11, 0.11)
152124
),
153125
},
154126
{
155127
"label_ref": "person_014",
156128
"coordinates": CuboidCoordinates(
157-
position=(0.2, 0.2, 0.0),
158-
orientation=(0.0, 0.0, 0.2),
159-
size=(0.6, 0.6, 0.6)
129+
position=(0.2, 0.2, 0.0), orientation=(0.0, 0.0, 0.2), size=(0.6, 0.6, 0.6)
160130
),
161131
},
162132
{
163133
"label_ref": "person_015",
164134
"coordinates": CuboidCoordinates(
165-
position=(0.2, 0.2, 0.0),
166-
orientation=(0.0, 0.0, 0.1),
167-
size=(0.8, 0.8, 0.8)
135+
position=(0.2, 0.2, 0.0), orientation=(0.0, 0.0, 0.1), size=(0.8, 0.8, 0.8)
168136
),
169137
},
170138
],
171139
14: [
172140
{
173141
"label_ref": "person_016",
174142
"coordinates": CuboidCoordinates(
175-
position=(0.5, 0.5, 0.0),
176-
orientation=(0.0, 0.0, 0.5),
177-
size=(0.3, 0.3, 0.3)
143+
position=(0.5, 0.5, 0.0), orientation=(0.0, 0.0, 0.5), size=(0.3, 0.3, 0.3)
178144
),
179145
},
180146
{
181147
"label_ref": "person_014",
182148
"coordinates": CuboidCoordinates(
183-
position=(0.2, 0.2, 0.0),
184-
orientation=(0.0, 0.0, 0.2),
185-
size=(0.6, 0.6, 0.6)
149+
position=(0.2, 0.2, 0.0), orientation=(0.0, 0.0, 0.2), size=(0.6, 0.6, 0.6)
186150
),
187151
},
188152
{
189153
"label_ref": "person_017",
190154
"coordinates": CuboidCoordinates(
191-
position=(0.2, 0.2, 0.0),
192-
orientation=(0.0, 0.0, 0.1),
193-
size=(0.8, 0.8, 0.8)
155+
position=(0.2, 0.2, 0.0), orientation=(0.0, 0.0, 0.1), size=(0.8, 0.8, 0.8)
194156
),
195157
},
196158
],
197159
15: [
198160
{
199161
"label_ref": "person_016",
200162
"coordinates": CuboidCoordinates(
201-
position=(0.5, 0.5, 0.0),
202-
orientation=(0.0, 0.0, 0.5),
203-
size=(0.1, 0.1, 0.1)
163+
position=(0.5, 0.5, 0.0), orientation=(0.0, 0.0, 0.5), size=(0.1, 0.1, 0.1)
204164
),
205165
},
206166
{
207167
"label_ref": "person_014",
208168
"coordinates": CuboidCoordinates(
209-
position=(0.2, 0.2, 0.0),
210-
orientation=(0.0, 0.0, 0.2),
211-
size=(0.6, 0.6, 0.6)
169+
position=(0.2, 0.2, 0.0), orientation=(0.0, 0.0, 0.2), size=(0.6, 0.6, 0.6)
212170
),
213171
},
214172
{
215173
"label_ref": "person_017",
216174
"coordinates": CuboidCoordinates(
217-
position=(0.2, 0.2, 0.0),
218-
orientation=(0.0, 0.0, 0.1),
219-
size=(0.8, 0.8, 0.8)
175+
position=(0.2, 0.2, 0.0), orientation=(0.0, 0.0, 0.1), size=(0.8, 0.8, 0.8)
220176
),
221177
},
222178
],
@@ -269,4 +225,4 @@
269225
with project.create_bundle(bundle_size=BUNDLE_SIZE) as bundle:
270226
for lr in label_rows_to_save:
271227
lr.save(bundle=bundle)
272-
print(f"Saved label row for {lr.data_title}")
228+
print(f"Saved label row for {lr.data_title}")

tests/docs/label_keypoints_pcd_3d_basic_example.py

Lines changed: 22 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -41,110 +41,45 @@
4141

4242
# Dictionary of labels per data unit and per frame with Point of Interest type specified, including quality options
4343
pcd_labels = {
44-
"scene-1094": {
45-
1: {
46-
"label_ref": "poi_001",
47-
"coordinates": PointCoordinate3D(x=0.01, y=0.02, z=0.03)
48-
}
49-
},
44+
"scene-1094": {1: {"label_ref": "poi_001", "coordinates": PointCoordinate3D(x=0.01, y=0.02, z=0.03)}},
5045
"scene-0916": {
5146
1: [
52-
{
53-
"label_ref": "poi_002",
54-
"coordinates": PointCoordinate3D(x=0.03, y=0.03, z=0.03)
55-
},
56-
{
57-
"label_ref": "poi_003",
58-
"coordinates": PointCoordinate3D(x=0.5, y=0.4, z=0.3)
59-
},
60-
{
61-
"label_ref": "poi_004",
62-
"coordinates": PointCoordinate3D(x=0.9, y=0.3, z=0.3)
63-
},
47+
{"label_ref": "poi_002", "coordinates": PointCoordinate3D(x=0.03, y=0.03, z=0.03)},
48+
{"label_ref": "poi_003", "coordinates": PointCoordinate3D(x=0.5, y=0.4, z=0.3)},
49+
{"label_ref": "poi_004", "coordinates": PointCoordinate3D(x=0.9, y=0.3, z=0.3)},
6450
],
6551
},
6652
"scene-0796": {
67-
0: {
68-
"label_ref": "poi_005",
69-
"coordinates": PointCoordinate3D(x=0.05, y=0.02, z=0.03)
70-
},
53+
0: {"label_ref": "poi_005", "coordinates": PointCoordinate3D(x=0.05, y=0.02, z=0.03)},
7154
2: [
72-
{
73-
"label_ref": "poi_006",
74-
"coordinates": PointCoordinate3D(x=0.3, y=0.3, z=0.3)
75-
},
76-
{
77-
"label_ref": "poi_007",
78-
"coordinates": PointCoordinate3D(x=0.4, y=0.5, z=0.3)
79-
},
80-
{
81-
"label_ref": "poi_008",
82-
"coordinates": PointCoordinate3D(x=0.11, y=0.2, z=0.3)
83-
},
55+
{"label_ref": "poi_006", "coordinates": PointCoordinate3D(x=0.3, y=0.3, z=0.3)},
56+
{"label_ref": "poi_007", "coordinates": PointCoordinate3D(x=0.4, y=0.5, z=0.3)},
57+
{"label_ref": "poi_008", "coordinates": PointCoordinate3D(x=0.11, y=0.2, z=0.3)},
8458
],
8559
},
8660
"scene-1100": {
87-
0: {
88-
"label_ref": "poi_009",
89-
"coordinates": PointCoordinate3D(x=0.1, y=0.2, z=0.3)
90-
},
61+
0: {"label_ref": "poi_009", "coordinates": PointCoordinate3D(x=0.1, y=0.2, z=0.3)},
9162
3: [
92-
{
93-
"label_ref": "poi_010",
94-
"coordinates": PointCoordinate3D(x=0.3, y=0.3, z=0.3)
95-
},
96-
{
97-
"label_ref": "poi_011",
98-
"coordinates": PointCoordinate3D(x=0.8, y=0.5, z=0.3)
99-
},
100-
{
101-
"label_ref": "poi_012",
102-
"coordinates": PointCoordinate3D(x=0.11, y=0.2, z=0.3)
103-
},
63+
{"label_ref": "poi_010", "coordinates": PointCoordinate3D(x=0.3, y=0.3, z=0.3)},
64+
{"label_ref": "poi_011", "coordinates": PointCoordinate3D(x=0.8, y=0.5, z=0.3)},
65+
{"label_ref": "poi_012", "coordinates": PointCoordinate3D(x=0.11, y=0.2, z=0.3)},
10466
],
10567
},
10668
"scene-0655": {
10769
1: [
108-
{
109-
"label_ref": "poi_013",
110-
"coordinates": PointCoordinate3D(x=0.2, y=0.1, z=0.3)
111-
},
112-
{
113-
"label_ref": "poi_014",
114-
"coordinates": PointCoordinate3D(x=0.6, y=0.6, z=0.3)
115-
},
116-
{
117-
"label_ref": "poi_015",
118-
"coordinates": PointCoordinate3D(x=0.10, y=0.1, z=0.3)
119-
},
70+
{"label_ref": "poi_013", "coordinates": PointCoordinate3D(x=0.2, y=0.1, z=0.3)},
71+
{"label_ref": "poi_014", "coordinates": PointCoordinate3D(x=0.6, y=0.6, z=0.3)},
72+
{"label_ref": "poi_015", "coordinates": PointCoordinate3D(x=0.10, y=0.1, z=0.3)},
12073
],
12174
2: [
122-
{
123-
"label_ref": "poi_016",
124-
"coordinates": PointCoordinate3D(x=0.4, y=0.1, z=0.3)
125-
},
126-
{
127-
"label_ref": "poi_014",
128-
"coordinates": PointCoordinate3D(x=0.8, y=0.5, z=0.3)
129-
},
130-
{
131-
"label_ref": "poi_017",
132-
"coordinates": PointCoordinate3D(x=0.11, y=0.2, z=0.3)
133-
},
75+
{"label_ref": "poi_016", "coordinates": PointCoordinate3D(x=0.4, y=0.1, z=0.3)},
76+
{"label_ref": "poi_014", "coordinates": PointCoordinate3D(x=0.8, y=0.5, z=0.3)},
77+
{"label_ref": "poi_017", "coordinates": PointCoordinate3D(x=0.11, y=0.2, z=0.3)},
13478
],
13579
3: [
136-
{
137-
"label_ref": "poi_016",
138-
"coordinates": PointCoordinate3D(x=0.5, y=0.2, z=0.3)
139-
},
140-
{
141-
"label_ref": "poi_014",
142-
"coordinates": PointCoordinate3D(x=0.7, y=0.4, z=0.3)
143-
},
144-
{
145-
"label_ref": "poi_017",
146-
"coordinates": PointCoordinate3D(x=0.9, y=0.3, z=0.3)
147-
},
80+
{"label_ref": "poi_016", "coordinates": PointCoordinate3D(x=0.5, y=0.2, z=0.3)},
81+
{"label_ref": "poi_014", "coordinates": PointCoordinate3D(x=0.7, y=0.4, z=0.3)},
82+
{"label_ref": "poi_017", "coordinates": PointCoordinate3D(x=0.9, y=0.3, z=0.3)},
14883
],
14984
},
15085
}
@@ -195,4 +130,4 @@
195130
with project.create_bundle(bundle_size=BUNDLE_SIZE) as bundle:
196131
for lr in label_rows_to_save:
197132
lr.save(bundle=bundle)
198-
print(f"Saved label row for {lr.data_title}")
133+
print(f"Saved label row for {lr.data_title}")

tests/docs/label_polylines_pcd_3d_basic_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,4 +332,4 @@
332332
with project.create_bundle(bundle_size=BUNDLE_SIZE) as bundle:
333333
for lr in label_rows_to_save:
334334
lr.save(bundle=bundle)
335-
print(f"Saved label row for {lr.data_title}")
335+
print(f"Saved label row for {lr.data_title}")

0 commit comments

Comments
 (0)