README.md 3.4 KB
Newer Older
Eric.Lee2021's avatar
Eric.Lee2021 已提交
1 2 3 4 5 6 7 8 9 10 11
# Easy 3D HandPose X  
Easy 3D HandPose,pytorch,单目相机的手三维姿态估计

## 项目介绍   
* 注意:该项目前向推理用到项目包括:  
- [x] 手检测:https://codechina.csdn.net/EricLee/yolo_v3
- [x] 手二维关键点检测:https://codechina.csdn.net/EricLee/handpose_x
- [x] Manopth:https://github.com/hassony2/manopth
- [x] Easy 3D HandPose X:https://codechina.csdn.net/EricLee/e3d_handpose_x

* 视频示例:  
Eric.Lee2021's avatar
Eric.Lee2021 已提交
12
 ![video](https://codechina.csdn.net/EricLee/e3d_handpose_x/-/raw/master/samples/sample.gif)    
Eric.Lee2021's avatar
Eric.Lee2021 已提交
13
* [完整示例视频](https://www.bilibili.com/video/BV1j64y1r7da/)       
Eric.Lee2021's avatar
Eric.Lee2021 已提交
14
## 项目推理 PipeLine
Eric.Lee2021's avatar
update  
Eric.Lee2021 已提交
15
 ![pipeline](https://codechina.csdn.net/EricLee/e3d_handpose_x/-/raw/master/samples/e3d.jpg)  
Eric.Lee2021's avatar
Eric.Lee2021 已提交
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
## 项目配置  
### 1、软件  
* 作者开发环境:  
* Python 3.7  
* PyTorch >= 1.5.1  
* opencv-python  
* open3d  
### 2、硬件  
* 普通USB彩色(RGB)网络摄像头    

## 数据集   
* 制作数据集,后续更新

## 模型   
### 1、目前支持的模型 (backbone)

- [x] resnet18 & resnet34 & resnet50 & resnet101

### 2、预训练模型   

Eric.Lee2021's avatar
Eric.Lee2021 已提交
36
* [预训练模型下载地址(百度网盘 Password: 95t4 )](https://pan.baidu.com/s/1L9JVjnvKDjG0opIAUZOF0g)        
Eric.Lee2021's avatar
Eric.Lee2021 已提交
37 38 39


## 项目使用方法  
Eric.Lee2021's avatar
update  
Eric.Lee2021 已提交
40
### [1]准备左右手3D建模资源(MANO Hand Model)  
Eric.Lee2021's avatar
Eric.Lee2021 已提交
41 42 43 44 45 46 47 48 49 50 51 52 53 54
* 该模型也可在官网下载,官网地址为:https://mano.is.tue.mpg.de/
* 下载模型和文件 (下载文件的格式为 mano_v*_*.zip)。注意这些文件的下载使用遵守 [MANO license](https://mano.is.tue.mpg.de/license)
* 下载模型后进行解压,并将其目录结构设置如下:
```
e3d_handpose_x/
  mano/
    models/
      MANO_LEFT.pkl
      MANO_RIGHT.pkl
      ...
    webuser/
      ...
    __init__.py
```
Eric.Lee2021's avatar
update  
Eric.Lee2021 已提交
55
### [2]模型训练  
Eric.Lee2021's avatar
update  
Eric.Lee2021 已提交
56
#### 根目录下运行命令: python train.py       (注意脚本内相关参数配置 )   
Eric.Lee2021's avatar
Eric.Lee2021 已提交
57

Eric.Lee2021's avatar
update  
Eric.Lee2021 已提交
58
### [3]模型推理  
Eric.Lee2021's avatar
update  
Eric.Lee2021 已提交
59
#### 根目录下运行命令:
Eric.Lee2021's avatar
update  
Eric.Lee2021 已提交
60
#### 1) 图片推理脚本 :python inference.py        (注意脚本内相关参数配置 )
Eric.Lee2021's avatar
Eric.Lee2021 已提交
61

Eric.Lee2021's avatar
update  
Eric.Lee2021 已提交
62
#### 2) 相机推理脚本 : python yolo_inference.py        (注意脚本内相关参数配置 )  
Eric.Lee2021's avatar
update  
Eric.Lee2021 已提交
63 64
####    注意:目前推理为 “预发版本”,只支持画面中出现一只手会进行三维姿态估计,并只支持右手姿态估计。   

Eric.Lee2021's avatar
update  
Eric.Lee2021 已提交
65
#####    第 1 步:确定电脑连接相机。
Eric.Lee2021's avatar
update  
Eric.Lee2021 已提交
66
#####    第 2 步:下载 [模型前向推理包(百度网盘 Password: xhd3 )](https://pan.baidu.com/s/1wqhIgciL5mnlT1PyHKI6QQ)    
Eric.Lee2021's avatar
update  
Eric.Lee2021 已提交
67
#####    第 3 步:解压模型前向推理包,配置 [yolo_inference.py](https://codechina.csdn.net/EricLee/e3d_handpose_x/-/blob/master/yolo_inference.py)脚本模型路径参数,参考如下:  
Eric.Lee2021's avatar
Eric.Lee2021 已提交
68
```
Eric.Lee2021's avatar
update  
Eric.Lee2021 已提交
69
  parser.add_argument('--model_path', type=str, default = './if_package/e3d_handposex-resnet_50-size-128-loss-wing_loss-20210619.pth',
Eric.Lee2021's avatar
Eric.Lee2021 已提交
70 71 72 73 74 75
      help = 'model_path') # e3d handpose 模型路径
  parser.add_argument('--detect_model_path', type=str, default = './if_package/hand_detect_416-20210606.pt',
      help = 'model_path') # detect 模型路径
  parser.add_argument('--handpose_x2d_model_path', type=str, default = './if_package/handposex_2d_resnet_50-size-256-wingloss102-0.119.pth',
      help = 'model_path') # 手2维关键点 模型路径
```
Eric.Lee2021's avatar
update  
Eric.Lee2021 已提交
76
#####   第 4 步:运行脚本:python yolo_inference.py
Eric.Lee2021's avatar
Eric.Lee2021 已提交
77
####   注意:运行出错,注意看log报的错误,尽量自行解决,思考尝试解决不了,issue提问。
Eric.Lee2021's avatar
Eric.Lee2021 已提交
78 79 80

## 联系方式 (Contact)  
* E-mails: 305141918@qq.com