Skip to content

Commit 5e1be9a

Browse files
authored
Fix Docs (#368)
1 parent 49d14e0 commit 5e1be9a

File tree

2 files changed

+31
-21
lines changed

2 files changed

+31
-21
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ We provide a sample training script with cli located at [train.py](https://githu
166166

167167
To evaluate a model using hyperpose is similiar to the training procedure, we also provide a sample evaluation script with cli located at [eval.py](https://github.com/tensorlayer/hyperpose/blob/master/eval.py) as an example and a template for modification.
168168

169-
More information of the Hyperpose training library APIs can be found [here](https://hyperpose.readthedocs.io/en/latest/markdown/quick_start/training.html)
169+
More information of the Hyperpose training library usage can be found [here](https://hyperpose.readthedocs.io/en/latest/markdown/quick_start/training.html).
170170

171171

172172
## Documentation

docs/markdown/install/training.md

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,19 @@ conda install cudnn=7.6.0
2828
```
2929

3030
After configuring and activating conda enviroment, we can then begin to install the hyperpose.<br>
31+
3132
(I)The first method to install is to put hyperpose python module in the working directory.(recommand)<br>
32-
After git-cloning the source [repository](https://github.com/tensorlayer/hyperpose.git), you can directly import hyperpose python library under the root directory of the cloned repository.<br>
33-
To make importion available, you should install the prerequist dependencies as followed:<br>
34-
you can either install according to the requirements.txt in the [repository](https://github.com/tensorlayer/hyperpose.git)
33+
After git-cloning the source [repository](https://github.com/tensorlayer/hyperpose.git), you can directly import hyperpose python library under the root directory of the cloned repository.<br>
34+
35+
To make importion available, you should install the prerequist dependencies as followed:<br>
36+
you can either install according to the requirements.txt in the [repository](https://github.com/tensorlayer/hyperpose.git)
3537
```bash
3638
# install according to the requirements.txt
3739
pip install -r requirements.txt
3840
```
39-
or install libraries one by one
41+
42+
or install libraries one by one
43+
4044
```bash
4145
# >>> install tensorflow of version 2.3.1
4246
pip install tensorflow-gpu==2.3.1
@@ -48,13 +52,17 @@ After configuring and activating conda enviroment, we can then begin to install
4852
pip install pycocotools
4953
pip install matplotlib
5054
```
51-
This method of installation use the latest source code and thus is less likely to meet compatibility problems.<br><br>
55+
56+
This method of installation use the latest source code and thus is less likely to meet compatibility problems.<br><br>
57+
5258
(II)The second method to install is to use pypi repositories.<br>
53-
We have already upload hyperpose python library to pypi website so you can install it using pip, which gives you the last stable version.
54-
```bash
55-
pip install hyperpose
56-
```
57-
This will download and install all dependencies automatically.
59+
We have already upload hyperpose python library to pypi website so you can install it using pip, which gives you the last stable version.
60+
61+
```bash
62+
pip install hyperpose
63+
```
64+
65+
This will download and install all dependencies automatically.
5866

5967
Now after installing dependent libraries and hyperpose itself, let's check whether the installation successes.
6068
run following command in bash:
@@ -69,30 +77,32 @@ python
6977
```
7078

7179
## Extra configuration for exporting model
72-
The hypeprose python training library handles the whole pipelines for developing the pose estimation system, including training, evaluating and testing. Its goal is to produce a .npz file that contains the well-trained model weights.
80+
The hypeprose python training library handles the whole pipelines for developing the pose estimation system, including training, evaluating and testing. Its goal is to produce a **.npz** file that contains the well-trained model weights.
7381

74-
For the training platform, the enviroment configuration above is engough. However, most inference engine only accept .pb format or .onnx format model, such as [TensorRT](https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html). Thus, one need to convert the trained model loaded with .npz file weight to .pb format or .onnx format for further deployment, which need extra configuration below:<br>
82+
For the training platform, the enviroment configuration above is engough. However, most inference engine only accept .pb format or .onnx format model, such as [TensorRT](https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html).
7583

76-
* (I)Convert to .pb format:<br>
84+
Thus, one need to convert the trained model loaded with **.npz** file weight to **.pb** format or **.onnx** format for further deployment, which need extra configuration below:<br>
85+
86+
> **(I)Convert to .pb format:**<br>
7787
To convert the model into .pb format, we use *@tf.function* to decorate the *infer* function of each model class, so we can use the *get_concrete_function* function from tensorflow to consctruct the frozen model computation graph and then save it in .pb format.
78-
We already provide a script with cli to facilitate conversion, which located at [export_pb.py](https://github.com/tensorlayer/hyperpose/blob/master/export_pb.py). What we need here is only **tensorflow** library that we already installed.
7988

80-
* (II)Convert to .onnx format:<br>
89+
We already provide a script with cli to facilitate conversion, which located at [export_pb.py](https://github.com/tensorlayer/hyperpose/blob/master/export_pb.py). What we need here is only *tensorflow* library that we already installed.
90+
91+
> **(II)Convert to .onnx format:**<br>
8192
To convert the model in .onnx format, we need to first convert the model into .pb format, then convert it from .pb format into .onnx format. Two extra library are needed:
82-
* tf2onnx<br>
93+
> **tf2onnx**:<br>
8394
*tf2onnx* is used to convert .pb format model into .onnx format model, is necessary here. details information see [reference](https://github.com/onnx/tensorflow-onnx).
8495
install tf2onnx by running:
8596
```bash
8697
pip install -U tf2onnx
8798
```
8899

89-
* graph_transforms<br>
90-
*graph_transform* is used to check the input and output node of the .pb file if one doesn't know. when convert .pb file into .onnx file using tf2onnx, one is required to provide the input node name and output node name of the computation graph stored in .pb file, so he may need to use *graph_transform* to inspect the .pn file to get node names.<br>
100+
> **graph_transforms**:<br>
101+
*graph_transform* is used to check the input and output node of the .pb file if one doesn't know. when convert .pb file into .onnx file using tf2onnx, one is required to provide the input node name and output node name of the computation graph stored in .pb file, so he may need to use *graph_transform* to inspect the .pb file to get node names.<br>
91102
build graph_transforms according to [tensorflow tools](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/graph_transforms#using-the-graph-transform-tool)
92103

93104
## Extra configuration for parallel training
94-
The hyperpose python training library use the High performance distributed machine learning framework **Kungfu** for parallel training.
95-
105+
The hyperpose python training library use the High performance distributed machine learning framework **Kungfu** for parallel training.<br>
96106
Thus to use the parallel training functionality of hyperpose, please install [Kungfu](https://github.com/lsds/KungFu) according to the official instructon it provides.
97107

98108

0 commit comments

Comments
 (0)