Skip to content

Commit 9e138af

Browse files
Philippe RerolePhilippe Rerole
authored andcommitted
Reduced size of written numbers for 3d points
1 parent dee8fa1 commit 9e138af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kapture/io/csv.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,7 @@ def points3d_to_file(filepath: str, points3d: kapture.Points3d) -> None:
12241224
os.makedirs(path.dirname(filepath), exist_ok=True)
12251225
saving_start = datetime.datetime.now()
12261226
header = KAPTURE_FORMAT_1[2:] + kapture_linesep + 'X, Y, Z, R, G, B'
1227-
np.savetxt(filepath, points3d.as_array(), delimiter=',', header=header)
1227+
np.savetxt(filepath, points3d.as_array(), delimiter=',', header=header, fmt='%.10f')
12281228
saving_elapsed = datetime.datetime.now() - saving_start
12291229
logger.debug(f'wrote {len(points3d):12,d} {type(points3d)} in {saving_elapsed.total_seconds():.3f} seconds'
12301230
.replace(',', ' '))
@@ -1240,7 +1240,7 @@ def points3d_from_file(filepath: str) -> kapture.Points3d:
12401240

12411241
loading_start = datetime.datetime.now()
12421242
data = np.loadtxt(filepath, dtype=np.float, delimiter=',', comments='#')
1243-
data = data.reshape((-1, 6)) # make sure of the shape, even if single line file.
1243+
data = data.reshape((-1, kapture.Points3d.XYZRGB)) # make sure of the shape, even if single line file.
12441244
loading_elapsed = datetime.datetime.now() - loading_start
12451245
logger.debug(f'{len(data):12,d} {kapture.Points3d} in {loading_elapsed.total_seconds():.3f} seconds')
12461246
return kapture.Points3d(data)

0 commit comments

Comments
 (0)