aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThéo de la Hogue2024-06-19 18:31:26 +0200
committerThéo de la Hogue2024-06-19 18:31:26 +0200
commita81096c225eb82bda889f67f38171f24e1a5655c (patch)
treee38c823f3d4a0f1ecfdca8f476223b02f79934d2
parent2b8cefb167d93c3c89dafc14170184bf63473d6f (diff)
downloadargaze-a81096c225eb82bda889f67f38171f24e1a5655c.zip
argaze-a81096c225eb82bda889f67f38171f24e1a5655c.tar.gz
argaze-a81096c225eb82bda889f67f38171f24e1a5655c.tar.bz2
argaze-a81096c225eb82bda889f67f38171f24e1a5655c.tar.xz
Catching SharedObjectBusy exception to not display image.
-rw-r--r--src/argaze/__main__.py20
1 files 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)