Commit Graph

7 Commits

Author SHA1 Message Date
Michael Mayer
75bc6d754c CI: Apply Go linter recommendations to "ai/tensorflow" package #5330
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-11-22 11:47:17 +01:00
raystlin
519a6ab34a AI: Add TensorFlow model shape detection #127 #5164
* AI: Added support for non BHWC models

Tensorflow models use BHWC by default, however, if we are using
converted models, we can find that the expected input is BCHW. Now the
input is configurable (although the restriction of being dimesion 4 is
still there) via Shape parameter on the input definition. Also, the
model instrospection will try to deduce the input shape from the model
signature.

* AI: Added more tests for enum parsing

ShapeComponent was missing from the tests

* AI: Modified external tests to the new url

The path has been moved from tensorflow/vision to tensorflow/models

* AI: Moved the builder to the model to reuse it

It should reduce the amount of allocations done

* AI: fixed errors after merge

Mainly incorrect paths and duplicated variables
2025-08-16 15:55:59 +02:00
Michael Mayer
b241fa621d AI: Refactor error logs in internal/ai packages #127 #5011
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-08-04 12:14:23 +02:00
Michael Mayer
10fe7d2b40 AI: Make error messages lower case in ai/tensorflow/info.go #127 #5011
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-08-04 10:00:09 +02:00
raystlin
d082929dee Removed parameter Channels
It seems to be standarized, so it is now used as an additional check for
input signatures.
2025-04-16 08:19:58 +00:00
raystlin
d0f6d903e2 Added utilities to inspect tensorflow models.
These new functions allows us to inspect the saved models, get the tags
and try to guess the inputs and outputs.
2025-04-11 14:30:48 +00:00
Michael Mayer
bfdb839d01 AI: Add TensorFlow utility package and improve model loading #127 #1090
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-04-07 05:26:45 +02:00