当前位置: 首页 > 工具软件 > Easy-Classify > 使用案例 >

用IBM Watson API进行图像识别,so easy

罗俭
2023-12-01

Here has a document about all Watson API :

http://slideshare.net/huiwenhan/ibm-cognitive-service-introduction

For development ,Watson provides SDK ,it is more easy to use SDK to develop than the original REST API ,

Here is the Java SDK :https://github.com/watson-developer-cloud/java-sdk ,

It also provide SDK for other programming language :https://github.com/watson-developer-cloud

For visual insights or visual recognition ,it's very easy if we using SDK :

Visual Insights

Use the Visual Insights to get insight into the themes present in a collection of images based on their visual appearance/content.

VisualInsights service = new VisualInsights();
service.setUsernameAndPassword("<username>", "<password>");

File images = new File("src/test/resources/visual_insights/images.zip");
Summary summary = service.getSummary(images).execute();

System.out.println(summary);

Visual Recognition

Use the Visual Recognition service to recognize the following picture.

VisualRecognition service = new VisualRecognition(VisualRecognition.VERSION_DATE_2015_12_02);
service.setUsernameAndPassword("<username>", "<password>");

File image = new File("src/test/resources/visual_recognition/car.png");

VisualClassification result = service.classify(image).execute();
System.out.println(result); 

You can apply the Credentials from bluemix console :

Here is a example for mine :

Service Credentials

{
  "credentials": {
    "url": "https://gateway.watsonplatform.net/visual-recognition-beta/api",
    "password": "kXOh7Dzcm7Pf",
    "username": "29a55ab2-e322-4043-adba-a19b581fcee8"
  }
}

Here is the API for visual-insights

https://watson-api-explorer.mybluemix.net/apis/visual-insights-v1-experimental#/visual-insights

Here is the API for visual-recognition

https://watson-api-explorer.mybluemix.net/apis/visual-recognition-v2-beta 

If you want to have custom classes ,you have to create new classes and train it .

 类似资料: