aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThéo de la Hogue2024-04-03 14:44:02 +0200
committerThéo de la Hogue2024-04-03 14:44:02 +0200
commitcb3883ccdae38609517bdac3b01947f6200b91ab (patch)
tree96f4f636922c5eddc585fd3ba191e61129540bd7 /src
parent1877b05e292172e7507901b11b2460eb99923ce1 (diff)
downloadargaze-cb3883ccdae38609517bdac3b01947f6200b91ab.zip
argaze-cb3883ccdae38609517bdac3b01947f6200b91ab.tar.gz
argaze-cb3883ccdae38609517bdac3b01947f6200b91ab.tar.bz2
argaze-cb3883ccdae38609517bdac3b01947f6200b91ab.tar.xz
Renaming log notion into record notion.
Diffstat (limited to 'src')
-rw-r--r--src/argaze/__main__.py7
-rw-r--r--src/argaze/utils/demo/gaze_analysis_pipeline.json16
-rw-r--r--src/argaze/utils/demo/recorders.py (renamed from src/argaze/utils/demo/loggers.py)25
3 files changed, 26 insertions, 22 deletions
diff --git a/src/argaze/__main__.py b/src/argaze/__main__.py
index 0682583..0184d69 100644
--- a/src/argaze/__main__.py
+++ b/src/argaze/__main__.py
@@ -21,7 +21,7 @@ import logging
import contextlib
from .DataFeatures import from_json
-from .ArFeatures import ArCamera
+from .ArFeatures import ArCamera, ArContext
import cv2
@@ -38,6 +38,11 @@ logging.basicConfig(format = '%(levelname)s: %(message)s', level = logging.DEBUG
# Load context from JSON file
with from_json(args.context_file) as context:
+ # Loaded object must be a subclass of ArContext
+ if not issubclass(type(context), ArContext):
+
+ raise TypeError('Loaded object is not a subclass of ArContext')
+
if args.verbose:
print(context)
diff --git a/src/argaze/utils/demo/gaze_analysis_pipeline.json b/src/argaze/utils/demo/gaze_analysis_pipeline.json
index 0d1062b..291b3e1 100644
--- a/src/argaze/utils/demo/gaze_analysis_pipeline.json
+++ b/src/argaze/utils/demo/gaze_analysis_pipeline.json
@@ -49,8 +49,8 @@
"argaze.GazeAnalysis.Entropy.AOIScanPathAnalyzer":{}
},
"observers": {
- "loggers.AOIScanPathAnalysisLogger": {
- "path": "_export/logs/aoi_scan_path_metrics.csv"
+ "recorders.AOIScanPathAnalysisRecorder": {
+ "path": "_export/records/aoi_scan_path_metrics.csv"
}
}
}
@@ -115,14 +115,14 @@
}
},
"observers": {
- "loggers.FixationLogger": {
- "path": "_export/logs/fixations.csv"
+ "recorders.FixationRecorder": {
+ "path": "_export/records/fixations.csv"
},
- "loggers.ScanPathAnalysisLogger": {
- "path": "_export/logs/scan_path_metrics.csv"
+ "recorders.ScanPathAnalysisRecorder": {
+ "path": "_export/records/scan_path_metrics.csv"
},
- "loggers.VideoRecorder": {
- "path": "_export/logs/video.mp4",
+ "recorders.VideoRecorder": {
+ "path": "_export/records/video.mp4",
"width": 1920,
"height": 1080,
"fps": 15
diff --git a/src/argaze/utils/demo/loggers.py b/src/argaze/utils/demo/recorders.py
index 25b55d3..75bca70 100644
--- a/src/argaze/utils/demo/loggers.py
+++ b/src/argaze/utils/demo/recorders.py
@@ -19,10 +19,9 @@ __license__ = "GPLv3"
import logging
from argaze import DataFeatures, GazeFeatures
-from argaze.GazeAnalysis import *
from argaze.utils import UtilsFeatures
-class FixationLogger(UtilsFeatures.FileWriter):
+class FixationRecorder(UtilsFeatures.FileWriter):
def __init__(self, **kwargs):
@@ -47,7 +46,7 @@ class FixationLogger(UtilsFeatures.FileWriter):
self.write(log)
-class ScanPathAnalysisLogger(UtilsFeatures.FileWriter):
+class ScanPathAnalysisRecorder(UtilsFeatures.FileWriter):
def __init__(self, **kwargs):
@@ -66,11 +65,11 @@ class ScanPathAnalysisLogger(UtilsFeatures.FileWriter):
log = (
timestamp,
- analysis[Basic.ScanPathAnalyzer].path_duration,
- analysis[Basic.ScanPathAnalyzer].steps_number,
- analysis[KCoefficient.ScanPathAnalyzer].K,
- analysis[NearestNeighborIndex.ScanPathAnalyzer].nearest_neighbor_index,
- analysis[ExploreExploitRatio.ScanPathAnalyzer].explore_exploit_ratio
+ analysis['argaze.GazeAnalysis.Basic.ScanPathAnalyzer'].path_duration,
+ analysis['argaze.GazeAnalysis.Basic.ScanPathAnalyzer'].steps_number,
+ analysis['argaze.GazeAnalysis.KCoefficient.ScanPathAnalyzer'].K,
+ analysis['argaze.GazeAnalysis.NearestNeighborIndex.ScanPathAnalyzer'].nearest_neighbor_index,
+ analysis['argaze.GazeAnalysis.ExploreExploitRatio.ScanPathAnalyzer'].explore_exploit_ratio
)
self.write(log)
@@ -88,7 +87,7 @@ class VideoRecorder(UtilsFeatures.VideoWriter):
self.write(frame.image())
-class AOIScanPathAnalysisLogger(UtilsFeatures.FileWriter):
+class AOIScanPathAnalysisRecorder(UtilsFeatures.FileWriter):
def __init__(self, **kwargs):
@@ -107,10 +106,10 @@ class AOIScanPathAnalysisLogger(UtilsFeatures.FileWriter):
log = (
timestamp,
- analysis[Basic.AOIScanPathAnalyzer].path_duration,
- analysis[Basic.AOIScanPathAnalyzer].steps_number,
- analysis[KCoefficient.AOIScanPathAnalyzer].K,
- analysis[LempelZivComplexity.AOIScanPathAnalyzer].lempel_ziv_complexity
+ analysis['argaze.GazeAnalysis.Basic.AOIScanPathAnalyzer'].path_duration,
+ analysis['argaze.GazeAnalysis.Basic.AOIScanPathAnalyzer'].steps_number,
+ analysis['argaze.GazeAnalysis.KCoefficient.AOIScanPathAnalyzer'].K,
+ analysis['argaze.GazeAnalysis.LempelZivComplexity.AOIScanPathAnalyzer'].lempel_ziv_complexity
)
self.write(log)