clarifaiAPI

package
v0.0.0-...-9e7b976 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const APIURL = "https://api.clarifai.com/v2/models/aaa03c23b3724a16a56b629203edc62c/outputs"

Variables

This section is empty.

Functions

This section is empty.

Types

type ClarifaiAPI

type ClarifaiAPI struct {
	APIKey string
	APIUrl string
	// contains filtered or unexported fields
}

func NewClarifaiAPI

func NewClarifaiAPI(APIKey string, APIUrl string) *ClarifaiAPI

func (*ClarifaiAPI) RecognizeImage

func (ca *ClarifaiAPI) RecognizeImage(URL string, minProbability float64) ([]string, error)

func (*ClarifaiAPI) RecognizeImages

func (ca *ClarifaiAPI) RecognizeImages(URLs []string, minProbability float64) ([][]string, error)

type Concept

type Concept struct {
	Id    string  `json:"id"`
	Name  string  `json:"name"`
	Value float64 `json:"value"`
	AppId string  `json:"app_id"`
}

type ConceptData

type ConceptData struct {
	Concepts []Concept `json:"concepts"`
}

type Data

type Data struct {
	Image Image `json:"image"`
}

type Image

type Image struct {
	URL string `json:"url"`
}

type Input

type Input struct {
	Id   string `json:"id"`
	Data Data   `json:"data"`
}

type Model

type Model struct {
	Name         string       `json:"name"`
	Id           string       `json:"id"`
	CreatedAt    time.Time    `json:"created_at"`
	AppID        string       `json:"app_id"`
	OutputInfo   OutputInfo   `json:"output_info"`
	ModelVersion ModelVersion `json:"model_version"`
	DisplayName  string       `json:"display_name"`
}

type ModelVersion

type ModelVersion struct {
	Id        string    `json:"id"`
	CreatedAt time.Time `json:"created_at"`
	Status    Status    `json:"status"`
}

type Modl

type Modl struct {
	OutputInf OutputInf `json:"output_info"`
}

type Output

type Output struct {
	Id          string      `json:"id"`
	Status      Status      `json:"status"`
	CreatedAt   time.Time   `json:"created_at"`
	Model       Model       `json:"model"`
	Input       Input       `json:"input"`
	ConceptData ConceptData `json:"data"`
}

type OutputConfig

type OutputConfig struct {
	Language string `json:"language"`
}

type OutputInf

type OutputInf struct {
	OutputConfig OutputConfig `json:"output_config"`
}

type OutputInfo

type OutputInfo struct {
	Message string `json:"message"`
	Type    string `json:"type"`
	TypeExt string `json:"type_ext"`
}

type Request

type Request struct {
	Inputs []Input `json:"inputs"`
	Modl   Modl    `json:"model"`
}

type Response

type Response struct {
	Status  Status   `json:"status"`
	Outputs []Output `json:"outputs"`
}

type Status

type Status struct {
	Code        uint   `json:"code"`
	Description string `json:"description"`
}

Jump to

Keyboard shortcuts

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