Documentation
¶
Overview ¶
Package visualrecognitionv3 : Operations and models for the VisualRecognitionV3 service
Index ¶
- Constants
- 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 *os.File) *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 *os.File) *CreateClassifierOptions
- func (options *CreateClassifierOptions) SetHeaders(param map[string]string) *CreateClassifierOptions
- func (options *CreateClassifierOptions) SetName(name string) *CreateClassifierOptions
- func (options *CreateClassifierOptions) SetNegativeExamples(negativeExamples *os.File) *CreateClassifierOptions
- func (options *CreateClassifierOptions) SetNegativeExamplesFilename(negativeExamplesFilename string) *CreateClassifierOptions
- type DeleteClassifierOptions
- type DeleteUserDataOptions
- type DetectFacesOptions
- func (options *DetectFacesOptions) SetAcceptLanguage(acceptLanguage string) *DetectFacesOptions
- func (options *DetectFacesOptions) SetHeaders(param map[string]string) *DetectFacesOptions
- func (options *DetectFacesOptions) SetImagesFile(imagesFile *os.File) *DetectFacesOptions
- func (options *DetectFacesOptions) SetImagesFileContentType(imagesFileContentType string) *DetectFacesOptions
- func (options *DetectFacesOptions) SetImagesFilename(imagesFilename string) *DetectFacesOptions
- func (options *DetectFacesOptions) SetURL(URL string) *DetectFacesOptions
- type DetectedFaces
- type ErrorInfo
- type Face
- type FaceAge
- type FaceGender
- type FaceLocation
- type GetClassifierOptions
- type GetCoreMlModelOptions
- type ImageWithFaces
- type ListClassifiersOptions
- type UpdateClassifierOptions
- func (options *UpdateClassifierOptions) AddPositiveExamples(classname string, positiveExamples *os.File) *UpdateClassifierOptions
- func (options *UpdateClassifierOptions) SetClassifierID(classifierID string) *UpdateClassifierOptions
- func (options *UpdateClassifierOptions) SetHeaders(param map[string]string) *UpdateClassifierOptions
- func (options *UpdateClassifierOptions) SetNegativeExamples(negativeExamples *os.File) *UpdateClassifierOptions
- func (options *UpdateClassifierOptions) SetNegativeExamplesFilename(negativeExamplesFilename string) *UpdateClassifierOptions
- type VisualRecognitionV3
- func (visualRecognition *VisualRecognitionV3) Classify(classifyOptions *ClassifyOptions) (*core.DetailedResponse, error)
- func (visualRecognition *VisualRecognitionV3) CreateClassifier(createClassifierOptions *CreateClassifierOptions) (*core.DetailedResponse, error)
- func (visualRecognition *VisualRecognitionV3) DeleteClassifier(deleteClassifierOptions *DeleteClassifierOptions) (*core.DetailedResponse, error)
- func (visualRecognition *VisualRecognitionV3) DeleteUserData(deleteUserDataOptions *DeleteUserDataOptions) (*core.DetailedResponse, error)
- func (visualRecognition *VisualRecognitionV3) DetectFaces(detectFacesOptions *DetectFacesOptions) (*core.DetailedResponse, error)
- func (visualRecognition *VisualRecognitionV3) GetClassifier(getClassifierOptions *GetClassifierOptions) (*core.DetailedResponse, error)
- func (visualRecognition *VisualRecognitionV3) GetClassifyResult(response *core.DetailedResponse) *ClassifiedImages
- func (visualRecognition *VisualRecognitionV3) GetCoreMlModel(getCoreMlModelOptions *GetCoreMlModelOptions) (*core.DetailedResponse, error)
- func (visualRecognition *VisualRecognitionV3) GetCreateClassifierResult(response *core.DetailedResponse) *Classifier
- func (visualRecognition *VisualRecognitionV3) GetDetectFacesResult(response *core.DetailedResponse) *DetectedFaces
- func (visualRecognition *VisualRecognitionV3) GetGetClassifierResult(response *core.DetailedResponse) *Classifier
- func (visualRecognition *VisualRecognitionV3) GetGetCoreMlModelResult(response *core.DetailedResponse) io.ReadCloser
- func (visualRecognition *VisualRecognitionV3) GetListClassifiersResult(response *core.DetailedResponse) *Classifiers
- func (visualRecognition *VisualRecognitionV3) GetUpdateClassifierResult(response *core.DetailedResponse) *Classifier
- func (visualRecognition *VisualRecognitionV3) ListClassifiers(listClassifiersOptions *ListClassifiersOptions) (*core.DetailedResponse, error)
- func (visualRecognition *VisualRecognitionV3) NewClassifyOptions() *ClassifyOptions
- func (visualRecognition *VisualRecognitionV3) NewCreateClassifierOptions(name string) *CreateClassifierOptions
- func (visualRecognition *VisualRecognitionV3) NewDeleteClassifierOptions(classifierID string) *DeleteClassifierOptions
- func (visualRecognition *VisualRecognitionV3) NewDeleteUserDataOptions(customerID string) *DeleteUserDataOptions
- func (visualRecognition *VisualRecognitionV3) NewDetectFacesOptions() *DetectFacesOptions
- func (visualRecognition *VisualRecognitionV3) NewGetClassifierOptions(classifierID string) *GetClassifierOptions
- func (visualRecognition *VisualRecognitionV3) NewGetCoreMlModelOptions(classifierID string) *GetCoreMlModelOptions
- func (visualRecognition *VisualRecognitionV3) NewListClassifiersOptions() *ListClassifiersOptions
- func (visualRecognition *VisualRecognitionV3) NewUpdateClassifierOptions(classifierID string) *UpdateClassifierOptions
- func (visualRecognition *VisualRecognitionV3) UpdateClassifier(updateClassifierOptions *UpdateClassifierOptions) (*core.DetailedResponse, error)
- type VisualRecognitionV3Options
- type WarningInfo
Constants ¶
const ( Classifier_Status_Failed = "failed" Classifier_Status_Ready = "ready" Classifier_Status_Retraining = "retraining" Classifier_Status_Training = "training" )
Constants associated with the Classifier.Status property. Training status of classifier.
const ( ClassifyOptions_AcceptLanguage_Ar = "ar" ClassifyOptions_AcceptLanguage_De = "de" ClassifyOptions_AcceptLanguage_En = "en" ClassifyOptions_AcceptLanguage_Es = "es" ClassifyOptions_AcceptLanguage_Fr = "fr" ClassifyOptions_AcceptLanguage_It = "it" ClassifyOptions_AcceptLanguage_Ja = "ja" ClassifyOptions_AcceptLanguage_Ko = "ko" ClassifyOptions_AcceptLanguage_PtBr = "pt-br" ClassifyOptions_AcceptLanguage_ZhCn = "zh-cn" ClassifyOptions_AcceptLanguage_ZhTw = "zh-tw" )
Constants associated with the ClassifyOptions.AcceptLanguage property. The desired language of parts of the response. See the response for details.
const ( DetectFacesOptions_AcceptLanguage_Ar = "ar" DetectFacesOptions_AcceptLanguage_De = "de" DetectFacesOptions_AcceptLanguage_En = "en" DetectFacesOptions_AcceptLanguage_Es = "es" DetectFacesOptions_AcceptLanguage_Fr = "fr" DetectFacesOptions_AcceptLanguage_It = "it" DetectFacesOptions_AcceptLanguage_Ja = "ja" DetectFacesOptions_AcceptLanguage_Ko = "ko" DetectFacesOptions_AcceptLanguage_PtBr = "pt-br" DetectFacesOptions_AcceptLanguage_ZhCn = "zh-cn" DetectFacesOptions_AcceptLanguage_ZhTw = "zh-tw" )
Constants associated with the DetectFacesOptions.AcceptLanguage property. The desired language of parts of the response. See the response for details.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Class ¶
type Class struct {
// The name of the class.
ClassName *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.
ClassName *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 *os.File `json:"images_file,omitempty"`
// The filename for imagesFile.
ImagesFilename *string `json:"images_filename,omitempty"`
// The content type of imagesFile.
ImagesFileContentType *string `json:"images_file_content_type,omitempty"`
// 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:"url,omitempty"`
// 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:"threshold,omitempty"`
// 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:"owners,omitempty"`
// 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:"classifier_ids,omitempty"`
// The desired language of parts of the response. See the response for details.
AcceptLanguage *string `json:"Accept-Language,omitempty"`
// Allows users to set headers to be GDPR compliant
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 *os.File) *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:"name" 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**.
//
// 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]*os.File `json:"positive_examples" 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 *os.File `json:"negative_examples,omitempty"`
// The filename for negativeExamples.
NegativeExamplesFilename *string `json:"negative_examples_filename,omitempty"`
// Allows users to set headers to be GDPR compliant
Headers map[string]string
}
CreateClassifierOptions : The CreateClassifier options.
func (*CreateClassifierOptions) AddPositiveExamples ¶
func (options *CreateClassifierOptions) AddPositiveExamples(classname string, positiveExamples *os.File) *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 *os.File) *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:"classifier_id" validate:"required"`
// Allows users to set headers to be GDPR compliant
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:"customer_id" validate:"required"`
// Allows users to set headers to be GDPR compliant
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 DetectFacesOptions ¶
type DetectFacesOptions struct {
// An image file (gif, .jpg, .png, .tif.) or .zip file with images. Limit the .zip file to 100 MB. You can include a
// maximum of 15 images in a request.
//
// 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 *os.File `json:"images_file,omitempty"`
// The filename for imagesFile.
ImagesFilename *string `json:"images_filename,omitempty"`
// The content type of imagesFile.
ImagesFileContentType *string `json:"images_file_content_type,omitempty"`
// The URL of an image to analyze. Must be in .gif, .jpg, .png, or .tif format. 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. Redirects are followed, so you can use a shortened URL.
//
// You can also include images with the **images_file** parameter.
URL *string `json:"url,omitempty"`
// The desired language of parts of the response. See the response for details.
AcceptLanguage *string `json:"Accept-Language,omitempty"`
// Allows users to set headers to be GDPR compliant
Headers map[string]string
}
DetectFacesOptions : The DetectFaces options.
func (*DetectFacesOptions) SetAcceptLanguage ¶ added in v0.3.0
func (options *DetectFacesOptions) SetAcceptLanguage(acceptLanguage string) *DetectFacesOptions
SetAcceptLanguage : Allow user to set AcceptLanguage
func (*DetectFacesOptions) SetHeaders ¶
func (options *DetectFacesOptions) SetHeaders(param map[string]string) *DetectFacesOptions
SetHeaders : Allow user to set Headers
func (*DetectFacesOptions) SetImagesFile ¶
func (options *DetectFacesOptions) SetImagesFile(imagesFile *os.File) *DetectFacesOptions
SetImagesFile : Allow user to set ImagesFile
func (*DetectFacesOptions) SetImagesFileContentType ¶
func (options *DetectFacesOptions) SetImagesFileContentType(imagesFileContentType string) *DetectFacesOptions
SetImagesFileContentType : Allow user to set ImagesFileContentType
func (*DetectFacesOptions) SetImagesFilename ¶
func (options *DetectFacesOptions) SetImagesFilename(imagesFilename string) *DetectFacesOptions
SetImagesFilename : Allow user to set ImagesFilename
func (*DetectFacesOptions) SetURL ¶
func (options *DetectFacesOptions) SetURL(URL string) *DetectFacesOptions
SetURL : Allow user to set URL
type DetectedFaces ¶
type DetectedFaces struct {
// Number of images processed for the API call.
ImagesProcessed *int64 `json:"images_processed" validate:"required"`
// The images.
Images []ImageWithFaces `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"`
}
DetectedFaces : Results for all faces.
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 Face ¶
type Face struct {
// Age information about a face.
Age *FaceAge `json:"age,omitempty"`
// Information about the gender of the face.
Gender *FaceGender `json:"gender,omitempty"`
// The location of the bounding box around the face.
FaceLocation *FaceLocation `json:"face_location,omitempty"`
}
Face : Information about the face.
type FaceAge ¶
type FaceAge struct {
// Estimated minimum age.
Min *int64 `json:"min,omitempty"`
// Estimated maximum age.
Max *int64 `json:"max,omitempty"`
// Confidence score in the range of 0 to 1. A higher score indicates greater confidence in the estimated value for the
// property.
Score *float32 `json:"score" validate:"required"`
}
FaceAge : Age information about a face.
type FaceGender ¶
type FaceGender struct {
// Gender identified by the face. For example, `MALE` or `FEMALE`.
Gender *string `json:"gender" validate:"required"`
// The word for "male" or "female" in the language defined by the **Accept-Language** request header.
GenderLabel *string `json:"gender_label" validate:"required"`
// Confidence score in the range of 0 to 1. A higher score indicates greater confidence in the estimated value for the
// property.
Score *float32 `json:"score" validate:"required"`
}
FaceGender : Information about the gender of the face.
type FaceLocation ¶
type FaceLocation struct {
// Width in pixels of face region.
Width *float64 `json:"width" validate:"required"`
// Height in pixels of face region.
Height *float64 `json:"height" validate:"required"`
// X-position of top-left pixel of face region.
Left *float64 `json:"left" validate:"required"`
// Y-position of top-left pixel of face region.
Top *float64 `json:"top" validate:"required"`
}
FaceLocation : The location of the bounding box around the face.
type GetClassifierOptions ¶
type GetClassifierOptions struct {
// The ID of the classifier.
ClassifierID *string `json:"classifier_id" validate:"required"`
// Allows users to set headers to be GDPR compliant
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:"classifier_id" validate:"required"`
// Allows users to set headers to be GDPR compliant
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 ImageWithFaces ¶
type ImageWithFaces struct {
// Faces detected in the images.
Faces []Face `json:"faces" validate:"required"`
// Relative path of the image file if uploaded directly. Not returned when the image is passed by URL.
Image *string `json:"image,omitempty"`
// 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"`
// 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"`
}
ImageWithFaces : Information about faces in the image.
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:"verbose,omitempty"`
// Allows users to set headers to be GDPR compliant
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:"classifier_id" validate:"required"`
// 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`.
//
// 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]*os.File `json:"positive_examples,omitempty"`
// 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 *os.File `json:"negative_examples,omitempty"`
// The filename for negativeExamples.
NegativeExamplesFilename *string `json:"negative_examples_filename,omitempty"`
// Allows users to set headers to be GDPR compliant
Headers map[string]string
}
UpdateClassifierOptions : The UpdateClassifier options.
func (*UpdateClassifierOptions) AddPositiveExamples ¶
func (options *UpdateClassifierOptions) AddPositiveExamples(classname string, positiveExamples *os.File) *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 *os.File) *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
}
VisualRecognitionV3 : The IBM Watson™ Visual Recognition service uses deep learning algorithms to identify scenes, objects, and faces in images you upload to the service. You can create and train a custom classifier to identify subjects that suit your needs.
Version: V3 See: http://www.ibm.com/watson/developercloud/visual-recognition.html
func NewVisualRecognitionV3 ¶
func NewVisualRecognitionV3(options *VisualRecognitionV3Options) (*VisualRecognitionV3, error)
NewVisualRecognitionV3 : Instantiate VisualRecognitionV3
func (*VisualRecognitionV3) Classify ¶
func (visualRecognition *VisualRecognitionV3) Classify(classifyOptions *ClassifyOptions) (*core.DetailedResponse, error)
Classify : Classify images Classify images with built-in or custom classifiers.
func (*VisualRecognitionV3) CreateClassifier ¶
func (visualRecognition *VisualRecognitionV3) CreateClassifier(createClassifierOptions *CreateClassifierOptions) (*core.DetailedResponse, error)
CreateClassifier : Create a classifier Train a new multi-faceted classifier on the uploaded image data. Create your custom classifier with positive or negative examples. 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.
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) DeleteClassifier ¶
func (visualRecognition *VisualRecognitionV3) DeleteClassifier(deleteClassifierOptions *DeleteClassifierOptions) (*core.DetailedResponse, error)
DeleteClassifier : Delete a classifier
func (*VisualRecognitionV3) DeleteUserData ¶
func (visualRecognition *VisualRecognitionV3) DeleteUserData(deleteUserDataOptions *DeleteUserDataOptions) (*core.DetailedResponse, 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/services/visual-recognition?topic=visual-recognition-information-security).
func (*VisualRecognitionV3) DetectFaces ¶
func (visualRecognition *VisualRecognitionV3) DetectFaces(detectFacesOptions *DetectFacesOptions) (*core.DetailedResponse, error)
DetectFaces : Detect faces in images **Important:** On April 2, 2018, the identity information in the response to calls to the Face model was removed. The identity information refers to the `name` of the person, `score`, and `type_hierarchy` knowledge graph. For details about the enhanced Face model, see the [Release notes](https://cloud.ibm.com/docs/services/visual-recognition?topic=visual-recognition-release-notes#2april2018).
Analyze and get data about faces in images. Responses can include estimated age and gender. This feature uses a built-in model, so no training is necessary. The **Detect faces** method does not support general biometric facial recognition.
Supported image formats include .gif, .jpg, .png, and .tif. The maximum image size is 10 MB. 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.
func (*VisualRecognitionV3) GetClassifier ¶
func (visualRecognition *VisualRecognitionV3) GetClassifier(getClassifierOptions *GetClassifierOptions) (*core.DetailedResponse, error)
GetClassifier : Retrieve classifier details Retrieve information about a custom classifier.
func (*VisualRecognitionV3) GetClassifyResult ¶
func (visualRecognition *VisualRecognitionV3) GetClassifyResult(response *core.DetailedResponse) *ClassifiedImages
GetClassifyResult : Retrieve result of Classify operation
func (*VisualRecognitionV3) GetCoreMlModel ¶
func (visualRecognition *VisualRecognitionV3) GetCoreMlModel(getCoreMlModelOptions *GetCoreMlModelOptions) (*core.DetailedResponse, 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) GetCreateClassifierResult ¶
func (visualRecognition *VisualRecognitionV3) GetCreateClassifierResult(response *core.DetailedResponse) *Classifier
GetCreateClassifierResult : Retrieve result of CreateClassifier operation
func (*VisualRecognitionV3) GetDetectFacesResult ¶
func (visualRecognition *VisualRecognitionV3) GetDetectFacesResult(response *core.DetailedResponse) *DetectedFaces
GetDetectFacesResult : Retrieve result of DetectFaces operation
func (*VisualRecognitionV3) GetGetClassifierResult ¶
func (visualRecognition *VisualRecognitionV3) GetGetClassifierResult(response *core.DetailedResponse) *Classifier
GetGetClassifierResult : Retrieve result of GetClassifier operation
func (*VisualRecognitionV3) GetGetCoreMlModelResult ¶
func (visualRecognition *VisualRecognitionV3) GetGetCoreMlModelResult(response *core.DetailedResponse) io.ReadCloser
GetGetCoreMlModelResult : Retrieve result of GetCoreMlModel operation
func (*VisualRecognitionV3) GetListClassifiersResult ¶
func (visualRecognition *VisualRecognitionV3) GetListClassifiersResult(response *core.DetailedResponse) *Classifiers
GetListClassifiersResult : Retrieve result of ListClassifiers operation
func (*VisualRecognitionV3) GetUpdateClassifierResult ¶
func (visualRecognition *VisualRecognitionV3) GetUpdateClassifierResult(response *core.DetailedResponse) *Classifier
GetUpdateClassifierResult : Retrieve result of UpdateClassifier operation
func (*VisualRecognitionV3) ListClassifiers ¶
func (visualRecognition *VisualRecognitionV3) ListClassifiers(listClassifiersOptions *ListClassifiersOptions) (*core.DetailedResponse, error)
ListClassifiers : Retrieve a list of classifiers
func (*VisualRecognitionV3) NewClassifyOptions ¶
func (visualRecognition *VisualRecognitionV3) NewClassifyOptions() *ClassifyOptions
NewClassifyOptions : Instantiate ClassifyOptions
func (*VisualRecognitionV3) NewCreateClassifierOptions ¶
func (visualRecognition *VisualRecognitionV3) NewCreateClassifierOptions(name string) *CreateClassifierOptions
NewCreateClassifierOptions : Instantiate CreateClassifierOptions
func (*VisualRecognitionV3) NewDeleteClassifierOptions ¶
func (visualRecognition *VisualRecognitionV3) NewDeleteClassifierOptions(classifierID string) *DeleteClassifierOptions
NewDeleteClassifierOptions : Instantiate DeleteClassifierOptions
func (*VisualRecognitionV3) NewDeleteUserDataOptions ¶
func (visualRecognition *VisualRecognitionV3) NewDeleteUserDataOptions(customerID string) *DeleteUserDataOptions
NewDeleteUserDataOptions : Instantiate DeleteUserDataOptions
func (*VisualRecognitionV3) NewDetectFacesOptions ¶
func (visualRecognition *VisualRecognitionV3) NewDetectFacesOptions() *DetectFacesOptions
NewDetectFacesOptions : Instantiate DetectFacesOptions
func (*VisualRecognitionV3) NewGetClassifierOptions ¶
func (visualRecognition *VisualRecognitionV3) NewGetClassifierOptions(classifierID string) *GetClassifierOptions
NewGetClassifierOptions : Instantiate GetClassifierOptions
func (*VisualRecognitionV3) NewGetCoreMlModelOptions ¶
func (visualRecognition *VisualRecognitionV3) NewGetCoreMlModelOptions(classifierID string) *GetCoreMlModelOptions
NewGetCoreMlModelOptions : Instantiate GetCoreMlModelOptions
func (*VisualRecognitionV3) NewListClassifiersOptions ¶
func (visualRecognition *VisualRecognitionV3) NewListClassifiersOptions() *ListClassifiersOptions
NewListClassifiersOptions : Instantiate ListClassifiersOptions
func (*VisualRecognitionV3) NewUpdateClassifierOptions ¶
func (visualRecognition *VisualRecognitionV3) NewUpdateClassifierOptions(classifierID string) *UpdateClassifierOptions
NewUpdateClassifierOptions : Instantiate UpdateClassifierOptions
func (*VisualRecognitionV3) UpdateClassifier ¶
func (visualRecognition *VisualRecognitionV3) UpdateClassifier(updateClassifierOptions *UpdateClassifierOptions) (*core.DetailedResponse, 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/services/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.
**Tip:** 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.
type VisualRecognitionV3Options ¶
type VisualRecognitionV3Options struct {
Version string
URL string
IAMApiKey string
IAMAccessToken string
IAMURL string
IAMClientId string
IAMClientSecret string
ICP4DAccessToken string
ICP4DURL string
AuthenticationType string
}
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.