Skip to content

Commit

Permalink
backup
Browse files Browse the repository at this point in the history
  • Loading branch information
cleardusk committed Aug 3, 2020
1 parent 0ff3ec6 commit e0e755f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
25 changes: 16 additions & 9 deletions c++/readme.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,39 @@
# C++ port

The C++ port of this repo is originally created and contributed by [Ammar Ali](https://github.com/ammarali32), and slightly modified by [cleardusk](https://github.com/cleardusk).
The implementation relies on the new OpenCV (4.2.0+) framework to read onnx and do the inference.

## Foreword

* The implementation is not optimized
* The converted onnx model and the yolo-face detector weights can be downloads in [GoogleDrive](https://drive.google.com/drive/folders/1Iprh93fpGkgebc7rw1OSOEemvxpxFXIB) or [BaiduDrive](https://pan.baidu.com/s/1jSLUK3FEEHf1DE1UqOrO1g) (password: 6kjr)
* Dependency: >= OpenCV 4.2.0
* yolo face detector is tested in this port to substitute dlib
* yolo face detector is tested in this port to substitute dlib (welcome for contributing light-weighted face detector of the c++ port)

## How to build and run

### macOS
```shell script
# Install or upgrade OpenCV, the default is 4.4.0. This may take a long long time !!!
# Step 1: Install or upgrade OpenCV, the default is 4.4.0. This may take a long long time !!!
brew upgrade opencv # or `brew install opencv` if opencv is not installed

# build cpp demo
# Step 2: build cpp demo
cd c++ # cd into the c++ dir
mkdir build
cd build
cmake ..
make

# run
# Step 3: put the downloaded weights `mb_1.onnx` and `tiny-yolo-azface-fddb_82000.weights` into `weights` dir

# Run
cd ..
./build/demo
```

### Linux
```shell script
# build opencv, >= 4.2.0 will be ok
# Step 1: build opencv, >= 4.2.0 will be ok
git clone https://github.com/opencv/opencv.git # you can checkout the desired branch version
cd opencv
mkdir build
Expand All @@ -38,22 +42,25 @@ cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
make -j
sudo make install

# build cpp demo
# Step 2: build cpp demo
cd c++ # cd into the c++ dir
mkdir build
cd build
cmake ..
make

# run
# Step 3: put the downloaded weights `mb_1.onnx` and `tiny-yolo-azface-fddb_82000.weights` into `weights` dir

# Run
cd ..
./build/demo
```

### Result
The result will be stored in `res` by default. Below is a demo running by this c++ port.

<p align="center">
<img src="demo.jpg" alt="A demo" width="600px">
<img src="demo.jpg" alt="A demo" width="750px">
</p>


Expand All @@ -72,7 +79,7 @@ Inference time: 6.62105 ms
See [convert_to_onnx.py](./convert_to_onnx.py).

### TODO
More functionalities are to be implemented.
More functionalities are to be implemented. And welcome for discussions or PRs.
<!-- I hope that I will have time to complete all functionality and not just facial landmarks but i am sure that from here it is not hard to be implemented. -->


7 changes: 4 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ By [Jianzhu Guo](http://guojianzhu.com).
</p>

**\[Updates\]**
- `2020.8.2`: Update a simple c++ port of this project, see [here](./c++/readme.md). The implementation relies on the new OpenCV (4.2.0+) framework to read onnx and do the inference.
- `2020.7.3`: The extended work [Towards Fast, Accurate and Stable 3D Dense Face Alignment](https://guojianzhu.com/assets/pdfs/3162.pdf) is accepted by <strong>[ECCV 2020](https://eccv2020.eu/)</strong>.
- `2020.8.2`: Update a <strong>[simple c++ port](./c++/readme.md)</strong> of this project.
- `2020.7.3`: The extended work <strong>[Towards Fast, Accurate and Stable 3D Dense Face Alignment](https://guojianzhu.com/assets/pdfs/3162.pdf)</strong> is accepted by [ECCV 2020](https://eccv2020.eu/). See [my page](https://guojianzhu.com) for more details.
- `2019.9.15`: Some updates, see the commits for details.
- `2019.6.17`: Adding a [video demo](./video_demo.py) contributed by [zjjMaiMai](https://github.com/zjjMaiMai).
- `2019.5.2`: Evaluating inference speed on CPU with PyTorch v1.1.0, see [here](#CPU) and [speed_cpu.py](./speed_cpu.py).
Expand All @@ -32,6 +32,7 @@ By [Jianzhu Guo](http://guojianzhu.com).

**\[Todo\]**

- [x] Add c++ port.
- [x] Depth image estimation.
- [x] PNCC (Projected Normalized Coordinate Code).
- [x] PAF (Pose Adaptive Feature).
Expand Down Expand Up @@ -311,4 +312,4 @@ Welcome to focus on my 3D face related works: [MeGlass](https://github.com/clear
## Contact
**Jianzhu Guo (郭建珠)** [[Homepage-Academic](http://guojianzhu.com), [Homepage-Blog](http://vlog.guojianzhu.com), [Google Scholar](https://scholar.google.com/citations?user=W8_JzNcAAAAJ&hl=en&oi=ao)]: **[email protected]**.
**Jianzhu Guo (郭建珠)** [[Homepage](http://guojianzhu.com), [Google Scholar](https://scholar.google.com/citations?user=W8_JzNcAAAAJ&hl=en&oi=ao)]: **[email protected]** or **[email protected]**.

0 comments on commit e0e755f

Please sign in to comment.