Nextcloud with declarative apps (memories + recognize). Unable to download models for recognize app

Good news everyone! :tada:

I got it somewhat working. It now finds the nodejs binary. Still complains about the machine learning models, but somehow it already recognized a few faces (still waaaaay too few though). I’m setting the nodejs binary path like this now:

systemd.services."phpfpm-nextcloud".postStart = ''
  ${config.services.nextcloud.occ}/bin/nextcloud-occ config:app:set recognize node_binary --value '${lib.getExe pkgs.nodejs_22}'
'';

Following this recognize could not run Tensorflow, so I switched that to WASM, which seems to work. So now my postStart looks like this:

systemd.services."phpfpm-nextcloud".postStart = ''
  ${config.services.nextcloud.occ}/bin/nextcloud-occ config:app:set recognize node_binary --value '${lib.getExe pkgs.nodejs_22}'
  ${config.services.nextcloud.occ}/bin/nextcloud-occ config:app:set recognize tensorflow.purejs --value 'true'
'';
1 Like

Looks like recognize is packaged for use as a declarative app now (PR #366241).

Since I do not use declarative apps and I was also running into the issue of tensorflow not being detected properly, I performed this hack:

  1. Build recognize from nixpkgs: nix build nixpkgs#nextcloud30Packages.apps.recognize

  2. Replace the existing npm package with the build result:

    sudo mv /path/to/nextcloud/store-apps/recognize ~/recognize.bak
    sudo cp -r "$(readlink result)" /path/to/nextcloud/store-apps/recognize
    sudo chown -R nextcloud:nextloud /path/to/nextcloud/store-apps/recognize
    
2 Likes