glasses

package module
v0.0.0-...-68021ed Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2016 License: MIT Imports: 7 Imported by: 0

README

Circle CI GoDoc

![Glasses by Kyle Scott] (https://s3.amazonaws.com/ahamidi-public/glasses.png)

Glasses

Go package for the Google Cloud Vision API

TODO

  • Auth
  • Request
  • Tests
  • Docs
  • CI

Usage

CLI Tool
  • Build: go build ./cmd/glasses
  • Run: ./glasses -f image.jpg

Requirements

  • Authentication: Authentication depends on Application Default Credentials. Setting that up is beyond the scope of this project, but essentially requires the creation of a Service Account, download the JSON formatted credentials and setting an Env Var to point at it.

Glasses Icon by Kyle Scott from Noun Project

Documentation

Index

Constants

View Source
const (
	CLOUD_VISION_ENDPOINT = "https://vision.googleapis.com/v1alpha1/images:annotate"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AnnotateRequest

type AnnotateRequest struct {
	Image        *Image        `json:"image"`
	Features     []Feature     `json:"features"`
	ImageContext *ImageContext `json:"imageContext,omitempty"`
}

type AnnotateResponse

type AnnotateResponse struct {
	FaceAnnotations      []interface{} `json:"faceAnnotations"`
	LandmarkAnnotations  []interface{} `json:"landmarkAnnotation"`
	LogoAnnotations      []interface{} `json:"logoAnnotations"`
	LabelAnnotations     []interface{} `json:"labelAnnotations"`
	TextAnnotations      []interface{} `json:"textAnnotations"`
	SafeSearchAnnotation interface{}   `json:"safeSearchAnnotation"`
	SuggestAnnotations   []interface{} `json:"suggestAnnotations"`
	QueryAnnotation      interface{}   `json:"queryAnnotation"`
	Error                interface{}   `json:"error"`
}

type AnnotateResponses

type AnnotateResponses struct {
	Responses []AnnotateResponse `json:"responses"`
}

type CloudVisionRequest

type CloudVisionRequest struct {
	Requests []*AnnotateRequest `json:"requests"`
	User     string             `json:"user"`
}

type Feature

type Feature struct {
	Type       string `json:"type"`
	MaxResults int    `json:"maxResults"`
}

type Glasses

type Glasses struct {
	Client *http.Client
}

func NewGlasses

func NewGlasses() (*Glasses, error)

func (*Glasses) Do

type Image

type Image struct {
	Content string `json:"content"`
}

func NewImageFromFile

func NewImageFromFile(file string) (*Image, error)

func NewImageFromURL

func NewImageFromURL(url string) (*Image, error)

type ImageContext

type ImageContext struct {
	LatLongRect                 interface{} `json:"latLongRect"`
	ImageContextSearchExtension interface{} `json:"imageContextSearchExtension"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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