12 Commits

Author SHA1 Message Date
Michael Mayer
780a870f5c CI: Apply Go more linter recommendations to "ai/classify" package #5330
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-11-22 11:30:58 +01:00
Michael Mayer
94b6631b3d Test: Use PascalCase names for all Go subtests in /internal
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-10-02 14:50:02 +02: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
ab0bd1c732 Config: Change default vision model assets path to assets/models/ #127
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-08-08 19:06:56 +02:00
Michael Mayer
3177a61f75 AI: Update log messages and tests in internal/ai/classify #127 #5011
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-08-04 10:31:39 +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
3b1e1bb32a Added tests for resize operations
And fixed a typo detected by using them.
2025-07-25 22:22:19 +00:00
raystlin
adc4dc0f74 Added new parameters to model input.
New parameters have been added to define the input of the models:
* ResizeOperation: by default center-crop was being performed, now it is
  configurable.
* InputOrder: by default RGB was being used as the order for the array
  values of the input tensor, now it can be configured.
* InputInterval has been changed to InputIntervals (an slice). This
  means that every channel can have its own interval conversion.
* InputInterval can define now stddev and mean, because sometimes
  instead of adjusting the interval, the stddev and mean of the training
data should be use.
2025-07-15 13:31:31 +00:00
raystlin
ad94d03576 Fixed classify and nsfw tests
They were broken when the constructors changed to include metadata.
2025-04-13 14:53:34 +00:00
Michael Mayer
caf3ae1ab5 AI: Refactor use of face embeddings, labels, and nsfw models #127 #1090
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-04-10 16:49:34 +02: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
Michael Mayer
35e9294d87 AI: Add vision package and vision API endpoints #127 #1090
These changes allow to configure the computer vision models through an
optional vision.yml configuration file. Note that the API endpoints
are not yet functional and require further work.

Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-04-06 23:39:37 +02:00