...

Package prediction

import "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.1/customvision/prediction"
Overview
Index
Subdirectories

Overview ▾

Package prediction implements the Azure ARM Prediction service API version 2.0.

Index ▾

func UserAgent() string
func Version() string
type BaseClient
    func New(aPIKey string, endpoint string) BaseClient
    func NewWithoutDefaults(aPIKey string, endpoint string) BaseClient
    func (client BaseClient) PredictImage(ctx context.Context, projectID uuid.UUID, imageData io.ReadCloser, iterationID *uuid.UUID, application string) (result ImagePrediction, err error)
    func (client BaseClient) PredictImagePreparer(ctx context.Context, projectID uuid.UUID, imageData io.ReadCloser, iterationID *uuid.UUID, application string) (*http.Request, error)
    func (client BaseClient) PredictImageResponder(resp *http.Response) (result ImagePrediction, err error)
    func (client BaseClient) PredictImageSender(req *http.Request) (*http.Response, error)
    func (client BaseClient) PredictImageURL(ctx context.Context, projectID uuid.UUID, imageURL ImageURL, iterationID *uuid.UUID, application string) (result ImagePrediction, err error)
    func (client BaseClient) PredictImageURLPreparer(ctx context.Context, projectID uuid.UUID, imageURL ImageURL, iterationID *uuid.UUID, application string) (*http.Request, error)
    func (client BaseClient) PredictImageURLResponder(resp *http.Response) (result ImagePrediction, err error)
    func (client BaseClient) PredictImageURLSender(req *http.Request) (*http.Response, error)
    func (client BaseClient) PredictImageURLWithNoStore(ctx context.Context, projectID uuid.UUID, imageURL ImageURL, iterationID *uuid.UUID, application string) (result ImagePrediction, err error)
    func (client BaseClient) PredictImageURLWithNoStorePreparer(ctx context.Context, projectID uuid.UUID, imageURL ImageURL, iterationID *uuid.UUID, application string) (*http.Request, error)
    func (client BaseClient) PredictImageURLWithNoStoreResponder(resp *http.Response) (result ImagePrediction, err error)
    func (client BaseClient) PredictImageURLWithNoStoreSender(req *http.Request) (*http.Response, error)
    func (client BaseClient) PredictImageWithNoStore(ctx context.Context, projectID uuid.UUID, imageData io.ReadCloser, iterationID *uuid.UUID, application string) (result ImagePrediction, err error)
    func (client BaseClient) PredictImageWithNoStorePreparer(ctx context.Context, projectID uuid.UUID, imageData io.ReadCloser, iterationID *uuid.UUID, application string) (*http.Request, error)
    func (client BaseClient) PredictImageWithNoStoreResponder(resp *http.Response) (result ImagePrediction, err error)
    func (client BaseClient) PredictImageWithNoStoreSender(req *http.Request) (*http.Response, error)
type BoundingBox
type ImagePrediction
    func (IP ImagePrediction) MarshalJSON() ([]byte, error)
type ImageURL
type Model
    func (mVar Model) MarshalJSON() ([]byte, error)

Package files

client.go models.go version.go

func UserAgent

func UserAgent() string

UserAgent returns the UserAgent string to use when sending http.Requests.

func Version

func Version() string

Version returns the semantic version (see http://semver.org) of the client.

type BaseClient

BaseClient is the base client for Prediction.

type BaseClient struct {
    autorest.Client
    APIKey   string
    Endpoint string
}

func New

func New(aPIKey string, endpoint string) BaseClient

New creates an instance of the BaseClient client.

func NewWithoutDefaults

func NewWithoutDefaults(aPIKey string, endpoint string) BaseClient

NewWithoutDefaults creates an instance of the BaseClient client.

func (BaseClient) PredictImage

func (client BaseClient) PredictImage(ctx context.Context, projectID uuid.UUID, imageData io.ReadCloser, iterationID *uuid.UUID, application string) (result ImagePrediction, err error)

PredictImage sends the predict image request. Parameters: projectID - the project id iterationID - optional. Specifies the id of a particular iteration to evaluate against. The default iteration for the project will be used when not specified application - optional. Specifies the name of application using the endpoint

func (BaseClient) PredictImagePreparer

func (client BaseClient) PredictImagePreparer(ctx context.Context, projectID uuid.UUID, imageData io.ReadCloser, iterationID *uuid.UUID, application string) (*http.Request, error)

PredictImagePreparer prepares the PredictImage request.

func (BaseClient) PredictImageResponder

func (client BaseClient) PredictImageResponder(resp *http.Response) (result ImagePrediction, err error)

PredictImageResponder handles the response to the PredictImage request. The method always closes the http.Response Body.

func (BaseClient) PredictImageSender

func (client BaseClient) PredictImageSender(req *http.Request) (*http.Response, error)

PredictImageSender sends the PredictImage request. The method will close the http.Response Body if it receives an error.

func (BaseClient) PredictImageURL

func (client BaseClient) PredictImageURL(ctx context.Context, projectID uuid.UUID, imageURL ImageURL, iterationID *uuid.UUID, application string) (result ImagePrediction, err error)

PredictImageURL sends the predict image url request. Parameters: projectID - the project id imageURL - an {Iris.Web.Api.Models.ImageUrl} that contains the url of the image to be evaluated iterationID - optional. Specifies the id of a particular iteration to evaluate against. The default iteration for the project will be used when not specified application - optional. Specifies the name of application using the endpoint

func (BaseClient) PredictImageURLPreparer

func (client BaseClient) PredictImageURLPreparer(ctx context.Context, projectID uuid.UUID, imageURL ImageURL, iterationID *uuid.UUID, application string) (*http.Request, error)

PredictImageURLPreparer prepares the PredictImageURL request.

func (BaseClient) PredictImageURLResponder

func (client BaseClient) PredictImageURLResponder(resp *http.Response) (result ImagePrediction, err error)

PredictImageURLResponder handles the response to the PredictImageURL request. The method always closes the http.Response Body.

func (BaseClient) PredictImageURLSender

func (client BaseClient) PredictImageURLSender(req *http.Request) (*http.Response, error)

PredictImageURLSender sends the PredictImageURL request. The method will close the http.Response Body if it receives an error.

func (BaseClient) PredictImageURLWithNoStore

func (client BaseClient) PredictImageURLWithNoStore(ctx context.Context, projectID uuid.UUID, imageURL ImageURL, iterationID *uuid.UUID, application string) (result ImagePrediction, err error)

PredictImageURLWithNoStore sends the predict image url with no store request. Parameters: projectID - the project id imageURL - an {Iris.Web.Api.Models.ImageUrl} that contains the url of the image to be evaluated iterationID - optional. Specifies the id of a particular iteration to evaluate against. The default iteration for the project will be used when not specified application - optional. Specifies the name of application using the endpoint

func (BaseClient) PredictImageURLWithNoStorePreparer

func (client BaseClient) PredictImageURLWithNoStorePreparer(ctx context.Context, projectID uuid.UUID, imageURL ImageURL, iterationID *uuid.UUID, application string) (*http.Request, error)

PredictImageURLWithNoStorePreparer prepares the PredictImageURLWithNoStore request.

func (BaseClient) PredictImageURLWithNoStoreResponder

func (client BaseClient) PredictImageURLWithNoStoreResponder(resp *http.Response) (result ImagePrediction, err error)

PredictImageURLWithNoStoreResponder handles the response to the PredictImageURLWithNoStore request. The method always closes the http.Response Body.

func (BaseClient) PredictImageURLWithNoStoreSender

func (client BaseClient) PredictImageURLWithNoStoreSender(req *http.Request) (*http.Response, error)

PredictImageURLWithNoStoreSender sends the PredictImageURLWithNoStore request. The method will close the http.Response Body if it receives an error.

func (BaseClient) PredictImageWithNoStore

func (client BaseClient) PredictImageWithNoStore(ctx context.Context, projectID uuid.UUID, imageData io.ReadCloser, iterationID *uuid.UUID, application string) (result ImagePrediction, err error)

PredictImageWithNoStore sends the predict image with no store request. Parameters: projectID - the project id iterationID - optional. Specifies the id of a particular iteration to evaluate against. The default iteration for the project will be used when not specified application - optional. Specifies the name of application using the endpoint

func (BaseClient) PredictImageWithNoStorePreparer

func (client BaseClient) PredictImageWithNoStorePreparer(ctx context.Context, projectID uuid.UUID, imageData io.ReadCloser, iterationID *uuid.UUID, application string) (*http.Request, error)

PredictImageWithNoStorePreparer prepares the PredictImageWithNoStore request.

func (BaseClient) PredictImageWithNoStoreResponder

func (client BaseClient) PredictImageWithNoStoreResponder(resp *http.Response) (result ImagePrediction, err error)

PredictImageWithNoStoreResponder handles the response to the PredictImageWithNoStore request. The method always closes the http.Response Body.

func (BaseClient) PredictImageWithNoStoreSender

func (client BaseClient) PredictImageWithNoStoreSender(req *http.Request) (*http.Response, error)

PredictImageWithNoStoreSender sends the PredictImageWithNoStore request. The method will close the http.Response Body if it receives an error.

type BoundingBox

BoundingBox ...

type BoundingBox struct {
    Left   *float64 `json:"left,omitempty"`
    Top    *float64 `json:"top,omitempty"`
    Width  *float64 `json:"width,omitempty"`
    Height *float64 `json:"height,omitempty"`
}

type ImagePrediction

ImagePrediction ...

type ImagePrediction struct {
    autorest.Response `json:"-"`
    // ID - READ-ONLY
    ID *uuid.UUID `json:"id,omitempty"`
    // Project - READ-ONLY
    Project *uuid.UUID `json:"project,omitempty"`
    // Iteration - READ-ONLY
    Iteration *uuid.UUID `json:"iteration,omitempty"`
    // Created - READ-ONLY
    Created *date.Time `json:"created,omitempty"`
    // Predictions - READ-ONLY
    Predictions *[]Model `json:"predictions,omitempty"`
}

func (ImagePrediction) MarshalJSON

func (IP ImagePrediction) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for ImagePrediction.

type ImageURL

ImageURL ...

type ImageURL struct {
    URL *string `json:"url,omitempty"`
}

type Model

Model ...

type Model struct {
    // Probability - READ-ONLY
    Probability *float64 `json:"probability,omitempty"`
    // TagID - READ-ONLY
    TagID *uuid.UUID `json:"tagId,omitempty"`
    // TagName - READ-ONLY
    TagName *string `json:"tagName,omitempty"`
    // BoundingBox - READ-ONLY
    BoundingBox *BoundingBox `json:"boundingBox,omitempty"`
}

func (Model) MarshalJSON

func (mVar Model) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for Model.

Subdirectories

Name Synopsis
..
predictionapi