Skip to content

Luo-Chang/Head-Tracking-IME

Repository files navigation

screen Head Tracking IME

一款基于头部跟踪的为重度残障人士提供语言能力支持的中文输入、交流工具。

Chinese IME based on Head Tracking for Disabilities

screen

概览 Overview

该项目适用于重度脑梗致瘫病人无法活动、丧失语言能力,但是能听、能理解文字,头部能够运动的情况。通过头部跟踪使病人能够自主选择并输出文字从而恢复与家属的沟通和交流。

*下述用户指的是帮助病人启动并配置本程序的人员(如家属)

This project provides a Chinese Input Method Editor (IME) for individuals with disabilities, specifically those with severe conditions like brain strokes that have left them unable to move or speak but still capable of hearing and understanding text. The system leverages head tracking to enable text input.

功能:

  1. 病人通过头部运动控制并选择文字输入,用户可自定义病人常用词典(位于vocab/vocab.txt,以英语,分割)
  2. 通过TTS朗读输出的文字,病人可以获得类似霍金的对话能力

原理:

  1. opentrack 头部跟踪输出 X 轴坐标并经过 UDP 发送到本程序
  2. 根据头部 X 轴的移动控制并点选汉字组成句子,经由 TTS 朗读从而实现病人与家属的沟通

依赖 Dependencies

本项目依赖于 opentrack 的 commit c762f7128daf5691d4ce60b51ebfd6626bb0006f

This project depends on opentrack at commit c762f7128daf5691d4ce60b51ebfd6626bb0006f.

项目平台 Platform

本项目目前仅适用于 Windows 平台,因其使用了 PyWin32 调用 Windows 的中文 TTS 服务。

Currently, this project is designed to run on Windows only, due to its use of PyWin32 to call the Windows Chinese TTS service.

安装方法 Installation

  1. 克隆当前项目到本地 Clone the repository:

    git clone https://github.com/Luo-Chang/Head-Tracking-IME.git
    cd Head-Tracking-IME
  2. 安装依赖项 Install the required dependencies:

    pip install -r requirements.txt
  3. 安装 opentrack 2023.3.0 (commit c762f712) Install opentrack 2023.3.0 (i.e. commit c762f712)

  4. 确保 Windows 安装了中文 TTS 音声,比如 Microsoft Kangkang 或者 Microsoft Huihui;如果没有,可以通过设置 > 时间和语言 > 语音 > 管理语音来安装。 Make sure you have Windows installed with a suitable Chinese TTS voice. You can install it via Settings > Time & Language > Speech > Manage voices.

使用方法 Usage

  1. 启动 opentrack,设置inputneuralnet tracker,设置outputUDP over network,最后点击Start开始头部跟踪
  2. 使用 python main.py 启动本程序,点击开始输入
  3. 病人通过头部左右转动来选择汉字,并在准备输入的汉字处停留;在所预选的汉字处停留2s(可调整)后,汉字即选中并显示在输出区域
  4. 病人可以通过右侧的控制按钮切换上下页汉字以及删除、朗读(TTS)输出内容
  5. 用户可以通过config.toml更改相关时长、页面布局、头部跟踪灵敏度等设置
  6. 用户可以通过修改vocab/vocab.txt添加常用字、调整字的顺序,注意字与字之间用英文逗号,分隔
  7. ESC键退出程序

许可 License

This project is licensed under the GPL-3.0 License - see the LICENSE file for details.

About

Head Tracking Chinese Input Method for Disabilities

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages