本文整理汇总了Python中types.SimpleNamespace.pupil_positions方法的典型用法代码示例。如果您正苦于以下问题:Python SimpleNamespace.pupil_positions方法的具体用法?Python SimpleNamespace.pupil_positions怎么用?Python SimpleNamespace.pupil_positions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类types.SimpleNamespace
的用法示例。
在下文中一共展示了SimpleNamespace.pupil_positions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: player
# 需要导入模块: from types import SimpleNamespace [as 别名]
# 或者: from types.SimpleNamespace import pupil_positions [as 别名]
#.........这里部分代码省略.........
)
glfw.glfwInit()
main_window = glfw.glfwCreateWindow(width, height, window_name, None, None)
glfw.glfwSetWindowPos(main_window, window_pos[0], window_pos[1])
glfw.glfwMakeContextCurrent(main_window)
cygl.utils.init()
g_pool.main_window = main_window
def set_scale(new_scale):
g_pool.gui_user_scale = new_scale
window_size = (
g_pool.camera_render_size[0]
+ int(icon_bar_width * g_pool.gui_user_scale * hdpi_factor),
glfw.glfwGetFramebufferSize(main_window)[1],
)
logger.warning(icon_bar_width * g_pool.gui_user_scale * hdpi_factor)
glfw.glfwSetWindowSize(main_window, *window_size)
# load pupil_positions, gaze_positions
g_pool.binocular = meta_info.get("Eye Mode", "monocular") == "binocular"
g_pool.version = app_version
g_pool.timestamps = g_pool.capture.timestamps
g_pool.get_timestamp = lambda: 0.0
g_pool.user_dir = user_dir
g_pool.rec_dir = rec_dir
g_pool.meta_info = meta_info
g_pool.min_data_confidence = session_settings.get("min_data_confidence", MIN_DATA_CONFIDENCE_DEFAULT)
g_pool.min_calibration_confidence = session_settings.get(
"min_calibration_confidence", MIN_CALIBRATION_CONFIDENCE_DEFAULT
)
# populated by producers
g_pool.pupil_positions = pm.Bisector()
g_pool.pupil_positions_by_id = (pm.Bisector(), pm.Bisector())
g_pool.gaze_positions = pm.Bisector()
g_pool.fixations = pm.Affiliator()
g_pool.eye_movements = pm.Affiliator()
def set_data_confidence(new_confidence):
g_pool.min_data_confidence = new_confidence
notification = {"subject": "min_data_confidence_changed"}
notification["_notify_time_"] = time() + 0.8
g_pool.ipc_pub.notify(notification)
def do_export(_):
left_idx = g_pool.seek_control.trim_left
right_idx = g_pool.seek_control.trim_right
export_range = left_idx, right_idx + 1 # exclusive range.stop
export_ts_window = pm.exact_window(g_pool.timestamps, (left_idx, right_idx))
export_dir = os.path.join(g_pool.rec_dir, "exports")
export_dir = next_export_sub_dir(export_dir)
os.makedirs(export_dir)
logger.info('Created export dir at "{}"'.format(export_dir))
export_info = {
"Player Software Version": str(g_pool.version),
"Data Format Version": meta_info["Data Format Version"],
"Export Date": strftime("%d.%m.%Y", localtime()),
"Export Time": strftime("%H:%M:%S", localtime()),
"Frame Index Range:": g_pool.seek_control.get_frame_index_trim_range_string(),
"Relative Time Range": g_pool.seek_control.get_rel_time_trim_range_string(),
"Absolute Time Range": g_pool.seek_control.get_abs_time_trim_range_string(),
}