public class VisualRecognition
extends com.ibm.cloud.sdk.core.service.BaseService
Constructor and Description |
---|
VisualRecognition(java.lang.String versionDate)
Constructs a new `VisualRecognition` client using the DEFAULT_SERVICE_NAME.
|
VisualRecognition(java.lang.String versionDate,
com.ibm.cloud.sdk.core.security.Authenticator authenticator)
Constructs a new `VisualRecognition` client with the DEFAULT_SERVICE_NAME and the specified
Authenticator.
|
VisualRecognition(java.lang.String versionDate,
java.lang.String serviceName)
Constructs a new `VisualRecognition` client with the specified serviceName.
|
VisualRecognition(java.lang.String versionDate,
java.lang.String serviceName,
com.ibm.cloud.sdk.core.security.Authenticator authenticator)
Constructs a new `VisualRecognition` client with the specified Authenticator and serviceName.
|
Modifier and Type | Method and Description |
---|---|
com.ibm.cloud.sdk.core.http.ServiceCall<ClassifiedImages> |
classify()
Classify images.
|
com.ibm.cloud.sdk.core.http.ServiceCall<ClassifiedImages> |
classify(ClassifyOptions classifyOptions)
Classify images.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Classifier> |
createClassifier(CreateClassifierOptions createClassifierOptions)
Create a classifier.
|
com.ibm.cloud.sdk.core.http.ServiceCall<java.lang.Void> |
deleteClassifier(DeleteClassifierOptions deleteClassifierOptions)
Delete a classifier.
|
com.ibm.cloud.sdk.core.http.ServiceCall<java.lang.Void> |
deleteUserData(DeleteUserDataOptions deleteUserDataOptions)
Delete labeled data.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Classifier> |
getClassifier(GetClassifierOptions getClassifierOptions)
Retrieve classifier details.
|
com.ibm.cloud.sdk.core.http.ServiceCall<java.io.InputStream> |
getCoreMlModel(GetCoreMlModelOptions getCoreMlModelOptions)
Retrieve a Core ML model of a classifier.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Classifiers> |
listClassifiers()
Retrieve a list of classifiers.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Classifiers> |
listClassifiers(ListClassifiersOptions listClassifiersOptions)
Retrieve a list of classifiers.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Classifier> |
updateClassifier(UpdateClassifierOptions updateClassifierOptions)
Update a classifier.
|
configureClient, configureHttpClient, configureService, createServiceCall, getAuthenticator, getClient, getEndPoint, getName, getServiceUrl, isJsonMimeType, isJsonPatchMimeType, processServiceCall, setAuthentication, setClient, setDefaultHeaders, setDefaultHeaders, setEndPoint, setServiceUrl, toString
public VisualRecognition(java.lang.String versionDate)
versionDate
- The version date (yyyy-MM-dd) of the REST API to use. Specifying this value
will keep your API calls from failing when the service introduces breaking changes.public VisualRecognition(java.lang.String versionDate, com.ibm.cloud.sdk.core.security.Authenticator authenticator)
versionDate
- The version date (yyyy-MM-dd) of the REST API to use. Specifying this value
will keep your API calls from failing when the service introduces breaking changes.authenticator
- the Authenticator instance to be configured for this servicepublic VisualRecognition(java.lang.String versionDate, java.lang.String serviceName)
versionDate
- The version date (yyyy-MM-dd) of the REST API to use. Specifying this value
will keep your API calls from failing when the service introduces breaking changes.serviceName
- The name of the service to configure.public VisualRecognition(java.lang.String versionDate, java.lang.String serviceName, com.ibm.cloud.sdk.core.security.Authenticator authenticator)
versionDate
- The version date (yyyy-MM-dd) of the REST API to use. Specifying this value
will keep your API calls from failing when the service introduces breaking changes.serviceName
- The name of the service to configure.authenticator
- the Authenticator instance to be configured for this servicepublic com.ibm.cloud.sdk.core.http.ServiceCall<ClassifiedImages> classify(ClassifyOptions classifyOptions)
Classify images with built-in or custom classifiers.
classifyOptions
- the ClassifyOptions
containing the options for the callServiceCall
with a response type of ClassifiedImages
public com.ibm.cloud.sdk.core.http.ServiceCall<ClassifiedImages> classify()
Classify images with built-in or custom classifiers.
ServiceCall
with a response type of ClassifiedImages
public com.ibm.cloud.sdk.core.http.ServiceCall<Classifier> createClassifier(CreateClassifierOptions createClassifierOptions)
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.
createClassifierOptions
- the CreateClassifierOptions
containing the options for
the callServiceCall
with a response type of Classifier
public com.ibm.cloud.sdk.core.http.ServiceCall<Classifiers> listClassifiers(ListClassifiersOptions listClassifiersOptions)
listClassifiersOptions
- the ListClassifiersOptions
containing the options for the
callServiceCall
with a response type of Classifiers
public com.ibm.cloud.sdk.core.http.ServiceCall<Classifiers> listClassifiers()
ServiceCall
with a response type of Classifiers
public com.ibm.cloud.sdk.core.http.ServiceCall<Classifier> getClassifier(GetClassifierOptions getClassifierOptions)
Retrieve information about a custom classifier.
getClassifierOptions
- the GetClassifierOptions
containing the options for the
callServiceCall
with a response type of Classifier
public com.ibm.cloud.sdk.core.http.ServiceCall<Classifier> updateClassifier(UpdateClassifierOptions updateClassifierOptions)
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.
updateClassifierOptions
- the UpdateClassifierOptions
containing the options for
the callServiceCall
with a response type of Classifier
public com.ibm.cloud.sdk.core.http.ServiceCall<java.lang.Void> deleteClassifier(DeleteClassifierOptions deleteClassifierOptions)
deleteClassifierOptions
- the DeleteClassifierOptions
containing the options for
the callServiceCall
with a response type of Voidpublic com.ibm.cloud.sdk.core.http.ServiceCall<java.io.InputStream> getCoreMlModel(GetCoreMlModelOptions getCoreMlModelOptions)
Download a Core ML model file (.mlmodel) of a custom classifier that returns "core_ml_enabled": true in the classifier details.
getCoreMlModelOptions
- the GetCoreMlModelOptions
containing the options for the
callServiceCall
with a response type of InputStream
public com.ibm.cloud.sdk.core.http.ServiceCall<java.lang.Void> deleteUserData(DeleteUserDataOptions deleteUserDataOptions)
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).
deleteUserDataOptions
- the DeleteUserDataOptions
containing the options for the
callServiceCall
with a response type of Void