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