Skip to content

Commit c4df544

Browse files
authored
Docker Image along with v2.1.0 (#309)
* Delete .vscode * Delete configure * CLI.OperatorAPI * CLI.Finished + Update.Inference.Doc * Refine installation format Fix FAKE Compatible => OpenCV3.2 CI => Compile OpenCV from source. Accelerate CI Accelerate CI * Fix imshow logic * Remove old docker codes * Add docker files * Enhance Docker * Refine Dockerfile * Optimize.Appearance * New README * Center.Align * LOGO * LOGO * Refine.Doc
1 parent e2b819c commit c4df544

21 files changed

+225
-159
lines changed

.dockerignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
docker/*.deb
1+
.git
2+
*build*
3+
data
4+
3rdparty

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,6 @@ docs/make.bat
4747
examples/user_codes/*.cpp
4848
debug.*
4949

50+
!logo.png
5051
!docs/Makefile
51-
!docs/markdown/images/*
52+
!docs/markdown/images/*

Dockerfile

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Dockerfile
2+
3+
# docker build .
4+
5+
# Based on CUDA11.0 & CuDNN8
6+
FROM nvidia/cuda:10.2-devel-ubuntu18.04
7+
8+
# Install Non-GPU Dependencies.
9+
RUN apt update --allow-unauthenticated && version="7.0.0-1+cuda10.2" ; \
10+
apt install -y \
11+
libnvinfer7=${version} libnvonnxparsers7=${version} libnvparsers7=${version} \
12+
libnvinfer-plugin7=${version} libnvinfer-dev=${version} libnvonnxparsers-dev=${version} \
13+
libnvparsers-dev=${version} libnvinfer-plugin-dev=${version} python-libnvinfer=${version} \
14+
python3-libnvinfer=${version} && \
15+
apt-mark hold \
16+
libnvinfer7 libnvonnxparsers7 libnvparsers7 libnvinfer-plugin7 libnvinfer-dev libnvonnxparsers-dev libnvparsers-dev libnvinfer-plugin-dev python-libnvinfer python3-libnvinfer
17+
18+
# Install OpenCV Dependencies
19+
RUN apt install -y software-properties-common || apt install -y software-properties-common && \
20+
add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main" && \
21+
APT_DEPS="git cmake libgtk-3-dev libavcodec-dev libavformat-dev libswscale-dev libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev x264 v4l-utils python3-dev python3-pip libcanberra-gtk-module libcanberra-gtk3-module" && \
22+
apt install -y $APT_DEPS || apt install -y $APT_DEPS && \
23+
python3 -m pip install numpy
24+
25+
# Compile OpenCV
26+
RUN git clone --branch 4.4.0 https://github.com/opencv/opencv.git && \
27+
cd opencv && mkdir build && cd build && \
28+
cmake .. -DCMAKE_BUILD_TYPE=Release \
29+
-DCMAKE_INSTALL_PREFIX=/usr/local \
30+
-DWITH_TBB=ON \
31+
-DWITH_V4L=ON \
32+
-DBUILD_TESTS=OFF \
33+
-DBUILD_OPENCV_PYTHON3=OFF && \
34+
make -j && make install
35+
36+
# Install HyperPose Dependencies
37+
RUN apt install -y python3-dev python3-pip subversion libgflags-dev
38+
39+
COPY . /hyperpose
40+
41+
# Download related data
42+
RUN for file in $(find /hyperpose/scripts -type f -iname 'download*.sh'); do sh $file; done
43+
44+
# Build Repo
45+
RUN cd hyperpose && mkdir build && cd build && \
46+
cmake .. -DCMAKE_BUILD_TYPE=Release && make -j
47+
48+
WORKDIR /hyperpose/build
49+
50+
ENTRYPOINT ["./hyperpose-cli"]

README.md

Lines changed: 60 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,29 @@
1-
# HyperPose
1+
</a>
2+
<p align="center">
3+
<img src="./docs/markdown/images/logo.png", width="800">
4+
</p>
25

3-
[![Documentation Status](https://readthedocs.org/projects/hyperpose/badge/?version=latest)](https://hyperpose.readthedocs.io/en/latest/?badge=latest)
6+
<p align="center">
7+
<a href="https://readthedocs.org/projects/hyperpose/badge/?version=latest" title="Docs Building"><img src="https://readthedocs.org/projects/hyperpose/badge/?version=latest"></a>
8+
<a href="https://github.com/tensorlayer/hyperpose/actions?query=workflow%3ACI" title="Build Status"><img src="https://github.com/tensorlayer/hyperpose/workflows/CI/badge.svg"></a>
9+
<a href="https://hub.docker.com/repository/docker/tensorlayer/hyperpose" title="Docker"><img src="https://img.shields.io/docker/image-size/tensorlayer/hyperpose"></a>
10+
<a href="https://drive.google.com/drive/folders/1w9EjMkrjxOmMw3Rf6fXXkiv_ge7M99jR?usp=sharing" title="PreTrainedModels"><img src="https://img.shields.io/badge/trained%20models-GoogleDrive-brightgreen.svg"></a>
11+
<a href="https://en.cppreference.com/w/cpp/17" title="CppStandard"><img src="https://img.shields.io/badge/C++-17-blue.svg?style=flat&logo=c%2B%2B"></a>
12+
<a href="https://github.com/tensorlayer/hyperpose/graphs/commit-activity" title="Maintenance"><img src="https://img.shields.io/badge/maintained%3F-YES-brightgreen.svg"></a>
13+
<a href="https://github.com/tensorlayer/tensorlayer/blob/master/LICENSE.rst" title="TensorLayer"><img src="https://img.shields.io/github/license/tensorlayer/tensorlayer">
14+
</p>
415

5-
HyperPose is a library for building human pose estimation systems that can efficiently operate in the wild.
16+
---
617

7-
> **News**: The PoseProposal inference model is released! See the HyperPose models on [Google Drive](https://drive.google.com/drive/folders/1w9EjMkrjxOmMw3Rf6fXXkiv_ge7M99jR?usp=sharing).
18+
<p align="center">
19+
<a href="#Features">Features</a> •
20+
<a href="#Documentation">Documentation</a> •
21+
<a href="#Quick-Start-with-Docker">Quick-Start with Docker</a> •
22+
<a href="#Performance">Performance</a> •
23+
<a href="#License">License</a>
24+
</p>
25+
26+
HyperPose is a library for building human pose estimation systems that can efficiently operate in the wild.
827

928
## Features
1029

@@ -13,42 +32,63 @@ HyperPose has two key features, which are not available in existing libraries:
1332
- **Flexible training platform**: HyperPose provides flexible Python APIs to build many useful pose estimation models (e.g., OpenPose and PoseProposalNetwork). HyperPose users can, for example, customize data augmentation, use parallel GPUs for training, and replace deep neural networks (e.g., changing from ResNet to MobileNet), thus building models specific to their real-world scenarios.
1433
- **High-performance pose estimation**: HyperPose achieves real-time pose estimation though a high-performance pose estimation engine. This engine implements numerous system optimizations: pipeline parallelism, model inference with TensorRT, CPU/GPU hybrid scheduling, and many others. This allows HyperPose to run 4x faster than OpenPose and 10x faster than TF-Pose.
1534

16-
## Get Started
35+
## Documentation
36+
37+
You can install HyperPose(Python Training Library, C++ inference Library) and learn its APIs through [HyperPose Documentation](https://hyperpose.readthedocs.io/en/latest/).
1738

18-
You can install HyperPose and learn its APIs through [Documentation](https://hyperpose.readthedocs.io/en/latest/).
39+
## Quick-Start with Docker
1940

20-
## Example
41+
The official docker image is on [DockerHub](https://hub.docker.com/r/tensorlayer/hyperpose).
2142

22-
We provide an example to show human pose estimation achieved by HyperPose. You need to install CUDA Toolkit 10+, TensorRT 7+, OpenCV 3.2+ and gFlags (cmake version), and enable C++ 17 support. Once the prerequisite are met, run the following script:
43+
Make sure you have [docker](https://docs.docker.com/get-docker/) with [nvidia-docker](https://github.com/NVIDIA/nvidia-docker) functionality installed.
44+
45+
> Also note that your nvidia driver should be [compatible](https://docs.nvidia.com/deploy/cuda-compatibility/index.html#support-title) with CUDA10.2.
2346
2447
```bash
25-
sudo apt -y install git cmake build-essential subversion libgflags-dev libopencv-dev
26-
git clone https://github.com/tensorlayer/hyperpose.git && cd hyperpose
27-
sh scripts/download-test-data.sh # Install data for examples.
28-
sh scripts/download-tinyvgg-model.sh # Install tiny-vgg model.
29-
mkdir build && cd build
30-
cmake .. -DCMAKE_BUILD_TYPE=Release && cmake --build . # Build library && examples.
31-
./hyperpose-cli # The ouput images will be in the build folder.
48+
# [Example 1]: Doing inference on given video, copy the output.avi to the local path.
49+
docker run --name quick-start --gpus all tensorlayer/hyperpose --runtime=stream
50+
docker cp quick-start:/hyperpose/build/output.avi .
51+
docker rm quick-start
52+
53+
54+
# [Example 2](X11 server required to see the imshow window): Real-time inference.
55+
# You may need to install X11 server locally:
56+
# sudo apt install xorg openbox xauth
57+
xhost +; docker run --rm --gpus all -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix tensorlayer/hyperpose --imshow
58+
59+
60+
# [Example 3]: Camera + imshow window
61+
xhost +; docker run --name pose-camera --rm --gpus all -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --device=/dev/video0:/dev/video0 tensorlayer/hyperpose --source=camera --imshow
62+
# To quit this image, please type `docker kill pose-camera` in another terminal.
63+
64+
65+
# [Dive into the image]
66+
xhost +; docker run --rm --gpus all -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --device=/dev/video0:/dev/video0 --entrypoint /bin/bash tensorlayer/hyperpose
67+
# For users that cannot access a camera or X11 server. You may also use:
68+
# docker run --rm --gpus all -it --entrypoint /bin/bash tensorlayer/hyperpose
3269
```
3370

71+
> For more details, please check [here](https://hyperpose.readthedocs.io/en/latest/markdown/quick_start/prediction.html#table-of-flags-for-hyperpose-cli).
72+
3473
## Performance
3574

36-
We compare the prediction performance of HyperPose with [OpenPose 1.6](https://github.com/CMU-Perceptual-Computing-Lab/openpose) and [TF-Pose](https://github.com/ildoonet/tf-pose-estimation). We implement the OpenPose algorithms with different configurations in HyperPose. The test-bed has Ubuntu18.04, 1070Ti GPU, Intel i7 CPU (12 logic cores). The test video is Crazy Updown Funk ([YouTube](https://www.youtube.com/watch?v=2DiQUX11YaY)). The HyperPose models (in the ONNX or Uff formats) are available [here](https://github.com/tensorlayer/pretrained-models/tree/master/models/hyperpose).
75+
We compare the prediction performance of HyperPose with [OpenPose 1.6](https://github.com/CMU-Perceptual-Computing-Lab/openpose) and [TF-Pose](https://github.com/ildoonet/tf-pose-estimation). We implement the OpenPose algorithms with different configurations in HyperPose. The test-bed has Ubuntu18.04, 1070Ti GPU, Intel i7 CPU (12 logic cores).
3776

38-
| HyperPose Configuration | DNN Size | DNN Input Shape | HyerPose | Baseline |
77+
| HyperPose Configuration | DNN Size | Input Size | HyerPose | Baseline |
3978
| --------------- | ------------- | ------------------ | ------------------ | --------------------- |
4079
| OpenPose (VGG) | 209.3MB | 656 x 368 | 27.32 FPS | 8 FPS (OpenPose) |
4180
| OpenPose (TinyVGG) | 34.7 MB | 384 x 256 | 124.925 FPS | N/A |
4281
| OpenPose (MobileNet) | 17.9 MB | 432 x 368 | 84.32 FPS | 8.5 FPS (TF-Pose) |
4382
| OpenPose (ResNet18) | 45.0 MB | 432 x 368 | 62.52 FPS | N/A |
4483

45-
As we can see, HyperPose is the only library that can achieve **real-time** human pose estimation.
46-
4784
</a>
4885
<p align="center">
49-
<img src="https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/media/dance_foot.gif?raw=true", width="360">
86+
<img src="./docs/markdown/images/demo-xbd.gif", width="600">
5087
</p>
5188

89+
<p align="center">
90+
新宝岛 with HyperPose(Lightweight OpenPose model)
91+
</p>
5292
## License
5393

5494
HyperPose is open-sourced under the [Apache 2.0 license](https://github.com/tensorlayer/tensorlayer/blob/master/LICENSE.rst).

deps/apt.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

deps/check.sh

Lines changed: 0 additions & 14 deletions
This file was deleted.

docker/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

docker/Dockerfile.builder-cpu

Lines changed: 0 additions & 10 deletions
This file was deleted.

docker/Dockerfile.builder-cpu-ubuntu18

Lines changed: 0 additions & 7 deletions
This file was deleted.

docker/Dockerfile.builder-gpu

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)