2021-07-16 14:34:05 +02:00
|
|
|
package service
|
|
|
|
|
|
|
|
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-02 23:47:37 +02:00
|
|
|
services.FaceNet = face.NewNet(conf.FaceNetModelPath(), "", conf.DisableTensorFlow())
|
2021-07-16 14:34:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func FaceNet() *face.Net {
|
|
|
|
onceFaceNet.Do(initFaceNet)
|
|
|
|
|
|
|
|
return services.FaceNet
|
|
|
|
}
|