Skip to content

Commit

Permalink
* README FIX - According to face scenarios class, there should be fac…
Browse files Browse the repository at this point in the history
…eSubscriptionKey.

* Find emotion faces should return Emotions not Faces..
  • Loading branch information
konradr25 committed Jan 29, 2017
1 parent 5bac5d1 commit b99a4e8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public static void main(String[] args) {
###### Example
```java
public static void main(String[] args) throws IOException {
FaceScenarios faceScenarios = new FaceScenarios(getProperty("azure.cognitive.subscriptionKey"),
FaceScenarios faceScenarios = new FaceScenarios(getProperty("azure.cognitive.face.subscriptionKey"),
getProperty("azure.cognitive.emotion.subscriptionKey"));
Face faces = faceScenarios.findSingleFace(IMAGE_URL);
ImageOverlayBuilder.builder(IMAGE_URL).outFaceLandmarksOnImage(faces).launchViewer();
Expand All @@ -113,7 +113,7 @@ public static void main(String[] args) throws IOException {
###### Example
```java
public static void main(String[] args) {
FaceScenarios faceScenarios = new FaceScenarios(getProperty("azure.cognitive.subscriptionKey"),
FaceScenarios faceScenarios = new FaceScenarios(getProperty("azure.cognitive.face.subscriptionKey"),
getProperty("azure.cognitive.emotion.subscriptionKey"));
List<Face> faces = faceScenarios.findFaces(IMAGE_URL);
ImageOverlayBuilder.builder(IMAGE_URL).outlineFacesOnImage(faces, RectangleType.CORNERED,
Expand All @@ -129,7 +129,7 @@ public static void main(String[] args) {
###### Example
```java
public static void main(String[] args) {
FaceScenarios faceScenarios = new FaceScenarios(getProperty("azure.cognitive.subscriptionKey"),
FaceScenarios faceScenarios = new FaceScenarios(getProperty("azure.cognitive.face.subscriptionKey"),
getProperty("azure.cognitive.emotion.subscriptionKey"));
ImageOverlayBuilder imageOverlayBuilder = ImageOverlayBuilder.builder(CANDIDATE_1);
imageOverlayBuilder.verify(CANDIDATE_2, faceScenarios.verifyFaces(CANDIDATE_1, CANDIDATE_2)).launchViewer();
Expand All @@ -143,7 +143,7 @@ public static void main(String[] args) {
###### Example
```java
public static void main(String[] args) {
FaceScenarios faceScenarios = new FaceScenarios(getProperty("azure.cognitive.subscriptionKey"),
FaceScenarios faceScenarios = new FaceScenarios(getProperty("azure.cognitive.face.subscriptionKey"),
getProperty("azure.cognitive.emotion.subscriptionKey"));
ImageOverlayBuilder imageOverlayBuilder = ImageOverlayBuilder.builder(IMAGE);
List<ImageHolder> candidates = candidates();
Expand All @@ -158,7 +158,7 @@ public static void main(String[] args) {

```java
public static void main(String[] args) {
FaceScenarios faceScenarios = new FaceScenarios(getProperty("azure.cognitive.subscriptionKey"),
FaceScenarios faceScenarios = new FaceScenarios(getProperty("azure.cognitive.face.subscriptionKey"),
getProperty("azure.cognitive.emotion.subscriptionKey"));
ImageOverlayBuilder imageOverlayBuilder = ImageOverlayBuilder.builder(IMAGE);
faceScenarios.findFaces(IMAGE).stream().forEach(imageOverlayBuilder:: pixelateFaceOnImage);
Expand All @@ -173,7 +173,7 @@ public static void main(String[] args) {

```java
public static void main(String[] args) {
FaceScenarios faceScenarios = new FaceScenarios(getProperty("azure.cognitive.subscriptionKey"),
FaceScenarios faceScenarios = new FaceScenarios(getProperty("azure.cognitive.face.subscriptionKey"),
getProperty("azure.cognitive.emotion.subscriptionKey"));
ImageOverlayBuilder.builder(IMAGE_URL).outlineEmotionsOnImage(faceScenarios.findEmotionFaces(IMAGE_URL)).launchViewer();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,19 +398,19 @@ public List<Face> findFaces(@NotNull InputStream image) {
* Find a faces within a local image
*
* @param image the local image
* @return the found faces
* @return the found emotion faces
*/
@NotNull
public List<Face> findEmotionFaces(@NotNull InputStream image) {
return faceTaskBuilder.detectFace(true, true, FaceAttributes.ALL, image).withResult();
public List<Emotion> findEmotionFaces(@NotNull InputStream image) {
return emotionBuilder.emotionRecognition(image).withResult();
}


/**
* Find a faces within a local image
*
* @param image the image URL
* @return the found faces
* @return the found emotion faces
*/
@NotNull
public List<Emotion> findEmotionFaces(@NotNull String image) {
Expand Down

0 comments on commit b99a4e8

Please sign in to comment.