46
46
import time
47
47
from copy import deepcopy
48
48
import logging , logging .handlers
49
+ from datetime import datetime
49
50
50
51
51
52
## AUTHORSHIP INFORMATION
@@ -193,11 +194,13 @@ def calibration(config=None):
193
194
194
195
# Set up logging
195
196
setup_logging (session_dir )
197
+ currentDateAndTime = datetime .now ()
196
198
197
199
# Run calibration
198
200
calib_dir = [os .path .join (session_dir , c ) for c in os .listdir (session_dir ) if ('Calib' or 'calib' ) in c ][0 ]
199
201
logging .info ("\n \n ---------------------------------------------------------------------" )
200
202
logging .info ("Camera calibration" )
203
+ logging .info (f"On { currentDateAndTime .strftime ('%A %d. %B %Y, %H:%M:%S' )} " )
201
204
logging .info ("---------------------------------------------------------------------" )
202
205
logging .info (f"\n Calibration directory: { calib_dir } " )
203
206
start = time .time ()
@@ -231,18 +234,20 @@ def poseEstimation(config=None):
231
234
232
235
# # Set up logging
233
236
# session_dir = os.path.realpath(os.path.join(config_dicts[0].get('project').get('project_dir'), '..', '..'))
234
- # setup_logging(session_dir)
237
+ # setup_logging(session_dir)
235
238
236
239
# # Batch process all trials
237
240
# for config_dict in config_dicts:
238
241
# start = time.time()
242
+ # currentDateAndTime = datetime.now()
239
243
# project_dir = os.path.realpath(config_dict.get('project').get('project_dir'))
240
244
# seq_name = os.path.basename(project_dir)
241
245
# frame_range = config_dict.get('project').get('frame_range')
242
246
# frames = ["all frames" if frame_range == [] else f"frames {frame_range[0]} to {frame_range[1]}"][0]
243
247
244
248
# logging.info("\n\n---------------------------------------------------------------------")
245
- # logging.info("Camera synchronization")
249
+ # logging.info("Pose estimation")
250
+ # logging.info(f"On {currentDateAndTime.strftime('%A %d. %B %Y, %H:%M:%S')}")
246
251
# logging.info("---------------------------------------------------------------------")
247
252
# logging.info(f"\nProject directory: {project_dir}")
248
253
@@ -280,13 +285,15 @@ def synchronization(config=None):
280
285
# # Batch process all trials
281
286
# for config_dict in config_dicts:
282
287
# start = time.time()
288
+ # currentDateAndTime = datetime.now()
283
289
# project_dir = os.path.realpath(config_dict.get('project').get('project_dir'))
284
290
# seq_name = os.path.basename(project_dir)
285
291
# frame_range = config_dict.get('project').get('frame_range')
286
292
# frames = ["all frames" if frame_range == [] else f"frames {frame_range[0]} to {frame_range[1]}"][0]
287
293
288
294
# logging.info("\n\n---------------------------------------------------------------------")
289
295
# logging.info("Camera synchronization")
296
+ # logging.info(f"On {currentDateAndTime.strftime('%A %d. %B %Y, %H:%M:%S')}")
290
297
# logging.info("---------------------------------------------------------------------")
291
298
# logging.info(f"\nProject directory: {project_dir}")
292
299
@@ -324,13 +331,15 @@ def personAssociation(config=None):
324
331
# Batch process all trials
325
332
for config_dict in config_dicts :
326
333
start = time .time ()
334
+ currentDateAndTime = datetime .now ()
327
335
project_dir = os .path .realpath (config_dict .get ('project' ).get ('project_dir' ))
328
336
seq_name = os .path .basename (project_dir )
329
337
frame_range = config_dict .get ('project' ).get ('frame_range' )
330
338
frames = ["all frames" if frame_range == [] else f"frames { frame_range [0 ]} to { frame_range [1 ]} " ][0 ]
331
339
332
340
logging .info ("\n \n ---------------------------------------------------------------------" )
333
341
logging .info (f"Associating persons for { seq_name } , for { frames } ." )
342
+ logging .info (f"On { currentDateAndTime .strftime ('%A %d. %B %Y, %H:%M:%S' )} " )
334
343
logging .info ("---------------------------------------------------------------------" )
335
344
logging .info (f"\n Project directory: { project_dir } " )
336
345
@@ -367,13 +376,15 @@ def triangulation(config=None):
367
376
# Batch process all trials
368
377
for config_dict in config_dicts :
369
378
start = time .time ()
379
+ currentDateAndTime = datetime .now ()
370
380
project_dir = os .path .realpath (config_dict .get ('project' ).get ('project_dir' ))
371
381
seq_name = os .path .basename (project_dir )
372
382
frame_range = config_dict .get ('project' ).get ('frame_range' )
373
383
frames = ["all frames" if frame_range == [] else f"frames { frame_range [0 ]} to { frame_range [1 ]} " ][0 ]
374
384
375
385
logging .info ("\n \n ---------------------------------------------------------------------" )
376
386
logging .info (f"Triangulation of 2D points for { seq_name } , for { frames } ." )
387
+ logging .info (f"On { currentDateAndTime .strftime ('%A %d. %B %Y, %H:%M:%S' )} " )
377
388
logging .info ("---------------------------------------------------------------------" )
378
389
logging .info (f"\n Project directory: { project_dir } " )
379
390
@@ -413,13 +424,15 @@ def filtering(config=None):
413
424
414
425
# Batch process all trials
415
426
for config_dict in config_dicts :
427
+ currentDateAndTime = datetime .now ()
416
428
project_dir = os .path .realpath (config_dict .get ('project' ).get ('project_dir' ))
417
429
seq_name = os .path .basename (project_dir )
418
430
frame_range = config_dict .get ('project' ).get ('frame_range' )
419
431
frames = ["all frames" if frame_range == [] else f"frames { frame_range [0 ]} to { frame_range [1 ]} " ][0 ]
420
432
421
433
logging .info ("\n \n ---------------------------------------------------------------------" )
422
434
logging .info (f"Filtering 3D coordinates for { seq_name } , for { frames } ." )
435
+ logging .info (f"On { currentDateAndTime .strftime ('%A %d. %B %Y, %H:%M:%S' )} " )
423
436
logging .info ("---------------------------------------------------------------------" )
424
437
logging .info (f"\n Project directory: { project_dir } \n " )
425
438
@@ -450,13 +463,15 @@ def markerAugmentation(config=None):
450
463
451
464
for config_dict in config_dicts :
452
465
start = time .time ()
466
+ currentDateAndTime = datetime .now ()
453
467
project_dir = os .path .realpath (config_dict .get ('project' ).get ('project_dir' ))
454
468
seq_name = os .path .basename (project_dir )
455
469
frame_range = config_dict .get ('project' ).get ('frame_range' )
456
470
frames = ["all frames" if frame_range == [] else f"frames { frame_range [0 ]} to { frame_range [1 ]} " ][0 ]
457
471
458
472
logging .info ("\n \n ---------------------------------------------------------------------" )
459
473
logging .info (f"Augmentation process for { seq_name } , for { frames } ." )
474
+ logging .info (f"On { currentDateAndTime .strftime ('%A %d. %B %Y, %H:%M:%S' )} " )
460
475
logging .info ("---------------------------------------------------------------------" )
461
476
logging .info (f"\n Project directory: { project_dir } \n " )
462
477
@@ -466,7 +481,6 @@ def markerAugmentation(config=None):
466
481
logging .info (f'\n Augmentation took { end - start :.2f} s.' )
467
482
468
483
469
-
470
484
def opensimProcessing (config = None ):
471
485
'''
472
486
Uses OpenSim to run scaling based on a static trc pose
@@ -497,6 +511,7 @@ def opensimProcessing(config=None):
497
511
498
512
# # Batch process all trials
499
513
# for config_dict in config_dicts:
514
+ # currentDateAndTime = datetime.now()
500
515
# start = time.time()
501
516
# project_dir = os.path.realpath(config_dict.get('project').get('project_dir'))
502
517
# seq_name = os.path.basename(project_dir)
@@ -508,6 +523,7 @@ def opensimProcessing(config=None):
508
523
# # logging.info(f"Scaling model with <STATIC TRC FILE>.")
509
524
# # else:
510
525
# # logging.info(f"Running inverse kinematics <MOTION TRC FILE>.")
526
+ # logging.info(f"On {currentDateAndTime.strftime('%A %d. %B %Y, %H:%M:%S')}")
511
527
# logging.info("---------------------------------------------------------------------")
512
528
# logging.info(f"\nOpenSim output directory: {project_dir}")
513
529
0 commit comments