Commit c37b1d4 1 parent f994feb commit c37b1d4 Copy full SHA for c37b1d4
File tree 2 files changed +30
-2
lines changed
2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -265,13 +265,25 @@ def main():
265
265
),
266
266
)
267
267
268
+ parser .add_argument (
269
+ "--tolerance-s" ,
270
+ type = float ,
271
+ default = 1e-4 ,
272
+ help = (
273
+ "Tolerance in seconds used to ensure data timestamps respect the dataset fps value"
274
+ "This is argument passed to the constructor of LeRobotDataset and maps to its tolerance_s constructor argument"
275
+ "If not given, defaults to 1e-4."
276
+ ),
277
+ )
278
+
268
279
args = parser .parse_args ()
269
280
kwargs = vars (args )
270
281
repo_id = kwargs .pop ("repo_id" )
271
282
root = kwargs .pop ("root" )
283
+ tolerance_s = kwargs .pop ("tolerance_s" )
272
284
273
285
logging .info ("Loading dataset" )
274
- dataset = LeRobotDataset (repo_id , root = root )
286
+ dataset = LeRobotDataset (repo_id , root = root , tolerance_s = tolerance_s )
275
287
276
288
visualize_dataset (dataset , ** vars (args ))
277
289
Original file line number Diff line number Diff line change @@ -446,15 +446,31 @@ def main():
446
446
help = "Delete the output directory if it exists already." ,
447
447
)
448
448
449
+ parser .add_argument (
450
+ "--tolerance-s" ,
451
+ type = float ,
452
+ default = 1e-4 ,
453
+ help = (
454
+ "Tolerance in seconds used to ensure data timestamps respect the dataset fps value"
455
+ "This is argument passed to the constructor of LeRobotDataset and maps to its tolerance_s constructor argument"
456
+ "If not given, defaults to 1e-4."
457
+ ),
458
+ )
459
+
449
460
args = parser .parse_args ()
450
461
kwargs = vars (args )
451
462
repo_id = kwargs .pop ("repo_id" )
452
463
load_from_hf_hub = kwargs .pop ("load_from_hf_hub" )
453
464
root = kwargs .pop ("root" )
465
+ tolerance_s = kwargs .pop ("tolerance_s" )
454
466
455
467
dataset = None
456
468
if repo_id :
457
- dataset = LeRobotDataset (repo_id , root = root ) if not load_from_hf_hub else get_dataset_info (repo_id )
469
+ dataset = (
470
+ LeRobotDataset (repo_id , root = root , tolerance_s = tolerance_s )
471
+ if not load_from_hf_hub
472
+ else get_dataset_info (repo_id )
473
+ )
458
474
459
475
visualize_dataset_html (dataset , ** vars (args ))
460
476
You can’t perform that action at this time.
0 commit comments