label

command
v0.0.0-...-495e291 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

README

Google Cloud Vision API Go example

Get Dependencies

This sample depends on the following packages. Before getting started, be sure to get them.

go get -u golang.org/x/net/context golang.org/x/oauth2/google google.golang.org/api/vision/...

To run tests, getting the following package.

go get -u github.com/stretchr/testify/assert

Setup

  • Create a project with the Google Cloud Console, and enable the Vision API.

  • From the Cloud Console, create a service account, download its json credentials file, then set the GOOGLE_APPLICATION_CREDENTIALS environment variable:

    export GOOGLE_APPLICATION_CREDENTIALS=/path/to/your-project-credentials.json
    

Run the sample

To build and run the sample:

go run label.go ../../data/label/cat.jpg

Documentation

Overview

Command label uses the Vision API's label detection capabilities to find a label based on an image's content.

go run label.go <path-to-image>

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL