Use a Domain-Specific Model

The Domain-Specific Model is a model trained to identify a specific set of objects in an image. The two domain-specific models that are currently available are celebrities and landmarks. The following example identifies a landmark in an image.

Landmark Java example request

To run the sample, perform the following steps:

Create a new Command Line App.

Replace the Main class with the following code (keep any package statements).

Replace the subscriptionKey value with your valid subscription key.

Change the uriBasevalue to use the location where you obtained your subscription keys, if necessary.

Download these libraries from the Maven Repository to the lib directory in your project:

Get a thumbnail with Computer Vision API using Java

Use the Get Thumbnail method to crop an image based on its region of interest (ROI) to the height and width you desire. The aspect ratio you set for the thumbnail can be different from the aspect ratio of the input image.

Get a thumbnail Java example request

To run the sample, perform the following steps:

Create a new Command Line App.

Replace the Main class with the following code (keep any package statements).

Replace the subscriptionKey value with your valid subscription key.

Change the uriBasevalue to use the location where you obtained your subscription keys, if necessary.

Download these libraries from the Maven Repository to the lib directory in your project: