aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThéo de la Hogue2024-06-21 06:19:24 +0200
committerThéo de la Hogue2024-06-21 06:19:24 +0200
commit12ad13f1ed456a009b050e1dd6e31808d9b77cbb (patch)
tree3a1602e80e556d33df37baeab2d3f5ef2bb283c6
parent30696d92fff568c68475f578b366d8b820ed8bb9 (diff)
downloadargaze-12ad13f1ed456a009b050e1dd6e31808d9b77cbb.zip
argaze-12ad13f1ed456a009b050e1dd6e31808d9b77cbb.tar.gz
argaze-12ad13f1ed456a009b050e1dd6e31808d9b77cbb.tar.bz2
argaze-12ad13f1ed456a009b050e1dd6e31808d9b77cbb.tar.xz
Drawing pipeline visualization time.
-rw-r--r--src/argaze/ArFeatures.py4
-rw-r--r--src/argaze/ArUcoMarker/ArUcoCamera.py1
2 files changed, 3 insertions, 2 deletions
diff --git a/src/argaze/ArFeatures.py b/src/argaze/ArFeatures.py
index d1fbfad..832f970 100644
--- a/src/argaze/ArFeatures.py
+++ b/src/argaze/ArFeatures.py
@@ -798,6 +798,7 @@ class ArFrame(DataFeatures.SharedObject, DataFeatures.PipelineStepObject):
self.__identified_gaze_movement = GazeFeatures.GazeMovement()
@DataFeatures.PipelineStepImage
+ @DataFeatures.PipelineStepExecutionTime
def image(self, background_weight: float = None, heatmap_weight: float = None, draw_gaze_position_calibrator: dict = None, draw_scan_path: dict = None, draw_layers: dict = None, draw_gaze_positions: dict = None, draw_fixations: dict = None, draw_saccades: dict = None) -> numpy.array:
"""
Get background image with overlaid visualizations.
@@ -1620,7 +1621,6 @@ class ArContext(DataFeatures.PipelineStepObject):
raise (TypeError('Pipeline is not ArCamera instance.'))
@DataFeatures.PipelineStepImage
- @DataFeatures.PipelineStepExecutionTime
def image(self, draw_pipeline: bool = True, draw_times: bool = True, draw_exceptions: bool = True):
"""
Get pipeline image with execution information.
@@ -1681,7 +1681,7 @@ class ArContext(DataFeatures.PipelineStepObject):
cv2.putText(image, f'Look {time*1e3:.2f}ms at {frequency:.0f}Hz', (20, info_stack * 40), cv2.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 255), 1, cv2.LINE_AA)
# Draw visualization time
- time, frequency = time, frequency = self.execution_info('image')
+ time, frequency = time, frequency = self.__pipeline.execution_info('image')
info_stack += 1
cv2.putText(image, f'Visualization {time*1e3:.0f}ms at {frequency:.0f}Hz', (20, info_stack * 40), cv2.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 255), 1, cv2.LINE_AA)
diff --git a/src/argaze/ArUcoMarker/ArUcoCamera.py b/src/argaze/ArUcoMarker/ArUcoCamera.py
index 215fec6..34ad57a 100644
--- a/src/argaze/ArUcoMarker/ArUcoCamera.py
+++ b/src/argaze/ArUcoMarker/ArUcoCamera.py
@@ -197,6 +197,7 @@ class ArUcoCamera(ArFeatures.ArCamera):
raise e
@DataFeatures.PipelineStepImage
+ @DataFeatures.PipelineStepExecutionTime
def image(self, draw_detected_markers: dict = None, draw_scenes: dict = None,
draw_optic_parameters_grid: dict = None, **kwargs: dict) -> numpy.array:
"""Get frame image with ArUco detection visualization.