This is `YuFaceDetectNet`(https://github.com/ShiqiYu/libfacedetection) implementation with [Tengine](https://github.com/OAID/Tengine).
![](imgs/save.jpg)
## Download YuFaceDetectNet models
You can download model from *Tengine Model Zoo*, or from ShiqiYu github (which need to upgrade the model).
### **Download form Tengine model zoo**
You can directly download the upgrated caffemodel in [Tengine model zoo](https://pan.baidu.com/s/1LXZ8vOdyOo50IXS0CUPp8g)(psw: 57vb) in the directory `Tengine_models/yufacedetect`.
- yufacedetectnet-open-v1_new.prototxt
- yufacedetectnet-open-v1_new.caffemodel
### **Download from ShiqiYu-Github**
You can also download the caffemodel from https://github.com/ShiqiYu/libfacedetection
`NOTE`: the Caffe model has to be upgraded using:
-*Caffe/build/tools/upgrade_net_proto_text*
-*Caffe/build/tools/upgrade_net_proto_binary*
Or you change input part of prototxt from
```
input: "data"
input_shape {
dim: 1
dim: 3
dim: 240
dim: 320
}
```
to
```
layer {
name: "input"
type: "Input"
top: "data"
input_param {
shape {
dim: 1
dim: 3
dim: 240
dim: 320
}
}
}
```
## Parameters
* show_threshold set to `0.5` in [yu_facedetect.cpp/line33](yu_facedetect.cpp#L33)
* image resize to `320x240` in [yu_facedetect.cpp/line134-line140](yu_facedetect.cpp#L134-L140)
## Build examples
```bash
# build tengine
cd${Tengine_ROOT}
make
make install
# build example
cd example/YuFaceDetectNet
mkdir build
cd build
cmake -DTENGINE_DIR=/home/firefly/Tengine ..
make
```
* DTENGINE_DIR is your Tengine-dir (should be absolute path)
## Run
```bash
# YuFaceDetect <proto> <caffemodel> <jpg>
YuFaceDetect \
yufacedetectnet-open-v1_new.prototxt \
yufacedetectnet-open-v1_new.caffemodel \
demo.jpg
```
## Run
1. run yolov2 by default
- model files are `tengine/models/yolo-voc.prototxt` and `tengine/models/yolo-voc.caffemodel`
- test image is `tengine/tests/images/ssd_dog.jpg`