diff options
author | Théo de la Hogue | 2023-09-13 22:16:28 +0200 |
---|---|---|
committer | Théo de la Hogue | 2023-09-13 22:16:28 +0200 |
commit | 49c52f1e23fa4402a996c9c2baa81f807ed7eeb3 (patch) | |
tree | cf2e77cce25eafb92263ead32801851034ceeb43 | |
parent | b754fdd9f3c74bad33f4a3952268c99ce49c5193 (diff) | |
download | argaze-49c52f1e23fa4402a996c9c2baa81f807ed7eeb3.zip argaze-49c52f1e23fa4402a996c9c2baa81f807ed7eeb3.tar.gz argaze-49c52f1e23fa4402a996c9c2baa81f807ed7eeb3.tar.bz2 argaze-49c52f1e23fa4402a996c9c2baa81f807ed7eeb3.tar.xz |
Fixing aois_coverage processing.
-rw-r--r-- | src/argaze/GazeAnalysis/DeviationCircleCoverage.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/argaze/GazeAnalysis/DeviationCircleCoverage.py b/src/argaze/GazeAnalysis/DeviationCircleCoverage.py index 22da916..db707c0 100644 --- a/src/argaze/GazeAnalysis/DeviationCircleCoverage.py +++ b/src/argaze/GazeAnalysis/DeviationCircleCoverage.py @@ -33,8 +33,8 @@ class AOIMatcher(GazeFeatures.AOIMatcher): self.__look_count = 0 self.__looked_aoi_data = (None, None) - self.__looked_aoi_coverage_mean = 0 - self.__looked_aoi_coverage = {} + self.__circle_ratio_sum = {} + self.__aois_coverages = {} self.__matched_gaze_movement = None self.__matched_region = None @@ -59,16 +59,16 @@ class AOIMatcher(GazeFeatures.AOIMatcher): # Sum circle ratio to update aoi coverage try: - self.__looked_aoi_coverage[name] += circle_ratio + self.__circle_ratio_sum[name] += circle_ratio except KeyError: - self.__looked_aoi_coverage[name] = circle_ratio + self.__circle_ratio_sum[name] = circle_ratio # Update maximal coverage and most likely looked aoi - if self.__looked_aoi_coverage[name] > max_coverage: + if self.__circle_ratio_sum[name] > max_coverage: - max_coverage = self.__looked_aoi_coverage[name] + max_coverage = self.__circle_ratio_sum[name] most_likely_looked_aoi_data = (name, aoi) matched_region = region @@ -78,12 +78,12 @@ class AOIMatcher(GazeFeatures.AOIMatcher): # Update looked aoi data self.__looked_aoi_data = most_likely_looked_aoi_data - # Update all looked aoi coverage means + # Calculate looked aoi circle ratio means self.__aois_coverages = {} - for aoi_name, coverage in self.__looked_aoi_coverage.items(): + for aoi_name, circle_ratio_sum in self.__circle_ratio_sum.items(): - self.__aois_coverages[aoi_name] = int(100 * coverage / self.__look_count) / 100 + self.__aois_coverages[aoi_name] = int(100 * circle_ratio_sum / self.__look_count) / 100 # Update matched gaze movement self.__matched_gaze_movement = gaze_movement |