Rename Config.GetTensorFlowModelPath() to TensorFlowModelPath(), see #50

This commit is contained in:
Michael Mayer 2018-12-21 03:25:50 +01:00
parent 7fde545fe7
commit 7d6c3d83b7
10 changed files with 15 additions and 15 deletions

View file

@ -27,7 +27,7 @@ func importAction(ctx *cli.Context) error {
fmt.Printf("Importing photos from %s...\n", conf.ImportPath())
tensorFlow := photoprism.NewTensorFlow(conf.GetTensorFlowModelPath())
tensorFlow := photoprism.NewTensorFlow(conf.TensorFlowModelPath())
indexer := photoprism.NewIndexer(conf.OriginalsPath(), tensorFlow, conf.Db())

View file

@ -27,7 +27,7 @@ func indexAction(ctx *cli.Context) error {
fmt.Printf("Indexing photos in %s...\n", conf.OriginalsPath())
tensorFlow := photoprism.NewTensorFlow(conf.GetTensorFlowModelPath())
tensorFlow := photoprism.NewTensorFlow(conf.TensorFlowModelPath())
indexer := photoprism.NewIndexer(conf.OriginalsPath(), tensorFlow, conf.Db())

View file

@ -233,7 +233,7 @@ func (c *Config) CreateDirectories() error {
return err
}
if err := os.MkdirAll(c.GetTensorFlowModelPath(), os.ModePerm); err != nil {
if err := os.MkdirAll(c.TensorFlowModelPath(), os.ModePerm); err != nil {
return err
}
@ -391,8 +391,8 @@ func (c *Config) AssetsPath() string {
return c.assetsPath
}
// GetTensorFlowModelPath returns the tensorflow model path.
func (c *Config) GetTensorFlowModelPath() string {
// TensorFlowModelPath returns the tensorflow model path.
func (c *Config) TensorFlowModelPath() string {
return c.AssetsPath() + "/tensorflow"
}

View file

@ -38,9 +38,9 @@ type Config interface {
CachePath() string
ThumbnailsPath() string
AssetsPath() string
TensorFlowModelPath() string
DarktableCli() string
GetTensorFlowModelPath() string
GetDatabasePath() string
GetServerAssetsPath() string
GetTemplatesPath() string

View file

@ -13,7 +13,7 @@ func TestImporter_ImportPhotosFromDirectory(t *testing.T) {
conf.InitializeTestData(t)
tensorFlow := NewTensorFlow(conf.GetTensorFlowModelPath())
tensorFlow := NewTensorFlow(conf.TensorFlowModelPath())
indexer := NewIndexer(conf.OriginalsPath(), tensorFlow, conf.Db())

View file

@ -10,7 +10,7 @@ import (
func TestNewImporter(t *testing.T) {
conf := test.NewConfig()
tensorFlow := NewTensorFlow(conf.GetTensorFlowModelPath())
tensorFlow := NewTensorFlow(conf.TensorFlowModelPath())
indexer := NewIndexer(conf.OriginalsPath(), tensorFlow, conf.Db())
@ -25,7 +25,7 @@ func TestImporter_GetDestinationFilename(t *testing.T) {
conf := test.NewConfig()
conf.InitializeTestData(t)
tensorFlow := NewTensorFlow(conf.GetTensorFlowModelPath())
tensorFlow := NewTensorFlow(conf.TensorFlowModelPath())
indexer := NewIndexer(conf.OriginalsPath(), tensorFlow, conf.Db())

View file

@ -15,7 +15,7 @@ func TestTensorFlow_GetImageTags(t *testing.T) {
conf.InitializeTestData(t)
tensorFlow := NewTensorFlow(conf.GetTensorFlowModelPath())
tensorFlow := NewTensorFlow(conf.TensorFlowModelPath())
if imageBuffer, err := ioutil.ReadFile(conf.ImportPath() + "/iphone/IMG_6788.JPG"); err != nil {
t.Error(err)

View file

@ -12,7 +12,7 @@ func TestTensorFlow_GetImageTagsFromFile(t *testing.T) {
conf.InitializeTestData(t)
tensorFlow := NewTensorFlow(conf.GetTensorFlowModelPath())
tensorFlow := NewTensorFlow(conf.TensorFlowModelPath())
result, err := tensorFlow.GetImageTagsFromFile(conf.ImportPath() + "/iphone/IMG_6788.JPG")

View file

@ -15,7 +15,7 @@ func TestCreateThumbnailsFromOriginals(t *testing.T) {
conf.InitializeTestData(t)
tensorFlow := NewTensorFlow(conf.GetTensorFlowModelPath())
tensorFlow := NewTensorFlow(conf.TensorFlowModelPath())
indexer := NewIndexer(conf.OriginalsPath(), tensorFlow, conf.Db())

View file

@ -113,7 +113,7 @@ func (c *Config) CreateDirectories() error {
return err
}
if err := os.MkdirAll(c.GetTensorFlowModelPath(), os.ModePerm); err != nil {
if err := os.MkdirAll(c.TensorFlowModelPath(), os.ModePerm); err != nil {
return err
}
@ -248,8 +248,8 @@ func (c *Config) AssetsPath() string {
return AssetsPath
}
// GetTensorFlowModelPath returns the tensorflow model path.
func (c *Config) GetTensorFlowModelPath() string {
// TensorFlowModelPath returns the tensorflow model path.
func (c *Config) TensorFlowModelPath() string {
return c.AssetsPath() + "/tensorflow"
}