diff options
-rw-r--r-- | docs/user_guide/gaze_analysis_pipeline/recording.md (renamed from docs/user_guide/gaze_analysis_pipeline/logging.md) | 16 | ||||
-rw-r--r-- | mkdocs.yml | 2 | ||||
-rw-r--r-- | src/argaze/utils/demo/gaze_analysis_pipeline.json | 2 | ||||
-rw-r--r-- | src/argaze/utils/demo/recorders.py | 2 |
4 files changed, 13 insertions, 9 deletions
diff --git a/docs/user_guide/gaze_analysis_pipeline/logging.md b/docs/user_guide/gaze_analysis_pipeline/recording.md index 6ef3a85..72aee58 100644 --- a/docs/user_guide/gaze_analysis_pipeline/logging.md +++ b/docs/user_guide/gaze_analysis_pipeline/recording.md @@ -5,7 +5,7 @@ Record gaze analysis ## Export gaze analysis to CSV file -[ArFrame](../../argaze.md/#argaze.ArFeatures.ArFrame) and [ArLayer](../../argaze.md/#argaze.ArFeatures.ArLayer) have an *observers* attribute to enable pipeline execution recording. +[ArFrame](../../argaze.md/#argaze.ArFeatures.ArFrame) and [ArLayer](../../argaze.md/#argaze.ArFeatures.ArLayer) have an **observers** attribute to enable pipeline execution recording. Here is an extract from the JSON ArFrame configuration file where recording is enabled for the [ArFrame](../../argaze.md/#argaze.ArFeatures.ArFrame) and for one [ArLayer](../../argaze.md/#argaze.ArFeatures.ArLayer) by loaded classes from Python files: @@ -117,7 +117,7 @@ Assuming that [ArGaze.GazeAnalysis.NGram](../../argaze.md/#argaze.GazeAnalysis.N As explained in [pipeline steps visualisation chapter](visualisation.md), it is possible to get [ArFrame.image](../../argaze.md/#argaze.ArFeatures.ArFrame.image) once timestamped gaze positions have been processed by [ArFrame.look](../../argaze.md/#argaze.ArFeatures.ArFrame.look) method. -Here is the JSON ArFrame configuration file where [ArFrame](../../argaze.md/#argaze.ArFeatures.ArFrame) observers are extended with a new my_frame_logger.VideoRecorder instance: +Here is the JSON ArFrame configuration file where [ArFrame](../../argaze.md/#argaze.ArFeatures.ArFrame) observers are extended with a new my_recorders.VideoRecorder instance: ```json { @@ -125,7 +125,7 @@ Here is the JSON ArFrame configuration file where [ArFrame](../../argaze.md/#arg "size": [1920, 1080], "observers": { ... - "my_frame_logger.VideoRecorder": { + "my_recorders.FrameImageRecorder": { "path": "./video.mp4", "width": 1920, "height": 1080, @@ -135,18 +135,22 @@ Here is the JSON ArFrame configuration file where [ArFrame](../../argaze.md/#arg } ``` -Here is *my_frame_logger.py* file extended with a new VideoRecorder class: +Here is *my_recorders.py* file extended with a new VideoRecorder class: ```python ... -class VideoRecorder(DataFeatures.PipelineStepObserver, UtilsFeatures.VideoWriter): +class FrameImageRecorder(UtilsFeatures.VideoWriter): + + def __init__(self, **kwargs): + + # Init VideoWriter + super().__init__(**kwargs) def on_look(self, timestamp, ar_frame, exception): """Record frame image into video file.""" self.write(ar_frame.image()) - ``` Assuming that [ArFrame.image_parameters](../../argaze.md/#argaze.ArFeatures.ArFrame.image_parameters) are provided, ***video.mp4*** file would be created.
\ No newline at end of file @@ -11,7 +11,7 @@ nav: - user_guide/gaze_analysis_pipeline/aoi_2d_description.md - user_guide/gaze_analysis_pipeline/aoi_analysis.md - user_guide/gaze_analysis_pipeline/visualisation.md - - user_guide/gaze_analysis_pipeline/logging.md + - user_guide/gaze_analysis_pipeline/recording.md - user_guide/gaze_analysis_pipeline/heatmap.md - user_guide/gaze_analysis_pipeline/background.md - Pipeline Modules: diff --git a/src/argaze/utils/demo/gaze_analysis_pipeline.json b/src/argaze/utils/demo/gaze_analysis_pipeline.json index 291b3e1..fb8a93a 100644 --- a/src/argaze/utils/demo/gaze_analysis_pipeline.json +++ b/src/argaze/utils/demo/gaze_analysis_pipeline.json @@ -121,7 +121,7 @@ "recorders.ScanPathAnalysisRecorder": { "path": "_export/records/scan_path_metrics.csv" }, - "recorders.VideoRecorder": { + "recorders.FrameImageRecorder": { "path": "_export/records/video.mp4", "width": 1920, "height": 1080, diff --git a/src/argaze/utils/demo/recorders.py b/src/argaze/utils/demo/recorders.py index ec3baa3..0debc12 100644 --- a/src/argaze/utils/demo/recorders.py +++ b/src/argaze/utils/demo/recorders.py @@ -74,7 +74,7 @@ class ScanPathAnalysisRecorder(UtilsFeatures.FileWriter): self.write(log) -class VideoRecorder(UtilsFeatures.VideoWriter): +class FrameImageRecorder(UtilsFeatures.VideoWriter): def __init__(self, **kwargs): |