@@ -113,11 +113,11 @@ def transform_camera(c):
113
113
by_camera [cam_id ] = params
114
114
115
115
converted = {
116
- 'file_path' : "./images/" + c ['image_path' ].split ('/' )[- 1 ],
116
+ 'file_path' : os . path . join ( "./images" , c ['image_path' ].split ('/' )[- 1 ]) ,
117
117
"transform_matrix" : transform_camera (c ['T_pointcloud_camera' ])
118
118
}
119
119
if 'depth_image_path' in c :
120
- converted ['depth_file_path' ] = "./images/" + c ['depth_image_path' ].split ('/' )[- 1 ]
120
+ converted ['depth_file_path' ] = os . path . join ( "./images" , c ['depth_image_path' ].split ('/' )[- 1 ])
121
121
122
122
by_camera [cam_id ]['frames' ].append (converted )
123
123
@@ -390,12 +390,12 @@ def onMappingOutput(output):
390
390
391
391
oldImgName = f"{ tmp_dir } /frame_{ frameId :05} .{ args .image_format } "
392
392
newImgName = f"{ args .output } /images/frame_{ index :05} .{ args .image_format } "
393
- os . rename (oldImgName , newImgName )
393
+ shutil . move (oldImgName , newImgName )
394
394
395
395
oldDepth = f"{ tmp_dir } /depth_{ frameId :05} .png"
396
396
newDepth = f"{ args .output } /images/depth_{ index :05} .png"
397
397
if os .path .exists (oldDepth ):
398
- os . rename (oldDepth , newDepth )
398
+ shutil . move (oldDepth , newDepth )
399
399
frame ['depth_image_path' ] = f"data/{ name } /images/depth_{ index :05} .png"
400
400
401
401
if (index + 3 ) % 7 == 0 :
@@ -585,6 +585,9 @@ def detect_device_preset(input_dir):
585
585
print (f"Something went wrong! { e } " , flush = True )
586
586
raise e
587
587
588
+ # Make sure replay is closed, so that we can delete the tmp_input directory.
589
+ replay = None
590
+
588
591
try :
589
592
shutil .rmtree (tmp_dir )
590
593
except :
@@ -619,4 +622,3 @@ def parse_args():
619
622
parser = define_args (parser )
620
623
return parser .parse_args ()
621
624
process (parse_args ())
622
-
0 commit comments