Node-red-contrib-facemask-detector fails to install

Hi, I am trying to experiment with the node-red-contrib-facemask-detector but it never installs successfully.
After some research I installed what seems to be dependencies:
node-red-contrib-tf-function
node-red-contrib-tf-model

also installed for other tests are:
node-red-contrib-tensorflow
node-red-contrib-tfjs-coco-ssd

But when I try to install the facemask-detector it seems like installed but when I check Pallete/Nodes the facemask-detector node shows a message: MODULE_NOT_FOUND

Assistance welcome.
Thanks

You could ask the node author - GitHub - dev-willcode/node-red-contrib-facemask-detector

Hi, I am installing from within Node red web interface.

Paulo Borges

OK, but we need to see the logs to know why it failed.

Most likely it is because you are missing a native pre-requisites

Also as the README clearly states you need to have installed @microsoft/customvision-tfjs-node and @tensorflow/tfjs-node as well. (These can NOT be installed via the Node-RED Editor)

Since the developer has not chosen to link the node to it's GitHub repo there is no easy way to contact them.

1 Like

Hi, yes, the log for the installation of facemask-detector has errors.
I will run the installation again and provide the contents of the log.
But you mention something Microsoft, I am running on a Pi4, do I still have to consider that mention?
In fact I fill some prerequisite is missing but cannot find what.
Thanks

facemask-detector installation log:

2021-08-14T20:09:12.837Z Install : node-red-contrib-facemask-detector 1.0.0

2021-08-14T20:09:14.372Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-facemask-detector@1.0.0
2021-08-14T20:09:22.875Z [err] npm
2021-08-14T20:09:22.876Z [err]
2021-08-14T20:09:22.876Z [err] WARN
2021-08-14T20:09:22.877Z [err] @tensorflow-models/mobilenet@2.1.0 requires a peer of @tensorflow/tfjs-converter@^3.1.0 but none is installed. You must install peer dependencies yourself.
2021-08-14T20:09:22.901Z [err] npm
2021-08-14T20:09:22.902Z [err]
2021-08-14T20:09:22.902Z [err] WARN
2021-08-14T20:09:22.902Z [err] @tensorflow-models/mobilenet@2.1.0 requires a peer of @tensorflow/tfjs-core@^3.1.0 but none is installed. You must install peer dependencies yourself.
2021-08-14T20:09:22.931Z [err] npm
2021-08-14T20:09:22.931Z [err] WARN @tensorflow-models/posenet@2.2.2 requires a peer of @tensorflow/tfjs-converter@^3.0.0-rc.1 but none is installed. You must install peer dependencies yourself.
2021-08-14T20:09:22.955Z [err] npm
2021-08-14T20:09:22.956Z [err] WARN @tensorflow-models/posenet@2.2.2 requires a peer of @tensorflow/tfjs-core@^3.0.0-rc.1 but none is installed. You must install peer dependencies yourself.
2021-08-14T20:09:22.980Z [err] npm
2021-08-14T20:09:22.980Z [err] WARN @tensorflow/tfjs-data@1.4.0 requires a peer of @tensorflow/tfjs-core@1.4.0 but none is installed. You must install peer dependencies yourself.
2021-08-14T20:09:23.004Z [err] npm WARN
2021-08-14T20:09:23.004Z [err] @tensorflow/tfjs-layers@1.4.0 requires a peer of @tensorflow/tfjs-core@1.4.0 but none is installed. You must install peer dependencies yourself.
2021-08-14T20:09:23.028Z [err] npm WARN
2021-08-14T20:09:23.028Z [err] node-red-contrib-facemask-detector@1.0.0 requires a peer of @tensorflow/tfjs-node@^2.8.3 but none is installed. You must install peer dependencies yourself.
2021-08-14T20:09:23.057Z [err] npm
2021-08-14T20:09:23.057Z [err] WARN node-red-contrib-facemask-detector@1.0.0 requires a peer of @microsoft/customvision-tfjs-node@^1.1.0 but none is installed. You must install peer dependencies yourself.
2021-08-14T20:09:23.058Z [err]
2021-08-14T20:09:23.060Z [out] + node-red-contrib-facemask-detector@1.0.0
2021-08-14T20:09:23.060Z [out] added 1 package from 1 contributor in 7.328s
2021-08-14T20:09:23.108Z rc=0

Just because Microsoft wrote it, doesn't mean it will only run on Windows (and even if it did it would just mean you could only run this node on a Windows machine so you'd be out of luck.).

Yes you must install ALL the pre-reqs listed in the readme.

The errors also give you very clear instructions on what you need to do.

Ok, let me understand, from the beginning of the log I see:
"@tensorflow-models/mobilenet@2.1.0 requires a peer of @tensorflow/tfjs-converter@^3.1.0 but none is installed."
I Understand:
I need to install @tensorflow/tfjs-converter@^3.1.0, or tensorflow/tfjs-converter version 3.1.0
Where do I get that?
Do I install it from terminal using: sudo apt get (something like: tensorflow/tfjs-converter)?
Thanks

I posted a link to his repo in my post above.

Start by following ALL the instructions in the README

The README contain the same as the link provided by Paul-Reed.
I followed the Install section and manually run:

Go to .node red folder (usually located at C:\Users\{YOUR_USER}\.node-red ) and execute:
npm install @microsoft/customvision-tfjs-node
npm install @tensorflow/tfjs-node
and then, install the node using:
npm install -S node-red-contrib-facemask-detector

But it complains of the very same dependencies that the Node-Red web interface complains.
What precisely do I have to install to satisfy these dependencies?
My experience with Linux is not enough to understand where to get these things.
Thanks

I posted that link so that you could ask the developer why it isn't working.
If you have followed the readme exactly, and it doesn't work, then raise an issue in the git repo, and hopefully the developer who wrote it will answer you.

I have found that a lot of these tensorflow type nodes have conflicting requirements. Make sure you completely remove any other tf type installs and their pre-reqs before installing.

Hi Paul, thanks for the input, I am still assuming it is something wrong with what I am doing.
Will wait some more clues and research a little more before bothering the developer.
Thanks

Hi, yes, it makes sense, I have been trying several object detection projects recently and if that is the case my environment may well be a little polluted.
May be I will try to reload Raspbian from scratch and try again and see what happens.
Thanks

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.