matiasdelellis / facerecognition

Nextcloud app that implement a basic facial recognition system.
GNU Affero General Public License v3.0
510 stars 46 forks source link

TypeError when setting model #560

Open RobMahn opened 2 years ago

RobMahn commented 2 years ago

Expected behaviour

Set Face Recognition Mode

Actual behaviour

An unhandled exception has been thrown: TypeError: OCA\FaceRecognition\Command\SetupCommand::setupModel(): Argument #1 ($modelId) must be of type int, string given, called in /var/www/nextcloud/apps/facerecognition/lib/Command/SetupCommand.php on line 102 and defined in /var/www/nextcloud/apps/facerecognition/lib/Command/SetupCommand.php:138

Steps to reproduce

sudo -u www-data php occ face:setup -m MODEL_ID # or ./occ face:setup --model 2

Assumption

Something in my installation enabled strict mode typing.

Fix

Edit SetupCommand.php line 100 to convert the model to int. $modelId = intval($input->getOption('model'));

Server configuration

matiasdelellis commented 2 years ago

I'm going to see it.. 🤔

Thank you.. and sorry for the delay in answering..

derekakelly commented 2 years ago

I can confirm this issue happened to me as well. Changing the line mentioned above allowed me to install the default model. Looks like it's starting to scan my files now. Thanks!

Ubuntu 22.04 NC 24 PHP 8.1