/Google-Vision-Plants-Application

Application that uses Google Vision to retrieve features of a plant image and will recommend images with similar features.

Primary LanguageJavaScript

Image Recommendation System

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.

Getting Started

Prerequisites

Make sure you have Node.js, and Git are installed.

Requires key.json file for the use of Google Vision API.

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 */)

Installation

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