Skip to content

Commit f70196d

Browse files
fix: fix conversion in key point and keyline 3d (#167)
1 parent d5a9a9d commit f70196d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

dgp/utils/structures/key_line_3d.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,6 @@ def to_proto(self):
9595
As defined in `proto/annotations.proto`
9696
"""
9797
return [
98-
annotations_pb2.KeyPoint3D(x=int(self.x[j]), y=int(self.y[j]), z=int(self.z[j]))
98+
annotations_pb2.KeyPoint3D(x=float(self.x[j]), y=float(self.y[j]), z=float(self.z[j]))
9999
for j, _ in enumerate(self.x)
100100
]

dgp/utils/structures/key_point_3d.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,4 @@ def to_proto(self):
9191
KeyPoint3D.pb2
9292
As defined in `proto/annotations.proto`
9393
"""
94-
return annotations_pb2.KeyPoint3D(x=int(self.x), y=int(self.y), z=int(self.z))
94+
return annotations_pb2.KeyPoint3D(x=float(self.x), y=float(self.y), z=float(self.z))

tests/annotation/test_key_line_3d_annotation.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_kl3d_annotation(kl_ontology):
3535

3636
def test_kl3d_load(kl_ontology):
3737
DGP_TEST_DATASET_DIR = os.path.join(TEST_DATA_DIR, "dgp")
38-
expected_output = "ac354"
38+
expected_output = "a28b1"
3939
scenes_dataset_json = os.path.join(
4040
DGP_TEST_DATASET_DIR,
4141
"key_line_3d/scene_000000/key_line_3d/lcm_25tm/000000000000000005_21e2436af96fb6388eb0c64cc029cfdc928a3e95.json"
@@ -63,6 +63,6 @@ def test_kl3d_save(kl_ontology):
6363
)
6464
kl3d_list = KeyLine3DAnnotationList.load(scenes_dataset_json, kl_ontology)
6565
kl3d_list.save(".")
66-
filepath = "./ac35449091ebdd374aaa743be74794db561ec86a.json"
66+
filepath = "./a28b1cd7793c14d5ddae40d6a2065576f9856976.json"
6767
assert os.path.exists(filepath)
6868
os.remove(filepath)

0 commit comments

Comments
 (0)