infinitered/nsfwjs

Supporting model load from indexeddb

Ouverte

#430 ouverte le 24 oct. 2020

 (2 commentaires) (0 réaction) (0 personne assignée)JavaScript (507 forks)batch import
Browser Issuesgood first issuehelp wanted

Métriques du dépôt

Stars
 (7 090 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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 ...

Guide contributeur