# DP-LSTM **Repository Path**: bodyless/DP-LSTM ## Basic Information - **Project Name**: DP-LSTM - **Description**: 用于连续手势轨迹的识别。 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 6 - **Forks**: 0 - **Created**: 2019-07-04 - **Last Updated**: 2022-03-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # DP-LSTM(LSTM-based Dynamic Probability) + **功能:** 用于进行实时性的连续手写轨迹的识别。 + **环境:** win10 + python3.5 + tensorflow1.10(其他tf版本也是兼容的)+ OpenCV3.4.0。 + **说明:** 模型本身只实现轨迹的识别与分割功能,并不考虑手的分割。但是为了保证代码的完整性,本项目中依然加入了手势分割与质心获取的部分。该部分代码的实现原理是颜色空间分割,由WIN10x64环境下的VS2013编译为库,linux环境请自行编译为.SO文件,动态链接库中的其他依赖来自于OpenCV2.4.13。编译流程可以参照如下步骤: 1、vs2013新建win32项目,应用程序类型选择dll,项目名称为opencv2413_mat; 2、将Libs目录下的cpp文件替换项目中的同名文件; 3、在vs2013中配置opencv2.4.13; 4、编译,生成dll文件并替换Libs目录下的dll。 + **运行:** main.py可以直接执行;若要重新训练模型则需要: 1、执行video_to_data.py将视频文件转换为txt数据集; 2、执行data_manage.py分割数据集; 3、执行 train.py。 + **根目录:** main.py为程序主文件,运行即可执行模型;config.py为配置文件;test.py和train.py用于测试和训练单一手势的轨迹数据;video_validate.py和video_to_data.py用于将视频文件处理为txt格式的轨迹数据;data_manage.py用于分割和读取txt格式的数据集;其余文件为功能模块。 + **Models:** 存放LSTM训练好的模型文件。 + **Libs:** 存放库文件与c++源码。 + **Data:** 存放轨迹数据集与临时数据集。 ## English + **Func:** This program is used to recognize the multiple continuous hand gesture trajectory in real time. + **Env:** win10 + python3.5 + tensorflow1.10 (compatible with other tf versions) + OpenCV3.4.0. + **Des:** The program only implements the recognition and segmentation of the trajectory, and does not achieve the hand segmentation. However, in order to ensure the project can run, the parts of hand segmentation and centroid acquisition is still included in this project. We use color space segmentation to implement these two parts, which compiled by VS2013 in WIN10x64 as a dll, linux environment have to compile into a SO file, and other dependencies in the dynamic link library come from OpenCV2.4.13. You can recompile the dll as follows: 1. create a win32 project named as opencv2413_mat, and type is dll; 2. replace the cpp file in the Libs with the file of the same name in this project; 3. configure opencv2.4.13 in vs2013; 4. compile, it will generate a dll. Use it to replace the dll in the Libs. + **Run:** main.py can be executed directly; if you want to train a model, you need to: 1. run video_to_data.py to convert the video into a txt file (dataset); 2. run data_manage.py to split the data set; 3. run train.py. + **Root:** main.py is the main program file; config.py is the configuration file; test.py and train.py are used to test and train the models; video_validate.py and video_to_data.py is used to convert the video into a txt file; data_manage.py is used to split and read the data set from txt; the remaining files are function modules. + **Models:** Trained model file of LSTM. + **Libs:** Library and cpp. + **Data:** Training dataset.