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-04-12 18:00:31 +02:00
|
|
|
services.Classify = classify.New(Config().ResourcesPath(), Config().DisableTensorFlow())
|
2020-04-05 22:26:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func Classify() *classify.TensorFlow {
|
|
|
|
onceClassify.Do(initClassify)
|
|
|
|
|
|
|
|
return services.Classify
|
|
|
|
}
|