Comments (16)
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!!!
from human.
Works perfectly.
from human.
demo has default configuration overrides set in demo/browser.js:config
- simply for purpose of having a local variable so menu can bind something to directly
if those are removed, then defaults from config.js
are used
how it works is that any override is deep-merged with values from config.js
from human.
Great thanks for the explanation
from human.
Did not mean to close since this is outstanding :)
from human.
i've updated the docs, will be up in the next publish, it's ok to close now.
from human.
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
face: {
enabled: false
}
Than the gui slider FACE DETECT would load as disabled. Am I doing something wrong?
from human.
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.
from human.
i removed config object from browser.js
earlier today, demo should now link directly to config from main library, meaning config.js
.
but if you change anything in config.js
directly, you do need to do a library rebuild, either using npm run rebuild
or use dev-server i wrote yesterday, npm run dev
and no, i don't get notifications for separate forks.
from human.
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
from human.
it's npm run build
(sorry, my typo)
and no, config.js is included in human.js (esm/node/whatever) library, so library needs to be rebuild before it's even exposed to client.
from human.
you could import config.js into your app directly and then use human with your version passing it as override.
something like
const myConfig = require('config.js).default;
human.detect(image, myconfig);
(or equivalent import statement if you're using esm and not node)
from human.
Ok importing config.js works fine for me. Thanks.
from human.
that's the whole points of having second param to human.load() or human.detect() - to pass user configuration.
then it's merged with defaults that come from config.js.
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.
from human.
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 ....
console.log(myConfig.backend) // = webgl
await human.detect(warmup, myConfig);
No change in gui sliders
from human.
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.
if you want to directly bind menu to your values regardless, change setupMenu parameters to use your object instead of human.config
.
from human.
Related Issues (20)
- Crashing on iOS HOT 5
- Bb
- Html
- Crashes with React Native on Android HOT 3
- what's the models format and is there a way to convert them to onnx? HOT 3
- How to destroy human cache? HOT 1
- React-Native Implementation HOT 1
- Seems to detect only one hand at a time? HOT 5
- Typos and the like HOT 7
- Where can I find code for gaze detection in the repository ? HOT 1
- Package installation error HOT 3
- the same photo,human.esm.js human.js both Inconsistent detection results HOT 2
- Unable to install packages HOT 1
- Error when run npm run build HOT 2
- Using in a chrome extension HOT 1
- adding custom emotion model & post detection logic HOT 1
- gaze detection logic & comparison HOT 1
- human.match.find function allways return similarity 0 HOT 2
- Error: input error: type not recognized at U2 HOT 1
- human.tf.memory().numTensors after human.load() doesn't give zero HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from human.