diff options
author | Théo de la Hogue | 2024-04-26 04:04:26 +0200 |
---|---|---|
committer | Théo de la Hogue | 2024-04-26 04:04:26 +0200 |
commit | 693155cbfa4e970c5b39bab9d0865a9215bbb0b1 (patch) | |
tree | 7a244430b35661945f364fd3fc822aaea5038b83 /src | |
parent | b7f531e212f4c7d07df2739de22392829ea45737 (diff) | |
download | argaze-693155cbfa4e970c5b39bab9d0865a9215bbb0b1.zip argaze-693155cbfa4e970c5b39bab9d0865a9215bbb0b1.tar.gz argaze-693155cbfa4e970c5b39bab9d0865a9215bbb0b1.tar.bz2 argaze-693155cbfa4e970c5b39bab9d0865a9215bbb0b1.tar.xz |
Working around plotting demonstration.
Diffstat (limited to 'src')
-rw-r--r-- | src/argaze/utils/demo/plotters.py | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/src/argaze/utils/demo/plotters.py b/src/argaze/utils/demo/plotters.py index 53c35aa..48380f1 100644 --- a/src/argaze/utils/demo/plotters.py +++ b/src/argaze/utils/demo/plotters.py @@ -22,31 +22,14 @@ import logging from argaze import DataFeatures, GazeFeatures from argaze.utils import UtilsFeatures -@DataFeatures.timestamp -@DataFeatures.metrics -class ScanPathMetrics: - - duration: float - """Path duration (ms)""" - - steps: int - """Number of steps""" - - k: float - """K Coefficient""" - - nni: float - """Nearest Neighbor Index""" - - xxr: float - """Explore / Exploit ratio""" +import pandas class ScanPathAnalysisPlotter(DataFeatures.PipelineStepObject): @DataFeatures.PipelineStepInit def __init__(self, **kwargs): - self.__ts_metrics = DataFeatures.TimestampedObjectsList(ScanPathMetrics) + self.__ts_metrics = pandas.Dataframe() def on_look(self, timestamp, frame, exception): """Plot frame scan path metrics.""" @@ -55,19 +38,19 @@ class ScanPathAnalysisPlotter(DataFeatures.PipelineStepObject): analysis = frame.analysis() - metrics = ScanPathMetrics( - 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, - timestamp=timestamp - ) + metrics = { + "Timestamp (ms)": timestamp, + "Path duration (ms)": analysis['argaze.GazeAnalysis.Basic.ScanPathAnalyzer'].path_duration, + "Number of steps": analysis['argaze.GazeAnalysis.Basic.ScanPathAnalyzer'].steps_number, + "K Coefficient": analysis['argaze.GazeAnalysis.KCoefficient.ScanPathAnalyzer'].K, + "Nearest Neighbor Index": analysis['argaze.GazeAnalysis.NearestNeighborIndex.ScanPathAnalyzer'].nearest_neighbor_index, + "Explore / Exploit ratio": analysis['argaze.GazeAnalysis.ExploreExploitRatio.ScanPathAnalyzer'].explore_exploit_ratio + } self.__ts_metrics.append(metrics) # DEBUG - print(self.__ts_metrics.as_dataframe()) + print(self.__ts_metrics) ''' class AOIScanPathAnalysisPlotter(UtilsFeatures.FileWriter): |