public class AlchemyVision extends AlchemyService
Modifier and Type | Field and Description |
---|---|
static String |
FORCE_SHOW_ALL
The Constant FORCE_SHOW_ALL.
|
static String |
HTML
The Constant HTML.
|
static String |
IMAGE
The Constant IMAGE.
|
static String |
IMAGE_POST_MODE
The Constant IMAGE_POST_MODE.
|
static String |
KNOWLEDGE_GRAPH
The Constant KNOWLEDGE_GRAPH.
|
static String |
NOT_RAW
The Constant NOT_RAW.
|
static String |
RAW
The Constant RAW.
|
static String |
URL
The Constant URL.
|
ENDPOINT, JSONP, OUTPUT_MODE
VERSION
Constructor and Description |
---|
AlchemyVision() |
Modifier and Type | Method and Description |
---|---|
ImageKeywords |
getImageKeywords(File image,
Boolean forceShowAll,
Boolean knowledgeGraph)
Extracts keywords from an image
|
ImageKeywords |
getImageKeywords(URL url,
Boolean forceShowAll,
Boolean knowledgeGraph)
Extracts keywords from a URL.
|
ImageLink |
getImageLink(String html)
Extracts the main image link from a HTML page.
|
ImageLink |
getImageLink(URL url)
Extracts main image link from a URL.
|
ImageFaces |
recognizeFaces(File image,
Boolean knowledgeGraph)
Recognizes faces from an image.
For each face detected returns: Bounding box Gender Approximate age Name (if celebrity is detected) Here is an example of how to recognize faces in an image: |
ImageFaces |
recognizeFaces(URL url,
Boolean knowledgeGraph)
Recognizes faces from a URL.
For each face detected returns: Bounding box Gender Approximate age Name (if celebrity is detected) Here is an example of how to recognize faces in an image: |
execute, executeRequest, getInputFormat, setAuthentication
configureHttpClient, executeWithoutResponse, getApiKey, getEndPoint, getName, getToken, setApiKey, setDefaultHeaders, setEndPoint, setUsernameAndPassword, toString
public static final String FORCE_SHOW_ALL
public static final String HTML
public static final String IMAGE
public static final String IMAGE_POST_MODE
public static final String KNOWLEDGE_GRAPH
public static final String NOT_RAW
public static final String RAW
public static final String URL
public ImageKeywords getImageKeywords(File image, Boolean forceShowAll, Boolean knowledgeGraph)
image
- the image fileforceShowAll
- Includes lower confidence tagsknowledgeGraph
- Include knowledge graph information in the the results.ImageKeywords
public ImageKeywords getImageKeywords(URL url, Boolean forceShowAll, Boolean knowledgeGraph)
url
- the image URLforceShowAll
- Includes lower confidence tagsknowledgeGraph
- Include knowledge graph information in the the results.ImageKeywords
public ImageLink getImageLink(URL url)
url
- the image URLImageLink
public ImageLink getImageLink(String html)
html
- the HTMLImageLink
public ImageFaces recognizeFaces(File image, Boolean knowledgeGraph)
AlchemyVision service = new AlchemyVision(); service.setApiKey("<api_key>"); File image = new File("obama.jpg"); ImageFaces faces = service.recognizeFaces(image, true); System.out.println(faces);
image
- the imageknowledgeGraph
- provide extra metadata for detected celebritiesImageFaces
public ImageFaces recognizeFaces(URL url, Boolean knowledgeGraph)
AlchemyVision service = new AlchemyVision(); service.setApiKey("<api_key>"); URL image = new URL("http://foo.com/the-image.png"); ImageFaces faces = service.recognizeFaces(image, true); System.out.println(faces);
url
- the image URLknowledgeGraph
- provide extra metadata for detected celebritiesImageFaces
Copyright © 2015–2016. All rights reserved.