Unverified Commit a98688bd authored by Ivan Petkov's avatar Ivan Petkov
Browse files

photoprism: fix model linking

Photoprism expects models to appear under
$PHOTOPRISM_ASSETS_PATH/models/* and not just $PHOTOPRISM_ASSETS_PATH/*.

Without this change models like facenet won't actually be loaded, and
the following error will show up in logs:

```
vision: Could not find SavedModel .pb or .pbtxt at supplied export directory path: /nix/store/...-photoprism-251130-b3068414c/share/photoprism/models/facenet. Check that the directory exists and that you have the right permissions for accessing it. (init )
```
parent cab52b36
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -84,10 +84,14 @@ stdenv.mkDerivation (finalAttrs: {

    # install frontend
    ln -s ${frontend}/assets/* ${assets_path}
    rm ${assets_path}/models
    mkdir -p ${assets_path}/models
    ln -s ${frontend}/assets/models/* ${assets_path}/models/

    # install tensorflow models
    ln -s ${nasnet}/nasnet ${assets_path}
    ln -s ${nsfw}/nsfw ${assets_path}
    ln -s ${facenet}/facenet ${assets_path}
    ln -s ${nasnet}/nasnet ${assets_path}/models/
    ln -s ${nsfw}/nsfw ${assets_path}/models/
    ln -s ${facenet}/facenet ${assets_path}/models/

    runHook postInstall
  '';