Skip to content

Commit

Permalink
cleaning up for lib release
Browse files Browse the repository at this point in the history
  • Loading branch information
shiffman committed Mar 13, 2014
1 parent 6e475a4 commit 1434ba1
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
.DS_Store
*.class
key.txt
distribution/
10 changes: 7 additions & 3 deletions examples/FaceDetectExample/FaceDetectExample.pde
@@ -1,12 +1,16 @@
// This example also requires the HTTPProcessing library
// https://www.dropbox.com/s/fqzddqqfhzt7580/HTTProcessing.zip
// Rekognition for Processing example
// Daniel Shiffman
// https://github.com/shiffman/Rekognition-for-Processing/

// This example also requires HTTP Requests for Processing
// https://github.com/runemadsen/HTTP-Requests-for-Processing

// Also, you need an API key.
// Sign up here: http://rekognition.com/register/
// Make a text file in your data folder called key.txt
// Put your API key on the first line and your API secret on the second line

import httprocessing.*;
import http.requests.*;
import rekognition.faces.*;

Rekognition rekog;
Expand Down
10 changes: 7 additions & 3 deletions examples/FaceRecognizeExample/FaceRecognizeExample.pde
@@ -1,12 +1,16 @@
// This example also requires HTTProcessing.zip
// https://www.dropbox.com/s/fqzddqqfhzt7580/HTTProcessing.zip
// Rekognition for Processing example
// Daniel Shiffman
// https://github.com/shiffman/Rekognition-for-Processing/

// This example also requires HTTP Requests for Processing
// https://github.com/runemadsen/HTTP-Requests-for-Processing

// Also, you need an API key.
// Sign up here: http://rekognition.com/register/
// Make a text file in your data folder called key.txt
// Put your API key on the first line and your API secret on the second line

import httprocessing.*;
import http.requests.*;
import rekognition.faces.*;

PImage img;
Expand Down
18 changes: 11 additions & 7 deletions examples/FaceTrainExample/FaceTrainExample.pde
@@ -1,13 +1,16 @@
// This example requires two libraries, these are temporary download links:
// https://www.dropbox.com/s/xr09pdaoul7wqpd/RekognitionProcessing.zip
// https://www.dropbox.com/s/fqzddqqfhzt7580/HTTProcessing.zip
// Rekognition for Processing example
// Daniel Shiffman
// https://github.com/shiffman/Rekognition-for-Processing/

// This example also requires HTTP Requests for Processing
// https://github.com/runemadsen/HTTP-Requests-for-Processing

// Also, you need an API key.
// Sign up here: http://rekognition.com/register/
// Make a text file in your data folder called key.txt
// Put your API key on the first line and your API secret on the second line

import httprocessing.*;
import http.requests.*;
import rekognition.faces.*;

PImage img;
Expand All @@ -20,18 +23,19 @@ void setup() {
String api_key = keys[0];
String api_secret = keys[1];

RekognitionFace facerekog = new RekognitionFace(this, api_key, api_secret);
Rekognition face = new Rekognition(this, api_key, api_secret);

// Here we tell Rekognition that the face in this image associated with this name
facerekog.addFace(sketchPath("data/pitt.jpg"), "Pitt");
face.addFace("pitt.jpg", "Pitt");

// We need a second API call to train Rekognition of whatever faces have been added
// Here it's one face, then train, but you could add a lot of faces before training
facerekog.train();
face.train();
}

void draw() {

// Not doing anything in this example
noLoop();
}

4 changes: 2 additions & 2 deletions src/rekognition/examples/AddFaceAndTrain.java
Expand Up @@ -18,8 +18,8 @@ public void setup() {
face.setNamespace("faceit2");
face.setUserID("shiffman");

face.addFace("data/pitt.jpg", "Brad Pitt");
face.addFace("data/obama.jpg","Barack Obama");
face.addFace("pitt.jpg", "Brad Pitt");
face.addFace("obama.jpg","Barack Obama");

face.train();
}
Expand Down

0 comments on commit 1434ba1

Please sign in to comment.