Closed M0ebiu5 closed 3 years ago
that is because you need the full path. the example Dir I use is because I cant know the home path of every users install. I do some code trickery behind the curtain to get /example/labeled_face
to work. its really at /media/sf_500_Samsung/Nextcloud/bkup/Buissness/noflippingswitches/Code/npm-JS/node-red-contrib/node-red-contrib-facial-recognition/example/labeled_face
for me.
updating the documentation now.
And i was wondering, why the sample path started with / (running linux), and wouldnt accept any other path (also located in the same place as the example folder :) Why not use some kind of variable replacement to make it clear(er) to the user? eg: $PathOfRecognitionModule$/example/labeled_face
Thanks for your great contribution!
Joking tone --- > I'm a old school bash guy and if it was in linux sh or pascal I'd know what I'm doing. ( : P )
I did that at first using __dirname
however the path looked ugly as hell not fitting into the box. Then I thought about making the path relative to what node-red uses......basically in bash $HOME .. but that does not work for users in all builds some install with the pallet manager others don't, some put it in a dir and then use npm to install. Docker is another use case that gets weird.
So I settled for full path out of ease and just getting the node working.
If you can JS write up a pull request and I'll test it out. For now I just don't know how to go about tackling the problem for all user use cases.
you do have a fair point about the path being confusing.
The little bit of code running the path right now
//check if example path else use user defined dirPath
var user_path;
if ( this.Face_Recognition_enabled_path === '/example/labeled_face' )
{
user_path = path.join(__dirname, '/example/labeled_face');
}
else
{
user_path = this.Face_Recognition_enabled_path;
}
hmm i think you should just not name the example exception as a path - why not use "PathToLabeledFaces" in the input box as default value? This would tell the user whats expected and if it stays untouched, you can still replace it with the example path like you do now... Sorry, i cant make a pull request - my skills are too low.
I like it! making changes now
Your coding skills my be low but your idea vault is full! Most coders are bad about coming up with ideas that are good for end users.
Example: Coder writes a box that says enter age, User enters "afdsdafs" code breaks because it was expecting and integer. Coder pulls hair out.
Added you to the documnetation Contributor section. I think i found you on node-red forums.
M0ebiu5 for helping change the logic of KnownFacesPath
[M0ebiu5](https://discourse.nodered.org/u/moebius/summary) for helping change the logic of KnownFacesPath
if its not the correct link throw me any link you want or tell me no link and ill just leave it blank
Very kind of you, but it's really not necessary! I did nothing - you made all this possible...thanks again! I just got confused, we talked about it and it's now clear to me (and hopefully others :)
Marking as Closed. Thanks again.
If i change the KnownFacesPath, i get the error msg:
Error: ENOENT: no such file or directory, scandir '/face/labeled_face'
current version: 0.26.91