Replies: 15 comments 26 replies
-
I wouldn't change typedef as it implies quite a lot of changes throughout the code (but I'll take a look at it). On the other hand, you should be able to subscribe to events to receive 'loading' and 'loaded' events. Thinking more, I could add a callback to monitor fetch progress, but the problem is that it's not uniform in node VS browser, so I'd neee a lot of if/then code and in general I try to avoid that. |
Beta Was this translation helpful? Give feedback.
-
they don't currently, but thats the cleanest way to expose functionality you need. i'll add it soon, only issue is that i'm currently on vacation - eta 2 weeks. |
Beta Was this translation helpful? Give feedback.
-
just added a function, |
Beta Was this translation helpful? Give feedback.
-
as a side note, have you considered github packages npm registry for a quicker turnover than npm releases? |
Beta Was this translation helpful? Give feedback.
-
got past seedrandom, but stuck at node-canvas now
|
Beta Was this translation helpful? Give feedback.
-
silly question - why are you doing anyhow, |
Beta Was this translation helpful? Give feedback.
-
can you try |
Beta Was this translation helpful? Give feedback.
-
browser cache? or something similar to that? method is definitely defined in /** get model loading/loaded stats */
getModelStats = () => models.getModelStats(); and output is something like: {
"sizeManifest": 25461729,
"sizeWeights": 25461729,
"numModels": 8
} |
Beta Was this translation helpful? Give feedback.
-
its used in a demo app and working? see human/demo/typescript/index.ts Line 108 in a3ebba7 |
Beta Was this translation helpful? Give feedback.
-
there are some other methods missing as well, seems like your lets see if this works - i just changed definition to explicit method instead
to
|
Beta Was this translation helpful? Give feedback.
-
this makes zero sense. can you check |
Beta Was this translation helpful? Give feedback.
-
seems like a regression in #209 (which was originally issue you've reported) cause is recent change in note that this fix is purely to keep anyhow, new version is on github |
Beta Was this translation helpful? Give feedback.
-
i've tested with
I'd need a bit more to look at that?
how?????
also, its nearly impossible to know which models are going to be requested - so for your use-case, you can store to do that programaticaly in the library would mean coding model sizes in the library itself so library knows what is what. i might do that, but need to do it the right way so its autogenerated as part of the build process, not hard-coded. |
Beta Was this translation helpful? Give feedback.
-
i did a complete rehauld of {
numLoadedModels: 8, // models that have started loading
numEnabledModels: undefined, // not supported yet as it would require full static config parsing
numDefinedModels: 22, // number of defined models in human, comes from human.models
totalSizeFromManifest: 25461729, // sum of sizeFromManifest
totalSizeWeights: 25461729, // sum of sizeLoadedWeights
totalSizeLoading: 25461729, // sum of sizeDesired
totalSizeEnabled: undefined, // not supported yet as it would require full static config parsing
modelStats: [ // array containing details about each model that has started loading
{
name: 'blazeface', // model name
sizeFromManifest: 538928, // set after each models .json has been loaded
sizeLoadedWeights: 538928, // set after each models .bin has been loaded
sizeDesired: 538928, // precalculated value during build process for all models
inCache: false // id model is found in indexdb cache
},
{
name: 'emotion',
sizeFromManifest: 820516,
sizeLoadedWeights: 820516,
sizeDesired: 820516,
inCache: false
}
...
]
} basically, you can look at btw, version tag is bumped to |
Beta Was this translation helpful? Give feedback.
-
really glad it works and there are no more issues! but i cannot reproduce race condition you mention - see below code: const startTime = new Date();
log('start', { human: human.version, tf: tf.version_core, progress: human.getModelStats().percentageLoaded });
setInterval(() => log('interval', { elapsed: new Date() - startTime, progress: human.getModelStats().percentageLoaded }));
const loadPromise = human.load();
loadPromise.then(() => log('resolved', { progress: human.getModelStats().percentageLoaded }));
await loadPromise;
log('final', { progress: human.getModelStats().percentageLoaded }); start { human: '2.9.0', tf: '3.18.0', progress: 0 }
interval { elapsed: 8, progress: 0 }
interval { elapsed: 9, progress: 0 }
interval { elapsed: 12, progress: 0 }
interval { elapsed: 14, progress: 0 }
interval { elapsed: 17, progress: 0 }
interval { elapsed: 18, progress: 0 }
interval { elapsed: 26, progress: 0.05339166087267679 }
interval { elapsed: 26, progress: 0.05339166087267679 }
interval { elapsed: 28, progress: 0.05339166087267679 }
interval { elapsed: 38, progress: 0.11143791531203556 }
interval { elapsed: 39, progress: 0.11143791531203556 }
interval { elapsed: 43, progress: 0.2135162934143239 }
interval { elapsed: 43, progress: 0.2135162934143239 }
interval { elapsed: 74, progress: 0.3299591712723044 }
interval { elapsed: 74, progress: 0.3299591712723044 }
interval { elapsed: 96, progress: 0.5125946867158943 }
interval { elapsed: 96, progress: 0.5125946867158943 }
interval { elapsed: 106, progress: 0.7259096583739463 }
resolved { progress: 1 }
final { progress: 1 } |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
hi vlad, is there a way to get the progress of models while loading? i would like to implement a loading progress bar if possible. at the very least i would like to know when a specific model is done loading. i tried yesterday to monitor
human.models
but got type issues withGraphModel
andio.IOHandler
. it is also kinda hard to figure out when the model moves fromnull
toPromise
toGraphModel
. is it possible to change maybe i.e:to
so that each dynamic model waits and resolves when loaded or rejects when disabled i.e Promise.reject('antispoof disabled')?
Beta Was this translation helpful? Give feedback.
All reactions