Skip to content

ahmdrz/microsoft-vision-golang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

microsoft-vision-golang

A library for communication with microsoft cognitive services API written in Golang

Build Status Coverage Status GoDoc GoReport

Dependencies

Nothing ! I wrote this library on Golang 1.5.4 linux/amd64

According to travis-cl will work on Golang 1.2 or later

RTFM !

The full documention of microsoft cognitive services API is in this link and API reference is in here

How to use ?

First of all download the library

go get github.com/ahmdrz/microsoft-vision-golang

Here is a simple code

The key is subscription key which provides access to this API. Found in your subscriptions.

Tags :

// test project main.go
package main

import (
	"fmt"

	"github.com/ahmdrz/microsoft-vision-golang"
)

func main() {
	fmt.Println("Hello World!")
	vision, err := vision.New("<KEY>")
	if err != nil {
		panic(err)
	}

	result, err := vision.Tag("https://portalstoragewuprod2.azureedge.net/vision/Analysis/1.jpg")
	if err != nil {
		panic(err)
	}
	fmt.Println(result)
}

Analyze :

// test project main.go
package main

import (
	"fmt"

	"github.com/ahmdrz/microsoft-vision-golang"
)

func main() {
	fmt.Println("Hello World!")
	vis, err := vision.New("<KEY>")
	if err != nil {
		panic(err)
	}

	result, err := vis.Analyze("https://portalstoragewuprod2.azureedge.net/vision/Analysis/1.jpg",
		vision.VisualFeatures{
			Adult: true,
			Tags:  true,
		})
	if err != nil {
		panic(err)
	}

	fmt.Println(result)
}

License

MIT License

Copyright (c) 2016 Ahmadreza Zibaei

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

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.

About

A library for communication with microsoft cognitive services API written in Golang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages