Skip to content

Latest commit

 

History

History
 
 

visual-recognition

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Visual Recognition

Installation

Maven
<dependency>
  <groupId>com.ibm.watson.developer_cloud</groupId>
  <artifactId>visual-recognition</artifactId>
  <version>6.8.0</version>
</dependency>
Gradle
'com.ibm.watson.developer_cloud:visual-recognition:6.8.0'

Usage

Use the Visual Recognition service to recognize the following picture.

Car

VisualRecognition service = new VisualRecognition("2016-05-20");
IamOptions iamOptions = new IamOptions.Builder()
  .apiKey("<iam_api_key>")
  .build();
service.setIamCredentials(iamOptions);

System.out.println("Classify an image");
ClassifyOptions options = new ClassifyOptions.Builder()
  .imagesFile(new File(SINGLE_IMAGE_FILE))
  .build();
ClassifiedImages result = service.classify(options).execute();
System.out.println(result);