mirror of
https://github.com/bububa/openvision.git
synced 2025-09-27 10:02:11 +08:00
feat(face): add yolov5 face detecter
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user