From a81096c225eb82bda889f67f38171f24e1a5655c Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Wed, 19 Jun 2024 18:31:26 +0200 Subject: Catching SharedObjectBusy exception to not display image. --- src/argaze/__main__.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/argaze/__main__.py b/src/argaze/__main__.py index 7cfeb09..12d654c 100644 --- a/src/argaze/__main__.py +++ b/src/argaze/__main__.py @@ -26,6 +26,7 @@ import os import stat from . import load +from .DataFeatures import SharedObjectBusy from .ArFeatures import ArCamera, ArContext, PostProcessingContext, LiveProcessingContext from .utils.UtilsFeatures import print_progress_bar @@ -117,15 +118,28 @@ def load_context(args): # Window mode on if not args.no_window: - # Display context - display(context.name, context.image(draw_pipeline=draw_pipeline), 0.75) + try: + + # Display context + display(context.name, context.image(draw_pipeline=draw_pipeline), 0.75) + + except SharedObjectBusy: + + pass # Head-mounted eye tracker case: display environment frames image if issubclass(type(context.pipeline), ArCamera): for scene_frame in context.pipeline.scene_frames(): - display(scene_frame.name, scene_frame.image(), 0.5) + try: + + # Display scene's frame + display(scene_frame.name, scene_frame.image(), 0.5) + + except SharedObjectBusy: + + pass # Key interaction key_pressed = cv2.waitKey(40) -- cgit v1.1