Skip to content

Commit

Permalink
fix: fix conversion in key point and keyline 3d (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisochoatri committed Aug 6, 2024
1 parent d5a9a9d commit f70196d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dgp/utils/structures/key_line_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,6 @@ def to_proto(self):
As defined in `proto/annotations.proto`
"""
return [
annotations_pb2.KeyPoint3D(x=int(self.x[j]), y=int(self.y[j]), z=int(self.z[j]))
annotations_pb2.KeyPoint3D(x=float(self.x[j]), y=float(self.y[j]), z=float(self.z[j]))
for j, _ in enumerate(self.x)
]
2 changes: 1 addition & 1 deletion dgp/utils/structures/key_point_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ def to_proto(self):
KeyPoint3D.pb2
As defined in `proto/annotations.proto`
"""
return annotations_pb2.KeyPoint3D(x=int(self.x), y=int(self.y), z=int(self.z))
return annotations_pb2.KeyPoint3D(x=float(self.x), y=float(self.y), z=float(self.z))
4 changes: 2 additions & 2 deletions tests/annotation/test_key_line_3d_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_kl3d_annotation(kl_ontology):

def test_kl3d_load(kl_ontology):
DGP_TEST_DATASET_DIR = os.path.join(TEST_DATA_DIR, "dgp")
expected_output = "ac354"
expected_output = "a28b1"
scenes_dataset_json = os.path.join(
DGP_TEST_DATASET_DIR,
"key_line_3d/scene_000000/key_line_3d/lcm_25tm/000000000000000005_21e2436af96fb6388eb0c64cc029cfdc928a3e95.json"
Expand Down Expand Up @@ -63,6 +63,6 @@ def test_kl3d_save(kl_ontology):
)
kl3d_list = KeyLine3DAnnotationList.load(scenes_dataset_json, kl_ontology)
kl3d_list.save(".")
filepath = "./ac35449091ebdd374aaa743be74794db561ec86a.json"
filepath = "./a28b1cd7793c14d5ddae40d6a2065576f9856976.json"
assert os.path.exists(filepath)
os.remove(filepath)

0 comments on commit f70196d

Please sign in to comment.