FORGEBOX Enterprise 🚀 - Take your ColdFusion (CFML) Development to Modern Times! Learn More...

GoogleCloudVision

v0.1.0 Public

GoogleCloudVision

Implements Google Cloud Vision Api for Coldbox Coldfusion

The Cloud Vision API gives you simple access to multiple image recognition methods using machine learning, e.g.

  • face detection
  • landmark detection
  • explict content detection
  • logo detection
  • OCR

See https://cloud.google.com/vision/ as well https://cloud.google.com/vision/docs/

Currently API Key only is supported

Installation

You will need a Google Account to work with this API As well you need to set up Google Cloud APIs See here: https://cloud.google.com/vision/docs/quickstart

This API can be installed as standalone or as a ColdBox Module. Either approach requires a simple CommandBox command:

box install GoogleCloudVision

Then follow either the standalone or module instructions below.

Standalone

This API will be installed into a directory called GoogleCloudVision and then the API can be instantiated via new GoogleCloudVision.models.VisionClient(apiKey='YOUR_KEY_GOES_HERE') with the following constructor arguments:

ColdBox Module

This package also is a ColdBox module as well. The module can be configured by adding GoogleApiKey in your application configuration file: config/Coldbox.cfc with the following settings:

	settings = {

		// Your Google API Key
		GoogleApiKey = "",
		
		// Your settings....

	};

Then you can leverage the API CFC via the injection DSL: [email protected]

Usage

/**
* A normal ColdBox Event Handler
*/
component{
	property name="VisionClient" inject="[email protected]";
	
	function index(event,rc,prc){

		// detect landmarks
		var img = VisionClient.image('http://www0.f1online.de/preW/011559000/11559221.jpg').detect_landmarks();
		VisionClient.annotate(img);
		writeDump(img.getAnnotation());		

		abort;
	}
}

Written by

www.akitogo.com

Disclaimer

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Here are all the versions for this package. Please note that you can leverage CommandBox package versioning to install any package you like. Please refer to our managing package version guide for more information.

Version Created Last Update Published By Stable Actions
Current
0.1.0 Apr 30 2017 10:17 AM Apr 30 2017 10:17 AM

 

No collaborators yet.
 
  • Apr 30 2017 10:17 AM
  • Apr 30 2017 10:17 AM
  • 574
  • 541
  • 9