mirror of
https://github.com/photoprism/photoprism.git
synced 2025-10-19 07:05:32 +08:00
33 lines
836 B
Go
33 lines
836 B
Go
package config
|
|
|
|
import (
|
|
"path/filepath"
|
|
|
|
tf "github.com/tensorflow/tensorflow/tensorflow/go"
|
|
)
|
|
|
|
// TensorFlowVersion returns the TenorFlow framework version.
|
|
func (c *Config) TensorFlowVersion() string {
|
|
return tf.Version()
|
|
}
|
|
|
|
// TensorFlowModelPath returns the TensorFlow model path.
|
|
func (c *Config) TensorFlowModelPath() string {
|
|
return filepath.Join(c.AssetsPath(), "nasnet")
|
|
}
|
|
|
|
// FaceNetModelPath returns the FaceNet model path.
|
|
func (c *Config) FaceNetModelPath() string {
|
|
return filepath.Join(c.AssetsPath(), "facenet")
|
|
}
|
|
|
|
// NSFWModelPath returns the "not safe for work" TensorFlow model path.
|
|
func (c *Config) NSFWModelPath() string {
|
|
return filepath.Join(c.AssetsPath(), "nsfw")
|
|
}
|
|
|
|
// DetectNSFW checks if NSFW photos should be detected and flagged.
|
|
func (c *Config) DetectNSFW() bool {
|
|
return c.options.DetectNSFW
|
|
}
|