Comments (4)
I mean... It is possible, but it's not elegant (going from JavaScript to SQL so rarely is). With the current version (v1.0.8) you can access the knnClassifier dataset. From there you can use Tensorset to make it readable for ImageClassifier
This will give you the dataset data as JSON without having to save it
const knnDataset = JSON.parse(await Tensorset.stringify(myImageClassifier.classifier.getClassifierDataset())); // Though classifier will most likely not be exposed like this in future updates
knnDataset will look something like this:
[
{
"label": "Example 1 Label",
"values": [ 52, 432, 432, 12, 152, ... ],
"shape": [ 20, 1024 ]
},
{
"label": "Example 2 Label",
"values": [ 52, 432, 432, 12, 152, ... ],
"shape": [ 30, 1024 ]
},
...
]
From there you can make your SQL statement to save the data to your database.
When your ready to read it back in put it in the exact same format as the knnDataset variable above and set the classifier like so:
myImageClassifier.classifier.setClassifierDataset(Tensorset.parse(/* The similar variable to knnDataset */));
from image-classifier.
Hope this helped, but I do not plan on making any future updates to support this. My best recommendation would be use a NoSQL database like Firebase or Mongo if possible. I'm closing the issue, but feel free to leave a comment here if you have any more questions about this.
from image-classifier.
Thanks! The only problem with JSON is it can't handle large data and breaks.
from image-classifier.
Np, but if you're referring to the speed at which the dataset is being loaded or unloaded, ImageClassifier hasn't yet been updated to use the latest version of Tensorset, which drastically improves the speed.
All this being said if large amounts of data is an issue, I've been thinking of creating a new format for compressed and diversified datasets, so the performance could improve.
from image-classifier.
Related Issues (9)
- Repo files seems wrong?! HOT 2
- Platform node has already been set error HOT 1
- Error on execution
- [Mac M1] Error on npm i HOT 2
- UnhandledPromiseRejectionWarning: TypeError: data is not iterable HOT 5
- Most of the images are not working! HOT 5
- Tensorset.stringify is not a function. HOT 4
- Problem with installing dependencis HOT 1
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 image-classifier.