@@ -65,6 +65,7 @@ def eye(
6565 hide_ui = False ,
6666 debug = False ,
6767 pub_socket_hwm = None ,
68+ parent_application = "capture" ,
6869):
6970 """reads eye video and detects the pupil.
7071
@@ -190,7 +191,7 @@ def interrupt_handler(sig, frame):
190191 g_pool .debug = debug
191192 g_pool .user_dir = user_dir
192193 g_pool .version = version
193- g_pool .app = "capture"
194+ g_pool .app = parent_application
194195 g_pool .eye_id = eye_id
195196 g_pool .process = f"eye{ eye_id } "
196197 g_pool .timebase = timebase
@@ -223,7 +224,7 @@ def load_runtime_pupil_detection_plugins():
223224 continue
224225 yield plugin
225226
226- default_2d , default_3d , available_detectors = available_detector_plugins ()
227+ available_detectors = available_detector_plugins ()
227228 runtime_detectors = list (load_runtime_pupil_detection_plugins ())
228229 plugins = (
229230 manager_classes
@@ -253,13 +254,10 @@ def load_runtime_pupil_detection_plugins():
253254 # TODO: extend with plugins
254255 (default_capture_name , default_capture_settings ),
255256 ("UVC_Manager" , {}),
256- # Detectors needs to be loaded first to set `g_pool.pupil_detector`
257- (default_2d .__name__ , {}),
258- (default_3d .__name__ , {}),
257+ * [(p .__name__ , {}) for p in available_detectors ],
259258 ("NDSI_Manager" , {}),
260259 ("HMD_Streaming_Manager" , {}),
261260 ("File_Manager" , {}),
262- ("PupilDetectorManager" , {}),
263261 ("Roi" , {}),
264262 ]
265263
@@ -814,10 +812,10 @@ def window_should_update():
814812 plugin .alive = False
815813 g_pool .plugins .clean ()
816814
817- glfw .destroy_window (main_window )
818- g_pool .gui .terminate ()
819- glfw .terminate ()
820- logger .info ("Process shutting down." )
815+ glfw .destroy_window (main_window )
816+ g_pool .gui .terminate ()
817+ glfw .terminate ()
818+ logger .info ("Process shutting down." )
821819
822820
823821def eye_profiled (
@@ -833,14 +831,31 @@ def eye_profiled(
833831 hide_ui = False ,
834832 debug = False ,
835833 pub_socket_hwm = None ,
834+ parent_application = "capture" ,
836835):
837836 import cProfile
838837 import subprocess
839838 import os
840839 from .eye import eye
841840
842841 cProfile .runctx (
843- "eye(timebase, is_alive_flag,ipc_pub_url,ipc_sub_url,ipc_push_url, user_dir, version, eye_id, overwrite_cap_settings, hide_ui, debug)" ,
842+ (
843+ "eye("
844+ "timebase, "
845+ "is_alive_flag, "
846+ "ipc_pub_url, "
847+ "ipc_sub_url, "
848+ "ipc_push_url, "
849+ "user_dir, "
850+ "version, "
851+ "eye_id, "
852+ "overwrite_cap_settings, "
853+ "hide_ui, "
854+ "debug, "
855+ "pub_socket_hwm, "
856+ "parent_application, "
857+ ")"
858+ ),
844859 {
845860 "timebase" : timebase ,
846861 "is_alive_flag" : is_alive_flag ,
@@ -854,6 +869,7 @@ def eye_profiled(
854869 "hide_ui" : hide_ui ,
855870 "debug" : debug ,
856871 "pub_socket_hwm" : pub_socket_hwm ,
872+ "parent_application" : parent_application ,
857873 },
858874 locals (),
859875 "eye{}.pstats" .format (eye_id ),
0 commit comments