Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/we0091234/yolov7-face-tensorrt

yolov7-face tensorrt
https://github.com/we0091234/yolov7-face-tensorrt

face-detection face-landmark-detection yolov5-face yolov5-face-landmark yolov7 yolov7-face

Last synced: 3 months ago
JSON representation

yolov7-face tensorrt

Awesome Lists containing this project

README

        

# yolov7-face TensorRT

## yolov7-face

The Pytorch implementation is [yolov7-face](https://github.com/derronqi/yolov7-face).

## **onnx export**

step1. git clone https://github.com/derronqi/yolov7-face

step2. modify models/export.py

```
#line 72
#output_names = None
# modified into:
output_names = ["output"]
```

step3. modify models/yolo.py class IKeypoint

```
#line 308
# return x if self.training else (torch.cat(z, 1), x)
# modified into:
return x if self.training else torch.cat(z, 1)
```

step4. Export to onnx model

```
cd yolov7-face
python models/export.py --weights yolov7s-face.pt --grid
```

## How to Run, yolov7s-face as example

1. Modify the tensorrt cuda opencv path in CMakeLists.txt

```
#cuda
include_directories(/mnt/Gu/softWare/cuda-11.0/targets/x86_64-linux/include)
link_directories(/mnt/Gu/softWare/cuda-11.0/targets/x86_64-linux/lib)

#tensorrt
include_directories(/mnt/Gpan/tensorRT/TensorRT-8.2.0.6/include/)
link_directories(/mnt/Gpan/tensorRT/TensorRT-8.2.0.6/lib/)
```
2. build

```
1. mkdir build
2. cd build
3. cmake ..
4. make

```
3. onnx to tensorrt model

```
./onnx2trt/onnx2trt ../onnx_model/yolov7s-face.onnx ./yolov7s-face.trt 1

```
4. inference

```
./yolov7_face yolov7s-face.trt ../images
```

The results are saved in the build folder.

![image](result/test.jpg)

## contact

Tencent qq group: 871797331