diff options
author | Théo de la Hogue | 2023-07-03 14:54:54 +0200 |
---|---|---|
committer | Théo de la Hogue | 2023-07-03 14:54:54 +0200 |
commit | 1289fda53815f28aee35279c00a70334afe24aab (patch) | |
tree | 62f016f275bbc96b16ce305e58363c64107aa460 | |
parent | 2226797a1d89c326e278b881e4eb5dc22c8aa838 (diff) | |
download | argaze-1289fda53815f28aee35279c00a70334afe24aab.zip argaze-1289fda53815f28aee35279c00a70334afe24aab.tar.gz argaze-1289fda53815f28aee35279c00a70334afe24aab.tar.bz2 argaze-1289fda53815f28aee35279c00a70334afe24aab.tar.xz |
Removing useless lock. Displaying only 3-Gram.
-rw-r--r-- | src/argaze/utils/demo_gaze_features_run.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/argaze/utils/demo_gaze_features_run.py b/src/argaze/utils/demo_gaze_features_run.py index 6ec4c97..e30f867 100644 --- a/src/argaze/utils/demo_gaze_features_run.py +++ b/src/argaze/utils/demo_gaze_features_run.py @@ -10,7 +10,6 @@ __license__ = "BSD" import argparse import os import time -import threading import queue from argaze import ArFeatures, GazeFeatures @@ -43,11 +42,8 @@ def main(): cv2.namedWindow(ar_screen.name, cv2.WINDOW_AUTOSIZE) # Heatmap buffer display option - clear_heatmap = False enable_heatmap_buffer = False - ar_screen_lock = threading.Lock() - # Init timestamp start_time = time.time() @@ -192,13 +188,14 @@ def main(): ngram_analyzer = ar_screen.aoi_scan_path_analyzers["NGram"] - start = ar_screen.size[1] - ((len(ngram_analyzer.ngrams_count) + 1) * 40) - cv2.putText(image, f'{ngram_analyzer.n}-Gram:', (ar_screen.size[0]-700, start-40), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 255), 1, cv2.LINE_AA) + # Display only 3-gram analysis + start = ar_screen.size[1] - ((len(ngram_analyzer.ngrams_count[3]) + 1) * 40) + cv2.putText(image, f'{ngram_analyzer.n_max}-Gram:', (ar_screen.size[0]-700, start-40), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 255), 1, cv2.LINE_AA) - for i, (ngram, count) in enumerate(ngram_analyzer.ngrams_count.items()): + for i, (ngram, count) in enumerate(ngram_analyzer.ngrams_count[3].items()): ngram_string = f'{ngram[0]}' - for g in range(1, ngram_analyzer.n): + for g in range(1, 3): ngram_string += f'>{ngram[g]}' cv2.putText(image, f'{ngram_string}: {count}', (ar_screen.size[0]-700, start+(i*40)), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 255), 1, cv2.LINE_AA) |