JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q25878F
  • License MIT

Takes a full path to an image and returns its predicted color. Will be integrated to work with live cam in order to detect colors of objects in real time.

Package Exports

  • color-predictor

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (color-predictor) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ColorPredictor

Takes a full path to an image and returns its predicted color. Will be integrated to work with live cam in order to detect colors of objects in real time.

How To Use

  1. Downloading to same directory of your project Download this repository to the same directory of your project either manually or with Git. Run npm install Example usage:
var predictColor = require("./color-finder")

var path = "path/to/image.jpg"
predictColor(path)

and run node -r esm {fileNameToBeRun.js}

Since this project uses esm with node, you can either use require or import. Both works.

  1. Downloading to a seperate directory

Download this repository either manually or with Git. Copy and paste package.jsonto your working directory, or copy the dependencies inside package.json and add them to your own project's package.json. Run npm install. Example usage:

var predictColor = require("path/to/color-classification/color-finder")

var path = "path/to/image.jpg"
predictColor(path)

and run node -r esm {fileNameToBeRun.js}

Since this project uses esm with node, you can either use require or import. Both works.

Note

The path to the trained model is given as var path = "./my-model/model.json" in predict.js. If you would like to use another model, just require it.