diff options
author | Théo de la Hogue | 2022-04-11 12:12:49 +0200 |
---|---|---|
committer | Théo de la Hogue | 2022-04-11 12:12:49 +0200 |
commit | 4606bf24e8dda01b626e510b5263db144dbcc74c (patch) | |
tree | 2e8e763b796c579631a9be5c94c56773e2ade12e /src | |
parent | c3150ecc28960112d9201fdf952aa6bc60b9323d (diff) | |
download | argaze-4606bf24e8dda01b626e510b5263db144dbcc74c.zip argaze-4606bf24e8dda01b626e510b5263db144dbcc74c.tar.gz argaze-4606bf24e8dda01b626e510b5263db144dbcc74c.tar.bz2 argaze-4606bf24e8dda01b626e510b5263db144dbcc74c.tar.xz |
Fixing export_tobii_segment_fixations.py output path management
Diffstat (limited to 'src')
-rw-r--r-- | src/argaze/utils/export_tobii_segment_fixations.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/argaze/utils/export_tobii_segment_fixations.py b/src/argaze/utils/export_tobii_segment_fixations.py index c20fe5d..7420d66 100644 --- a/src/argaze/utils/export_tobii_segment_fixations.py +++ b/src/argaze/utils/export_tobii_segment_fixations.py @@ -24,9 +24,18 @@ def main(): if args.segment_path != None: # manage destination path - if not os.path.exists(os.path.dirname(args.output)): - os.makedirs(os.path.dirname(args.output)) - print(f'{os.path.dirname(args.output)} folder created') + if args.output != None: + + if not os.path.exists(os.path.dirname(args.output)): + + os.makedirs(os.path.dirname(args.output)) + print(f'{os.path.dirname(args.output)} folder created') + + fixations_filepath = args.output + + else: + + fixations_filepath = f'{args.segment_path}/fixations.json' # Load a tobii segment tobii_segment = TobiiEntities.TobiiSegment(args.segment_path) @@ -44,10 +53,6 @@ def main(): print(f'{len(tobii_ts_gaze_positions)} gaze positions loaded') - # Access to video timestamp index - tobii_vts = tobii_segment_data.vts - print(f'{len(tobii_vts)} video timestamps loaded') - # Format tobii gaze data into generic gaze data and store them using millisecond unit timestamp generic_ts_gaze_positions = GazeFeatures.TimeStampedGazePositions() @@ -63,12 +68,8 @@ def main(): print(f'{len(fixation_analyser.fixations)} fixations found') # Export fixations analysis results - if args.output != None: - fixations_filepath = args.output - else: - fixations_filepath = f'{args.segment_path}/fixations.json' - fixation_analyser.fixations.export_as_json(fixations_filepath) + print(f'Fixations saved into {fixations_filepath}') if __name__ == '__main__': |