def customize_menu(self): self.menu.label = "Eye Video Exporter" self.menu.append( ui.Switch("render_pupil", self, label="Visualize Pupil Detection") ) self.menu.append(ui.Info_Text("Color Legend")) self.menu.append( ui.Color_Legend(color_scheme.PUPIL_ELLIPSE_2D.as_float, "2D pupil ellipse") ) self.menu.append( ui.Color_Legend(color_scheme.PUPIL_ELLIPSE_3D.as_float, "3D pupil ellipse") ) self.menu.append( ui.Color_Legend( color_scheme.EYE_MODEL_OUTLINE_LONG_TERM_BOUNDS_IN.as_float, "Long-term model outline (within bounds)", ) ) self.menu.append( ui.Color_Legend( color_scheme.EYE_MODEL_OUTLINE_LONG_TERM_BOUNDS_OUT.as_float, "Long-term model outline (out-of-bounds)", ) ) self.menu.append(ui.Separator()) super().customize_menu()
def init_ui(self): super().init_ui() self.menu.label = self.pretty_class_name help_text = ( f"pye3d {pye3d.__version__} - a model-based 3d pupil detector with corneal " "refraction correction. Read more about the detector in our docs website." ) self.menu.append(ui.Info_Text(help_text)) help_text = ( "Visualizations: Green circle: eye model outline. Blue ellipse: 2d pupil " "detection. Red ellipse: 3d pupil detection.") self.menu.append(ui.Info_Text(help_text)) self.menu.append(ui.Button("Reset 3D model", self.reset_model)) self.__debug_window_button = ui.Button( self.__debug_window_button_label, self.debug_window_toggle) help_text = ( "The 3d model automatically updates in the background. Freeze the model to " "turn off automatic model updates. Refer to the docs website for details. " ) self.menu.append(ui.Info_Text(help_text)) self.menu.append( ui.Switch("is_long_term_model_frozen", self.detector, label="Freeze model")) self.menu.append(self.__debug_window_button) self.menu.append(ui.Info_Text("Color Legend - Default")) self.menu.append( ui.Color_Legend(color_scheme.PUPIL_ELLIPSE_3D.as_float, "3D pupil ellipse")) self.menu.append( ui.Color_Legend( color_scheme.EYE_MODEL_OUTLINE_LONG_TERM_BOUNDS_IN.as_float, "Long-term model outline (within bounds)", )) self.menu.append( ui.Color_Legend( color_scheme.EYE_MODEL_OUTLINE_LONG_TERM_BOUNDS_OUT.as_float, "Long-term model outline (out-of-bounds)", )) self.menu.append(ui.Info_Text("Color Legend - Debug")) self.menu.append( ui.Color_Legend( color_scheme.EYE_MODEL_OUTLINE_SHORT_TERM_DEBUG.as_float, "Short-term model outline", )) self.menu.append( ui.Color_Legend( color_scheme.EYE_MODEL_OUTLINE_ULTRA_LONG_TERM_DEBUG.as_float, "Ultra-long-term model outline", ))
def init_ui(self): self.add_menu() self.menu.label = "Eye Video Overlays" self.ui = UIManagementEyes(self, self.menu, (self.eye0, self.eye1)) self.menu.append(ui.Info_Text("Color Legend")) self.menu.append( ui.Color_Legend(color_scheme.PUPIL_ELLIPSE_2D.as_float, "2D pupil ellipse") ) self.menu.append( ui.Color_Legend(color_scheme.PUPIL_ELLIPSE_3D.as_float, "3D pupil ellipse") ) self.menu.append( ui.Color_Legend( color_scheme.EYE_MODEL_OUTLINE_LONG_TERM_BOUNDS_IN.as_float, "Long-term model outline (within bounds)", ) ) self.menu.append( ui.Color_Legend( color_scheme.EYE_MODEL_OUTLINE_LONG_TERM_BOUNDS_OUT.as_float, "Long-term model outline (out-of-bounds)", ) )
def init_ui(self): super().init_ui() self.menu.label = self.pretty_class_name self.menu_icon.label_font = "pupil_icons" info = ui.Info_Text( "Switch to the algorithm display mode to see a visualization of pupil detection parameters overlaid on the eye video. " + "Adjust the pupil intensity range so that the pupil is fully overlaid with blue. " + "Adjust the pupil min and pupil max ranges (red circles) so that the detected pupil size (green circle) is within the bounds." ) self.menu.append(info) self.menu.append( ui.Slider( "intensity_range", self.pupil_detector_properties, label="Pupil intensity range", min=0, max=60, step=1, ) ) self.menu.append( ui.Slider( "pupil_size_min", self.pupil_detector_properties, label="Pupil min", min=1, max=250, step=1, ) ) self.menu.append( ui.Slider( "pupil_size_max", self.pupil_detector_properties, label="Pupil max", min=50, max=400, step=1, ) ) self.menu.append(ui.Info_Text("Color Legend")) self.menu.append( ui.Color_Legend(color_scheme.PUPIL_ELLIPSE_2D.as_float, "2D pupil ellipse") )