Documentation ¶
Overview ¶
Package visualrecognitionv3 : Operations and models for the VisualRecognitionV3 service
Index ¶
- Constants
- func GetServiceURLForRegion(region string) (string, error)
- func UnmarshalClass(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalClassResult(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalClassifiedImage(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalClassifiedImages(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalClassifier(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalClassifierResult(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalClassifiers(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalErrorInfo(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalWarningInfo(m map[string]json.RawMessage, result interface{}) (err error)
- type Class
- type ClassResult
- type ClassifiedImage
- type ClassifiedImages
- type Classifier
- type ClassifierResult
- type Classifiers
- type ClassifyOptions
- func (_options *ClassifyOptions) SetAcceptLanguage(acceptLanguage string) *ClassifyOptions
- func (_options *ClassifyOptions) SetClassifierIds(classifierIds []string) *ClassifyOptions
- func (options *ClassifyOptions) SetHeaders(param map[string]string) *ClassifyOptions
- func (_options *ClassifyOptions) SetImagesFile(imagesFile io.ReadCloser) *ClassifyOptions
- func (_options *ClassifyOptions) SetImagesFileContentType(imagesFileContentType string) *ClassifyOptions
- func (_options *ClassifyOptions) SetImagesFilename(imagesFilename string) *ClassifyOptions
- func (_options *ClassifyOptions) SetOwners(owners []string) *ClassifyOptions
- func (_options *ClassifyOptions) SetThreshold(threshold float32) *ClassifyOptions
- func (_options *ClassifyOptions) SetURL(url string) *ClassifyOptions
- type CreateClassifierOptions
- func (_options *CreateClassifierOptions) AddPositiveExamples(classname string, positiveExamples io.ReadCloser) *CreateClassifierOptions
- func (options *CreateClassifierOptions) SetHeaders(param map[string]string) *CreateClassifierOptions
- func (_options *CreateClassifierOptions) SetName(name string) *CreateClassifierOptions
- func (_options *CreateClassifierOptions) SetNegativeExamples(negativeExamples io.ReadCloser) *CreateClassifierOptions
- func (_options *CreateClassifierOptions) SetNegativeExamplesFilename(negativeExamplesFilename string) *CreateClassifierOptions
- type DeleteClassifierOptions
- type DeleteUserDataOptions
- type ErrorInfo
- type GetClassifierOptions
- type GetCoreMlModelOptions
- type ListClassifiersOptions
- type UpdateClassifierOptions
- func (_options *UpdateClassifierOptions) AddPositiveExamples(classname string, positiveExamples io.ReadCloser) *UpdateClassifierOptions
- func (_options *UpdateClassifierOptions) SetClassifierID(classifierID string) *UpdateClassifierOptions
- func (options *UpdateClassifierOptions) SetHeaders(param map[string]string) *UpdateClassifierOptions
- func (_options *UpdateClassifierOptions) SetNegativeExamples(negativeExamples io.ReadCloser) *UpdateClassifierOptions
- func (_options *UpdateClassifierOptions) SetNegativeExamplesFilename(negativeExamplesFilename string) *UpdateClassifierOptions
- type VisualRecognitionV3
- func (visualRecognition *VisualRecognitionV3) Classify(classifyOptions *ClassifyOptions) (result *ClassifiedImages, response *core.DetailedResponse, err error)
- func (visualRecognition *VisualRecognitionV3) ClassifyWithContext(ctx context.Context, classifyOptions *ClassifyOptions) (result *ClassifiedImages, response *core.DetailedResponse, err error)
- func (visualRecognition *VisualRecognitionV3) Clone() *VisualRecognitionV3
- func (visualRecognition *VisualRecognitionV3) CreateClassifier(createClassifierOptions *CreateClassifierOptions) (result *Classifier, response *core.DetailedResponse, err error)
- func (visualRecognition *VisualRecognitionV3) CreateClassifierWithContext(ctx context.Context, createClassifierOptions *CreateClassifierOptions) (result *Classifier, response *core.DetailedResponse, err error)
- func (visualRecognition *VisualRecognitionV3) DeleteClassifier(deleteClassifierOptions *DeleteClassifierOptions) (response *core.DetailedResponse, err error)
- func (visualRecognition *VisualRecognitionV3) DeleteClassifierWithContext(ctx context.Context, deleteClassifierOptions *DeleteClassifierOptions) (response *core.DetailedResponse, err error)
- func (visualRecognition *VisualRecognitionV3) DeleteUserData(deleteUserDataOptions *DeleteUserDataOptions) (response *core.DetailedResponse, err error)
- func (visualRecognition *VisualRecognitionV3) DeleteUserDataWithContext(ctx context.Context, deleteUserDataOptions *DeleteUserDataOptions) (response *core.DetailedResponse, err error)
- func (visualRecognition *VisualRecognitionV3) DisableRetries()
- func (visualRecognition *VisualRecognitionV3) DisableSSLVerification()
- func (visualRecognition *VisualRecognitionV3) EnableRetries(maxRetries int, maxRetryInterval time.Duration)
- func (visualRecognition *VisualRecognitionV3) GetClassifier(getClassifierOptions *GetClassifierOptions) (result *Classifier, response *core.DetailedResponse, err error)
- func (visualRecognition *VisualRecognitionV3) GetClassifierWithContext(ctx context.Context, getClassifierOptions *GetClassifierOptions) (result *Classifier, response *core.DetailedResponse, err error)
- func (visualRecognition *VisualRecognitionV3) GetCoreMlModel(getCoreMlModelOptions *GetCoreMlModelOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
- func (visualRecognition *VisualRecognitionV3) GetCoreMlModelWithContext(ctx context.Context, getCoreMlModelOptions *GetCoreMlModelOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
- func (visualRecognition *VisualRecognitionV3) GetEnableGzipCompression() bool
- func (visualRecognition *VisualRecognitionV3) GetServiceURL() string
- func (visualRecognition *VisualRecognitionV3) ListClassifiers(listClassifiersOptions *ListClassifiersOptions) (result *Classifiers, response *core.DetailedResponse, err error)
- func (visualRecognition *VisualRecognitionV3) ListClassifiersWithContext(ctx context.Context, listClassifiersOptions *ListClassifiersOptions) (result *Classifiers, response *core.DetailedResponse, err error)
- func (*VisualRecognitionV3) NewClassifyOptions() *ClassifyOptions
- func (*VisualRecognitionV3) NewCreateClassifierOptions(name string) *CreateClassifierOptions
- func (*VisualRecognitionV3) NewDeleteClassifierOptions(classifierID string) *DeleteClassifierOptions
- func (*VisualRecognitionV3) NewDeleteUserDataOptions(customerID string) *DeleteUserDataOptions
- func (*VisualRecognitionV3) NewGetClassifierOptions(classifierID string) *GetClassifierOptions
- func (*VisualRecognitionV3) NewGetCoreMlModelOptions(classifierID string) *GetCoreMlModelOptions
- func (*VisualRecognitionV3) NewListClassifiersOptions() *ListClassifiersOptions
- func (*VisualRecognitionV3) NewUpdateClassifierOptions(classifierID string) *UpdateClassifierOptions
- func (visualRecognition *VisualRecognitionV3) SetDefaultHeaders(headers http.Header)
- func (visualRecognition *VisualRecognitionV3) SetEnableGzipCompression(enableGzip bool)
- func (visualRecognition *VisualRecognitionV3) SetServiceURL(url string) error
- func (visualRecognition *VisualRecognitionV3) UpdateClassifier(updateClassifierOptions *UpdateClassifierOptions) (result *Classifier, response *core.DetailedResponse, err error)
- func (visualRecognition *VisualRecognitionV3) UpdateClassifierWithContext(ctx context.Context, updateClassifierOptions *UpdateClassifierOptions) (result *Classifier, response *core.DetailedResponse, err error)
- type VisualRecognitionV3Options
- type WarningInfo
Constants ¶
const ( ClassifierStatusFailedConst = "failed" ClassifierStatusReadyConst = "ready" ClassifierStatusRetrainingConst = "retraining" ClassifierStatusTrainingConst = "training" )
Constants associated with the Classifier.Status property. Training status of classifier.
const ( ClassifyOptionsAcceptLanguageArConst = "ar" ClassifyOptionsAcceptLanguageDeConst = "de" ClassifyOptionsAcceptLanguageEnConst = "en" ClassifyOptionsAcceptLanguageEsConst = "es" ClassifyOptionsAcceptLanguageFrConst = "fr" ClassifyOptionsAcceptLanguageItConst = "it" ClassifyOptionsAcceptLanguageJaConst = "ja" ClassifyOptionsAcceptLanguageKoConst = "ko" ClassifyOptionsAcceptLanguagePtBrConst = "pt-br" ClassifyOptionsAcceptLanguageZhCnConst = "zh-cn" ClassifyOptionsAcceptLanguageZhTwConst = "zh-tw" )
Constants associated with the ClassifyOptions.AcceptLanguage property. The desired language of parts of the response. See the response for details.
const DefaultServiceName = "watson_vision_combined"
DefaultServiceName is the default key used to find external configuration information.
const DefaultServiceURL = "https://api.us-south.visual-recognition.watson.cloud.ibm.com"
DefaultServiceURL is the default URL to make service requests to.
Variables ¶
This section is empty.
Functions ¶
func GetServiceURLForRegion ¶
GetServiceURLForRegion returns the service URL to be used for the specified region
func UnmarshalClass ¶
func UnmarshalClass(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalClass unmarshals an instance of Class from the specified map of raw messages.
func UnmarshalClassResult ¶
func UnmarshalClassResult(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalClassResult unmarshals an instance of ClassResult from the specified map of raw messages.
func UnmarshalClassifiedImage ¶
func UnmarshalClassifiedImage(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalClassifiedImage unmarshals an instance of ClassifiedImage from the specified map of raw messages.
func UnmarshalClassifiedImages ¶
func UnmarshalClassifiedImages(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalClassifiedImages unmarshals an instance of ClassifiedImages from the specified map of raw messages.
func UnmarshalClassifier ¶
func UnmarshalClassifier(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalClassifier unmarshals an instance of Classifier from the specified map of raw messages.
func UnmarshalClassifierResult ¶
func UnmarshalClassifierResult(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalClassifierResult unmarshals an instance of ClassifierResult from the specified map of raw messages.
func UnmarshalClassifiers ¶
func UnmarshalClassifiers(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalClassifiers unmarshals an instance of Classifiers from the specified map of raw messages.
func UnmarshalErrorInfo ¶
func UnmarshalErrorInfo(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalErrorInfo unmarshals an instance of ErrorInfo from the specified map of raw messages.
func UnmarshalWarningInfo ¶
func UnmarshalWarningInfo(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalWarningInfo unmarshals an instance of WarningInfo from the specified map of raw messages.
Types ¶
type Class ¶
type Class struct { // The name of the class. Class *string `json:"class" validate:"required"` }
Class : A category within a classifier.
type ClassResult ¶
type ClassResult struct { // Name of the class. // // Class names are translated in the language defined by the **Accept-Language** request header for the build-in // classifier IDs (`default`, `food`, and `explicit`). Class names of custom classifiers are not translated. The // response might not be in the specified language when the requested language is not supported or when there is no // translation for the class name. Class *string `json:"class" validate:"required"` // Confidence score for the property in the range of 0 to 1. A higher score indicates greater likelihood that the class // is depicted in the image. The default threshold for returning scores from a classifier is 0.5. Score *float32 `json:"score" validate:"required"` // Knowledge graph of the property. For example, `/fruit/pome/apple/eating apple/Granny Smith`. Included only if // identified. TypeHierarchy *string `json:"type_hierarchy,omitempty"` }
ClassResult : Result of a class within a classifier.
type ClassifiedImage ¶
type ClassifiedImage struct { // Source of the image before any redirects. Not returned when the image is uploaded. SourceURL *string `json:"source_url,omitempty"` // Fully resolved URL of the image after redirects are followed. Not returned when the image is uploaded. ResolvedURL *string `json:"resolved_url,omitempty"` // Relative path of the image file if uploaded directly. Not returned when the image is passed by URL. Image *string `json:"image,omitempty"` // Information about what might have caused a failure, such as an image that is too large. Not returned when there is // no error. Error *ErrorInfo `json:"error,omitempty"` // The classifiers. Classifiers []ClassifierResult `json:"classifiers" validate:"required"` }
ClassifiedImage : Results for one image.
type ClassifiedImages ¶
type ClassifiedImages struct { // Number of custom classes identified in the images. CustomClasses *int64 `json:"custom_classes,omitempty"` // Number of images processed for the API call. ImagesProcessed *int64 `json:"images_processed,omitempty"` // Classified images. Images []ClassifiedImage `json:"images" validate:"required"` // Information about what might cause less than optimal output. For example, a request sent with a corrupt .zip file // and a list of image URLs will still complete, but does not return the expected output. Not returned when there is no // warning. Warnings []WarningInfo `json:"warnings,omitempty"` }
ClassifiedImages : Results for all images.
type Classifier ¶
type Classifier struct { // ID of a classifier identified in the image. ClassifierID *string `json:"classifier_id" validate:"required"` // Name of the classifier. Name *string `json:"name" validate:"required"` // Unique ID of the account who owns the classifier. Might not be returned by some requests. Owner *string `json:"owner,omitempty"` // Training status of classifier. Status *string `json:"status,omitempty"` // Whether the classifier can be downloaded as a Core ML model after the training status is `ready`. CoreMlEnabled *bool `json:"core_ml_enabled,omitempty"` // If classifier training has failed, this field might explain why. Explanation *string `json:"explanation,omitempty"` // Date and time in Coordinated Universal Time (UTC) that the classifier was created. Created *strfmt.DateTime `json:"created,omitempty"` // Classes that define a classifier. Classes []Class `json:"classes,omitempty"` // Date and time in Coordinated Universal Time (UTC) that the classifier was updated. Might not be returned by some // requests. Identical to `updated` and retained for backward compatibility. Retrained *strfmt.DateTime `json:"retrained,omitempty"` // Date and time in Coordinated Universal Time (UTC) that the classifier was most recently updated. The field matches // either `retrained` or `created`. Might not be returned by some requests. Updated *strfmt.DateTime `json:"updated,omitempty"` }
Classifier : Information about a classifier.
type ClassifierResult ¶
type ClassifierResult struct { // Name of the classifier. Name *string `json:"name" validate:"required"` // ID of a classifier identified in the image. ClassifierID *string `json:"classifier_id" validate:"required"` // Classes within the classifier. Classes []ClassResult `json:"classes" validate:"required"` }
ClassifierResult : Classifier and score combination.
type Classifiers ¶
type Classifiers struct { // List of classifiers. Classifiers []Classifier `json:"classifiers" validate:"required"` }
Classifiers : A container for the list of classifiers.
type ClassifyOptions ¶
type ClassifyOptions struct { // An image file (.gif, .jpg, .png, .tif) or .zip file with images. Maximum image size is 10 MB. Include no more than // 20 images and limit the .zip file to 100 MB. Encode the image and .zip file names in UTF-8 if they contain non-ASCII // characters. The service assumes UTF-8 encoding if it encounters non-ASCII characters. // // You can also include an image with the **url** parameter. ImagesFile io.ReadCloser `json:"-"` // The filename for imagesFile. ImagesFilename *string `json:"-"` // The content type of imagesFile. ImagesFileContentType *string `json:"-"` // The URL of an image (.gif, .jpg, .png, .tif) to analyze. The minimum recommended pixel density is 32X32 pixels, but // the service tends to perform better with images that are at least 224 x 224 pixels. The maximum image size is 10 MB. // // You can also include images with the **images_file** parameter. URL *string `json:"-"` // The minimum score a class must have to be displayed in the response. Set the threshold to `0.0` to return all // identified classes. Threshold *float32 `json:"-"` // The categories of classifiers to apply. The **classifier_ids** parameter overrides **owners**, so make sure that // **classifier_ids** is empty. // - Use `IBM` to classify against the `default` general classifier. You get the same result if both **classifier_ids** // and **owners** parameters are empty. // - Use `me` to classify against all your custom classifiers. However, for better performance use **classifier_ids** // to specify the specific custom classifiers to apply. // - Use both `IBM` and `me` to analyze the image against both classifier categories. Owners []string `json:"-"` // Which classifiers to apply. Overrides the **owners** parameter. You can specify both custom and built-in classifier // IDs. The built-in `default` classifier is used if both **classifier_ids** and **owners** parameters are empty. // // The following built-in classifier IDs require no training: // - `default`: Returns classes from thousands of general tags. // - `food`: Enhances specificity and accuracy for images of food items. // - `explicit`: Evaluates whether the image might be pornographic. ClassifierIds []string `json:"-"` // The desired language of parts of the response. See the response for details. AcceptLanguage *string `json:"-"` // Allows users to set headers on API requests Headers map[string]string }
ClassifyOptions : The Classify options.
func (*ClassifyOptions) SetAcceptLanguage ¶
func (_options *ClassifyOptions) SetAcceptLanguage(acceptLanguage string) *ClassifyOptions
SetAcceptLanguage : Allow user to set AcceptLanguage
func (*ClassifyOptions) SetClassifierIds ¶
func (_options *ClassifyOptions) SetClassifierIds(classifierIds []string) *ClassifyOptions
SetClassifierIds : Allow user to set ClassifierIds
func (*ClassifyOptions) SetHeaders ¶
func (options *ClassifyOptions) SetHeaders(param map[string]string) *ClassifyOptions
SetHeaders : Allow user to set Headers
func (*ClassifyOptions) SetImagesFile ¶
func (_options *ClassifyOptions) SetImagesFile(imagesFile io.ReadCloser) *ClassifyOptions
SetImagesFile : Allow user to set ImagesFile
func (*ClassifyOptions) SetImagesFileContentType ¶
func (_options *ClassifyOptions) SetImagesFileContentType(imagesFileContentType string) *ClassifyOptions
SetImagesFileContentType : Allow user to set ImagesFileContentType
func (*ClassifyOptions) SetImagesFilename ¶
func (_options *ClassifyOptions) SetImagesFilename(imagesFilename string) *ClassifyOptions
SetImagesFilename : Allow user to set ImagesFilename
func (*ClassifyOptions) SetOwners ¶
func (_options *ClassifyOptions) SetOwners(owners []string) *ClassifyOptions
SetOwners : Allow user to set Owners
func (*ClassifyOptions) SetThreshold ¶
func (_options *ClassifyOptions) SetThreshold(threshold float32) *ClassifyOptions
SetThreshold : Allow user to set Threshold
func (*ClassifyOptions) SetURL ¶
func (_options *ClassifyOptions) SetURL(url string) *ClassifyOptions
SetURL : Allow user to set URL
type CreateClassifierOptions ¶
type CreateClassifierOptions struct { // The name of the new classifier. Encode special characters in UTF-8. Name *string `json:"-" validate:"required"` // A .zip file of images that depict the visual subject of a class in the new classifier. You can include more than one // positive example file in a call. // // Specify the parameter name by appending `_positive_examples` to the class name. For example, // `goldenretriever_positive_examples` creates the class **goldenretriever**. The string cannot contain the following // characters: “$ * - { } \ | / ' " ` [ ]“. // // Include at least 10 images in .jpg or .png format. The minimum recommended image resolution is 32X32 pixels. The // maximum number of images is 10,000 images or 100 MB per .zip file. // // Encode special characters in the file name in UTF-8. PositiveExamples map[string]io.ReadCloser `json:"-" validate:"required"` // A .zip file of images that do not depict the visual subject of any of the classes of the new classifier. Must // contain a minimum of 10 images. // // Encode special characters in the file name in UTF-8. NegativeExamples io.ReadCloser `json:"-"` // The filename for negativeExamples. NegativeExamplesFilename *string `json:"-"` // Allows users to set headers on API requests Headers map[string]string }
CreateClassifierOptions : The CreateClassifier options.
func (*CreateClassifierOptions) AddPositiveExamples ¶
func (_options *CreateClassifierOptions) AddPositiveExamples(classname string, positiveExamples io.ReadCloser) *CreateClassifierOptions
AddPositiveExamples : Allow user to add a new entry to the PositiveExamples map
func (*CreateClassifierOptions) SetHeaders ¶
func (options *CreateClassifierOptions) SetHeaders(param map[string]string) *CreateClassifierOptions
SetHeaders : Allow user to set Headers
func (*CreateClassifierOptions) SetName ¶
func (_options *CreateClassifierOptions) SetName(name string) *CreateClassifierOptions
SetName : Allow user to set Name
func (*CreateClassifierOptions) SetNegativeExamples ¶
func (_options *CreateClassifierOptions) SetNegativeExamples(negativeExamples io.ReadCloser) *CreateClassifierOptions
SetNegativeExamples : Allow user to set NegativeExamples
func (*CreateClassifierOptions) SetNegativeExamplesFilename ¶
func (_options *CreateClassifierOptions) SetNegativeExamplesFilename(negativeExamplesFilename string) *CreateClassifierOptions
SetNegativeExamplesFilename : Allow user to set NegativeExamplesFilename
type DeleteClassifierOptions ¶
type DeleteClassifierOptions struct { // The ID of the classifier. ClassifierID *string `json:"-" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string }
DeleteClassifierOptions : The DeleteClassifier options.
func (*DeleteClassifierOptions) SetClassifierID ¶
func (_options *DeleteClassifierOptions) SetClassifierID(classifierID string) *DeleteClassifierOptions
SetClassifierID : Allow user to set ClassifierID
func (*DeleteClassifierOptions) SetHeaders ¶
func (options *DeleteClassifierOptions) SetHeaders(param map[string]string) *DeleteClassifierOptions
SetHeaders : Allow user to set Headers
type DeleteUserDataOptions ¶
type DeleteUserDataOptions struct { // The customer ID for which all data is to be deleted. CustomerID *string `json:"-" validate:"required"` // Allows users to set headers on API requests Headers map[string]string }
DeleteUserDataOptions : The DeleteUserData options.
func (*DeleteUserDataOptions) SetCustomerID ¶
func (_options *DeleteUserDataOptions) SetCustomerID(customerID string) *DeleteUserDataOptions
SetCustomerID : Allow user to set CustomerID
func (*DeleteUserDataOptions) SetHeaders ¶
func (options *DeleteUserDataOptions) SetHeaders(param map[string]string) *DeleteUserDataOptions
SetHeaders : Allow user to set Headers
type ErrorInfo ¶
type ErrorInfo struct { // HTTP status code. Code *int64 `json:"code" validate:"required"` // Human-readable error description. For example, `File size limit exceeded`. Description *string `json:"description" validate:"required"` // Codified error string. For example, `limit_exceeded`. ErrorID *string `json:"error_id" validate:"required"` }
ErrorInfo : Information about what might have caused a failure, such as an image that is too large. Not returned when there is no error.
type GetClassifierOptions ¶
type GetClassifierOptions struct { // The ID of the classifier. ClassifierID *string `json:"-" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string }
GetClassifierOptions : The GetClassifier options.
func (*GetClassifierOptions) SetClassifierID ¶
func (_options *GetClassifierOptions) SetClassifierID(classifierID string) *GetClassifierOptions
SetClassifierID : Allow user to set ClassifierID
func (*GetClassifierOptions) SetHeaders ¶
func (options *GetClassifierOptions) SetHeaders(param map[string]string) *GetClassifierOptions
SetHeaders : Allow user to set Headers
type GetCoreMlModelOptions ¶
type GetCoreMlModelOptions struct { // The ID of the classifier. ClassifierID *string `json:"-" validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string }
GetCoreMlModelOptions : The GetCoreMlModel options.
func (*GetCoreMlModelOptions) SetClassifierID ¶
func (_options *GetCoreMlModelOptions) SetClassifierID(classifierID string) *GetCoreMlModelOptions
SetClassifierID : Allow user to set ClassifierID
func (*GetCoreMlModelOptions) SetHeaders ¶
func (options *GetCoreMlModelOptions) SetHeaders(param map[string]string) *GetCoreMlModelOptions
SetHeaders : Allow user to set Headers
type ListClassifiersOptions ¶
type ListClassifiersOptions struct { // Specify `true` to return details about the classifiers. Omit this parameter to return a brief list of classifiers. Verbose *bool `json:"-"` // Allows users to set headers on API requests Headers map[string]string }
ListClassifiersOptions : The ListClassifiers options.
func (*ListClassifiersOptions) SetHeaders ¶
func (options *ListClassifiersOptions) SetHeaders(param map[string]string) *ListClassifiersOptions
SetHeaders : Allow user to set Headers
func (*ListClassifiersOptions) SetVerbose ¶
func (_options *ListClassifiersOptions) SetVerbose(verbose bool) *ListClassifiersOptions
SetVerbose : Allow user to set Verbose
type UpdateClassifierOptions ¶
type UpdateClassifierOptions struct { // The ID of the classifier. ClassifierID *string `json:"-" validate:"required,ne="` // A .zip file of images that depict the visual subject of a class in the classifier. The positive examples create or // update classes in the classifier. You can include more than one positive example file in a call. // // Specify the parameter name by appending `_positive_examples` to the class name. For example, // `goldenretriever_positive_examples` creates the class `goldenretriever`. The string cannot contain the following // characters: “$ * - { } \ | / ' " ` [ ]“. // // Include at least 10 images in .jpg or .png format. The minimum recommended image resolution is 32X32 pixels. The // maximum number of images is 10,000 images or 100 MB per .zip file. // // Encode special characters in the file name in UTF-8. PositiveExamples map[string]io.ReadCloser `json:"-"` // A .zip file of images that do not depict the visual subject of any of the classes of the new classifier. Must // contain a minimum of 10 images. // // Encode special characters in the file name in UTF-8. NegativeExamples io.ReadCloser `json:"-"` // The filename for negativeExamples. NegativeExamplesFilename *string `json:"-"` // Allows users to set headers on API requests Headers map[string]string }
UpdateClassifierOptions : The UpdateClassifier options.
func (*UpdateClassifierOptions) AddPositiveExamples ¶
func (_options *UpdateClassifierOptions) AddPositiveExamples(classname string, positiveExamples io.ReadCloser) *UpdateClassifierOptions
AddPositiveExamples : Allow user to add a new entry to the PositiveExamples map
func (*UpdateClassifierOptions) SetClassifierID ¶
func (_options *UpdateClassifierOptions) SetClassifierID(classifierID string) *UpdateClassifierOptions
SetClassifierID : Allow user to set ClassifierID
func (*UpdateClassifierOptions) SetHeaders ¶
func (options *UpdateClassifierOptions) SetHeaders(param map[string]string) *UpdateClassifierOptions
SetHeaders : Allow user to set Headers
func (*UpdateClassifierOptions) SetNegativeExamples ¶
func (_options *UpdateClassifierOptions) SetNegativeExamples(negativeExamples io.ReadCloser) *UpdateClassifierOptions
SetNegativeExamples : Allow user to set NegativeExamples
func (*UpdateClassifierOptions) SetNegativeExamplesFilename ¶
func (_options *UpdateClassifierOptions) SetNegativeExamplesFilename(negativeExamplesFilename string) *UpdateClassifierOptions
SetNegativeExamplesFilename : Allow user to set NegativeExamplesFilename
type VisualRecognitionV3 ¶
type VisualRecognitionV3 struct { Service *core.BaseService // Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is // `2018-03-19`. Version *string }
VisualRecognitionV3 : IBM Watson™ Visual Recognition is discontinued. Existing instances are supported until 1 December 2021, but as of 7 January 2021, you can't create instances. Any instance that is provisioned on 1 December 2021 will be deleted. {: deprecated}
The IBM Watson Visual Recognition service uses deep learning algorithms to identify scenes and objects in images that you upload to the service. You can create and train a custom classifier to identify subjects that suit your needs.
API Version: 3.0 See: https://cloud.ibm.com/docs/visual-recognition
func NewVisualRecognitionV3 ¶
func NewVisualRecognitionV3(options *VisualRecognitionV3Options) (service *VisualRecognitionV3, err error)
NewVisualRecognitionV3 : constructs an instance of VisualRecognitionV3 with passed in options.
func (*VisualRecognitionV3) Classify ¶
func (visualRecognition *VisualRecognitionV3) Classify(classifyOptions *ClassifyOptions) (result *ClassifiedImages, response *core.DetailedResponse, err error)
Classify : Classify images Classify images with built-in or custom classifiers.
func (*VisualRecognitionV3) ClassifyWithContext ¶
func (visualRecognition *VisualRecognitionV3) ClassifyWithContext(ctx context.Context, classifyOptions *ClassifyOptions) (result *ClassifiedImages, response *core.DetailedResponse, err error)
ClassifyWithContext is an alternate form of the Classify method which supports a Context parameter
func (*VisualRecognitionV3) Clone ¶
func (visualRecognition *VisualRecognitionV3) Clone() *VisualRecognitionV3
Clone makes a copy of "visualRecognition" suitable for processing requests.
func (*VisualRecognitionV3) CreateClassifier ¶
func (visualRecognition *VisualRecognitionV3) CreateClassifier(createClassifierOptions *CreateClassifierOptions) (result *Classifier, response *core.DetailedResponse, err error)
CreateClassifier : Create a classifier Train a new multi-faceted classifier on the uploaded image data. Create your custom classifier with positive or negative example training images. Include at least two sets of examples, either two positive example files or one positive and one negative file. You can upload a maximum of 256 MB per call.
**Tips when creating:**
- If you set the **X-Watson-Learning-Opt-Out** header parameter to `true` when you create a classifier, the example training images are not stored. Save your training images locally. For more information, see [Data collection](#data-collection).
- Encode all names in UTF-8 if they contain non-ASCII characters (.zip and image file names, and classifier and class names). The service assumes UTF-8 encoding if it encounters non-ASCII characters.
func (*VisualRecognitionV3) CreateClassifierWithContext ¶
func (visualRecognition *VisualRecognitionV3) CreateClassifierWithContext(ctx context.Context, createClassifierOptions *CreateClassifierOptions) (result *Classifier, response *core.DetailedResponse, err error)
CreateClassifierWithContext is an alternate form of the CreateClassifier method which supports a Context parameter
func (*VisualRecognitionV3) DeleteClassifier ¶
func (visualRecognition *VisualRecognitionV3) DeleteClassifier(deleteClassifierOptions *DeleteClassifierOptions) (response *core.DetailedResponse, err error)
DeleteClassifier : Delete a classifier
func (*VisualRecognitionV3) DeleteClassifierWithContext ¶
func (visualRecognition *VisualRecognitionV3) DeleteClassifierWithContext(ctx context.Context, deleteClassifierOptions *DeleteClassifierOptions) (response *core.DetailedResponse, err error)
DeleteClassifierWithContext is an alternate form of the DeleteClassifier method which supports a Context parameter
func (*VisualRecognitionV3) DeleteUserData ¶
func (visualRecognition *VisualRecognitionV3) DeleteUserData(deleteUserDataOptions *DeleteUserDataOptions) (response *core.DetailedResponse, err error)
DeleteUserData : Delete labeled data Deletes all data associated with a specified customer ID. The method has no effect if no data is associated with the customer ID.
You associate a customer ID with data by passing the `X-Watson-Metadata` header with a request that passes data. For more information about personal data and customer IDs, see [Information security](https://cloud.ibm.com/docs/visual-recognition?topic=visual-recognition-information-security).
func (*VisualRecognitionV3) DeleteUserDataWithContext ¶
func (visualRecognition *VisualRecognitionV3) DeleteUserDataWithContext(ctx context.Context, deleteUserDataOptions *DeleteUserDataOptions) (response *core.DetailedResponse, err error)
DeleteUserDataWithContext is an alternate form of the DeleteUserData method which supports a Context parameter
func (*VisualRecognitionV3) DisableRetries ¶
func (visualRecognition *VisualRecognitionV3) DisableRetries()
DisableRetries disables automatic retries for requests invoked for this service instance.
func (*VisualRecognitionV3) DisableSSLVerification ¶
func (visualRecognition *VisualRecognitionV3) DisableSSLVerification()
DisableSSLVerification bypasses verification of the server's SSL certificate
func (*VisualRecognitionV3) EnableRetries ¶
func (visualRecognition *VisualRecognitionV3) EnableRetries(maxRetries int, maxRetryInterval time.Duration)
EnableRetries enables automatic retries for requests invoked for this service instance. If either parameter is specified as 0, then a default value is used instead.
func (*VisualRecognitionV3) GetClassifier ¶
func (visualRecognition *VisualRecognitionV3) GetClassifier(getClassifierOptions *GetClassifierOptions) (result *Classifier, response *core.DetailedResponse, err error)
GetClassifier : Retrieve classifier details Retrieve information about a custom classifier.
func (*VisualRecognitionV3) GetClassifierWithContext ¶
func (visualRecognition *VisualRecognitionV3) GetClassifierWithContext(ctx context.Context, getClassifierOptions *GetClassifierOptions) (result *Classifier, response *core.DetailedResponse, err error)
GetClassifierWithContext is an alternate form of the GetClassifier method which supports a Context parameter
func (*VisualRecognitionV3) GetCoreMlModel ¶
func (visualRecognition *VisualRecognitionV3) GetCoreMlModel(getCoreMlModelOptions *GetCoreMlModelOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
GetCoreMlModel : Retrieve a Core ML model of a classifier Download a Core ML model file (.mlmodel) of a custom classifier that returns <tt>"core_ml_enabled": true</tt> in the classifier details.
func (*VisualRecognitionV3) GetCoreMlModelWithContext ¶
func (visualRecognition *VisualRecognitionV3) GetCoreMlModelWithContext(ctx context.Context, getCoreMlModelOptions *GetCoreMlModelOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
GetCoreMlModelWithContext is an alternate form of the GetCoreMlModel method which supports a Context parameter
func (*VisualRecognitionV3) GetEnableGzipCompression ¶
func (visualRecognition *VisualRecognitionV3) GetEnableGzipCompression() bool
GetEnableGzipCompression returns the service's EnableGzipCompression field
func (*VisualRecognitionV3) GetServiceURL ¶
func (visualRecognition *VisualRecognitionV3) GetServiceURL() string
GetServiceURL returns the service URL
func (*VisualRecognitionV3) ListClassifiers ¶
func (visualRecognition *VisualRecognitionV3) ListClassifiers(listClassifiersOptions *ListClassifiersOptions) (result *Classifiers, response *core.DetailedResponse, err error)
ListClassifiers : Retrieve a list of classifiers
func (*VisualRecognitionV3) ListClassifiersWithContext ¶
func (visualRecognition *VisualRecognitionV3) ListClassifiersWithContext(ctx context.Context, listClassifiersOptions *ListClassifiersOptions) (result *Classifiers, response *core.DetailedResponse, err error)
ListClassifiersWithContext is an alternate form of the ListClassifiers method which supports a Context parameter
func (*VisualRecognitionV3) NewClassifyOptions ¶
func (*VisualRecognitionV3) NewClassifyOptions() *ClassifyOptions
NewClassifyOptions : Instantiate ClassifyOptions
func (*VisualRecognitionV3) NewCreateClassifierOptions ¶
func (*VisualRecognitionV3) NewCreateClassifierOptions(name string) *CreateClassifierOptions
NewCreateClassifierOptions : Instantiate CreateClassifierOptions
func (*VisualRecognitionV3) NewDeleteClassifierOptions ¶
func (*VisualRecognitionV3) NewDeleteClassifierOptions(classifierID string) *DeleteClassifierOptions
NewDeleteClassifierOptions : Instantiate DeleteClassifierOptions
func (*VisualRecognitionV3) NewDeleteUserDataOptions ¶
func (*VisualRecognitionV3) NewDeleteUserDataOptions(customerID string) *DeleteUserDataOptions
NewDeleteUserDataOptions : Instantiate DeleteUserDataOptions
func (*VisualRecognitionV3) NewGetClassifierOptions ¶
func (*VisualRecognitionV3) NewGetClassifierOptions(classifierID string) *GetClassifierOptions
NewGetClassifierOptions : Instantiate GetClassifierOptions
func (*VisualRecognitionV3) NewGetCoreMlModelOptions ¶
func (*VisualRecognitionV3) NewGetCoreMlModelOptions(classifierID string) *GetCoreMlModelOptions
NewGetCoreMlModelOptions : Instantiate GetCoreMlModelOptions
func (*VisualRecognitionV3) NewListClassifiersOptions ¶
func (*VisualRecognitionV3) NewListClassifiersOptions() *ListClassifiersOptions
NewListClassifiersOptions : Instantiate ListClassifiersOptions
func (*VisualRecognitionV3) NewUpdateClassifierOptions ¶
func (*VisualRecognitionV3) NewUpdateClassifierOptions(classifierID string) *UpdateClassifierOptions
NewUpdateClassifierOptions : Instantiate UpdateClassifierOptions
func (*VisualRecognitionV3) SetDefaultHeaders ¶
func (visualRecognition *VisualRecognitionV3) SetDefaultHeaders(headers http.Header)
SetDefaultHeaders sets HTTP headers to be sent in every request
func (*VisualRecognitionV3) SetEnableGzipCompression ¶
func (visualRecognition *VisualRecognitionV3) SetEnableGzipCompression(enableGzip bool)
SetEnableGzipCompression sets the service's EnableGzipCompression field
func (*VisualRecognitionV3) SetServiceURL ¶
func (visualRecognition *VisualRecognitionV3) SetServiceURL(url string) error
SetServiceURL sets the service URL
func (*VisualRecognitionV3) UpdateClassifier ¶
func (visualRecognition *VisualRecognitionV3) UpdateClassifier(updateClassifierOptions *UpdateClassifierOptions) (result *Classifier, response *core.DetailedResponse, err error)
UpdateClassifier : Update a classifier Update a custom classifier by adding new positive or negative classes or by adding new images to existing classes. You must supply at least one set of positive or negative examples. For details, see [Updating custom classifiers](https://cloud.ibm.com/docs/visual-recognition?topic=visual-recognition-customizing#updating-custom-classifiers).
Encode all names in UTF-8 if they contain non-ASCII characters (.zip and image file names, and classifier and class names). The service assumes UTF-8 encoding if it encounters non-ASCII characters.
**Tips about retraining:**
- You can't update the classifier if the **X-Watson-Learning-Opt-Out** header parameter was set to `true` when the classifier was created. Training images are not stored in that case. Instead, create another classifier. For more information, see [Data collection](#data-collection).
- Don't make retraining calls on a classifier until the status is ready. When you submit retraining requests in parallel, the last request overwrites the previous requests. The `retrained` property shows the last time the classifier retraining finished.
func (*VisualRecognitionV3) UpdateClassifierWithContext ¶
func (visualRecognition *VisualRecognitionV3) UpdateClassifierWithContext(ctx context.Context, updateClassifierOptions *UpdateClassifierOptions) (result *Classifier, response *core.DetailedResponse, err error)
UpdateClassifierWithContext is an alternate form of the UpdateClassifier method which supports a Context parameter
type VisualRecognitionV3Options ¶
type VisualRecognitionV3Options struct { ServiceName string URL string Authenticator core.Authenticator // Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is // `2018-03-19`. Version *string `validate:"required"` }
VisualRecognitionV3Options : Service options
type WarningInfo ¶
type WarningInfo struct { // Codified warning string, such as `limit_reached`. WarningID *string `json:"warning_id" validate:"required"` // Information about the error. Description *string `json:"description" validate:"required"` }
WarningInfo : Information about something that went wrong.