feat(face): add yolov5 face detecter

This commit is contained in:
Syd Xu
2021-10-29 19:05:58 +08:00
parent a61f9dc7b0
commit 50e43fc864
49 changed files with 1057 additions and 736 deletions

View File

@@ -32,6 +32,7 @@ func test_detect(imgPath string, modelPath string) {
retinaface(modelPath),
centerface(modelPath),
mtcnn(modelPath),
yoloface(modelPath),
} {
detect(d, imgPath, idx, "4.jpg", false)
d.Destroy()
@@ -62,6 +63,15 @@ func mtcnn(modelPath string) detecter.Detecter {
return d
}
func yoloface(modelPath string) detecter.Detecter {
modelPath = filepath.Join(modelPath, "yoloface/v505")
d := detecter.NewYoloFace()
if err := d.LoadModel(modelPath); err != nil {
log.Fatalln(err)
}
return d
}
func centerface(modelPath string) detecter.Detecter {
modelPath = filepath.Join(modelPath, "centerface")
d := detecter.NewCenterface()