2020-04-05 22:26:53 +02:00
|
|
|
package service
|
|
|
|
|
|
|
|
import (
|
|
|
|
"sync"
|
|
|
|
|
|
|
|
"github.com/photoprism/photoprism/internal/classify"
|
|
|
|
)
|
|
|
|
|
|
|
|
var onceClassify sync.Once
|
|
|
|
|
|
|
|
func initClassify() {
|
2020-12-18 09:11:42 +01:00
|
|
|
services.Classify = classify.New(Config().AssetsPath(), Config().DisableTensorFlow())
|
2020-04-05 22:26:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func Classify() *classify.TensorFlow {
|
|
|
|
onceClassify.Do(initClassify)
|
|
|
|
|
|
|
|
return services.Classify
|
|
|
|
}
|