A short and interesting project that uses the Google Vision API, and recommends images (from a select database of plants) based on input image!
Currently looks through existing 20 plant images, but will expand to a larger data set.
Look through Notes.md
to see my thought process of developing this small application.
Make sure you have Node.js, and Git are installed.
Requires key.json
file for the use of Google Vision API
.
- Instructions can be found on Google Vision website, just follow the instructions and documentation.
Once a key.json
just use these code snippets to use Google Vision
const client = vision({
projectId: "PROJECT NAME",
keyFilename: "./key.json",
});
// returns a promise,
client.annotateImage({
image: {
source: {imageUri: IMAGE_URL}
},
features: {type: vision.v1.types.Feature.Type.LABEL_DETECTION},
})
.then(json => /* what you wish to do with the resulting data */)
.catch(err => /* what you wish to do with resulting errors */)
Simply install from Install directly from Github repo.
Once you have placed a key.json
you can install dependencies and run the code
- NOTE: need to give 2 arguments, use
--help
command to see which arguments are required.
git clone <repo url>
cd <repo>
npm install
npm start --help
You can also test by running
npm test