infinitered/nsfwjs

Supporting model load from indexeddb

Open

#430 aperta il 24 ott 2020

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)JavaScript (507 fork)batch import
Browser Issuesgood first issuehelp wanted

Metriche repository

Star
 (7090 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

https://github.com/infinitered/nsfwjs/blob/ebcd41c46087a3f42c6577f96acc53d7a934b068/src/index.ts#L68

Hello, it seems, although not explicit I can save the model to different schemas by referencing the underlying "model" attribute in the model returned by nsfwjs.load() e.g.

nsfwjs.load(path).then(function (newModel) { console.log("path", path); if(newModel) { newModel.model.save('indexeddb://' + SOME_KEY); } }).catch(error => { console.error('onRejected function called: ' + error.message); })

However, I am unable to then reload the model from say an indexeddb location using:

nsfwjs.load('indexeddb://' + SOME_KEY) as the line above in the code just checks for a string, assumes it's a url or relative path, rather than another schema location and them appends 'model.js'.

I think tf.js supports loading and saving to other schemas, it'd be cool if NSFWJS followed suit ...

Guida contributor