-
-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config.js file changes are not reflected in the gui #19
Comments
demo has default configuration overrides set in if those are removed, then defaults from how it works is that any override is deep-merged with values from |
Great thanks for the explanation |
Did not mean to close since this is outstanding :) |
i've updated the docs, will be up in the next publish, it's ok to close now. |
I still do not see any changes in the gui after changing config.js. Per your comment I do not see a config object in browser.js. I do see variables in the setupMenu function as menu.addBool('Face Detect', human.config.face, 'enabled');. My expectation would be that the gui would reflect the changes made in config.js so if I have in my config Than the gui slider FACE DETECT would load as disabled. Am I doing something wrong? |
Off Topic: When I push commit's to my fork do you get notified on github. The reason I am asking is that I don't want to bother you when I am making changes to my fork. |
i removed config object from but if you change anything in and no, i don't get notifications for separate forks. |
npm run rebuild is not a valid script. Did you mean npm rebuild? Also is there a way to use the config without running npm rebuild? I am using the demo/browser.js not the dist/demo-browser-index.js |
it's |
you could import config.js into your app directly and then use human with your version passing it as override. const myConfig = require('config.js).default;
human.detect(image, myconfig); (or equivalent import statement if you're using esm and not node) |
Thanks it works as expected. Suggestion would it not be better to just have a config.json file that can be loaded at runtime? I am testing the demo and in my case I only want the hand enabled when I open the page and everything else disabled. I also may want to start it with hand and face enabled but then I have to rebuild. I am running this in an IDE that has its own web server and importing browser.js so I don't actually need to build anything unless I change human.js I can just refresh the page. By the way human is awesome thank you very very much for the hard work!!! |
Ok importing config.js works fine for me. Thanks. |
that's the whole points of having second param to human.load() or human.detect() - to pass user configuration. why is config.js linked into human during build to start with? because i want it have sane default values in case something in user config is missing or invalid. user configuration can be single flag or entire config or anything in-between. and no harm if user config is entire config.js as it's just going to be merged into single object anyhow. and yes, it can be a json or js as well. |
I understand about the defaults and overriding. I have tried the override and it does not seem to be working browser.js import myConfig from './config.js' function main .... No change in gui sliders |
in demo, setupMenu() is called before human.load() or human.detect(), so it menu binds to default values - your values have not yet been merged at that time. |
Works perfectly. |
Tested demo folder index.html using only hand pose enabled
I also tested another variable by setting backend to wasm but the change was also not updated in the gui
The text was updated successfully, but these errors were encountered: