2022-10-15 21:54:11 +02:00
|
|
|
package get
|
2021-07-16 14:34:05 +02:00
|
|
|
|
|
|
|
import (
|
|
|
|
"sync"
|
2021-07-16 19:32:33 +02:00
|
|
|
|
|
|
|
"github.com/photoprism/photoprism/internal/face"
|
2021-07-16 14:34:05 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
var onceFaceNet sync.Once
|
|
|
|
|
|
|
|
func initFaceNet() {
|
2021-09-24 01:53:42 +02:00
|
|
|
services.FaceNet = face.NewNet(conf.FaceNetModelPath(), "", conf.DisableFaces())
|
2021-07-16 14:34:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func FaceNet() *face.Net {
|
|
|
|
onceFaceNet.Do(initFaceNet)
|
|
|
|
|
|
|
|
return services.FaceNet
|
|
|
|
}
|