public class PersonMatcher extends Object
Note that, when run for the first time, the system will ask you to go and get an APPID for the Bing Search, and it will give you the URL to go get it.
The main method is just a test method - it will delete the recogniser after it's done.
Constructor and Description |
---|
PersonMatcher()
Create a person matcher
|
PersonMatcher(File recogniserFile)
Create a person matcher with the given file
|
PersonMatcher(List<String> queries,
File recogniserFile,
boolean addCounterExamples)
Constructor that takes a query string.
|
PersonMatcher(String[] queries,
File recogniserFile,
boolean addCounterExamples)
Constructor that takes a set of queries to search for
|
PersonMatcher(String person,
File recogniserFile)
Create a recogniser for the given person into the given file.
|
Modifier and Type | Method and Description |
---|---|
void |
addCounterExamples()
Adds a set of counter examples to the recogniser by searching the web for
the generic string "face" and adding them as an unknown person.
|
static MBFImage |
displayQueryResults(URL resource) |
float |
getMatchingThreshold()
Get the current matching threhsold of this person matcher.
|
static void |
main(String[] args) |
List<? extends IndependentPair<? extends DetectedFace,ScoredAnnotation<String>>> |
query(FImage fi) |
void |
saveRecogniser(File recogniserFile)
After training, you might want to save the recogniser
|
void |
setMatchingThreshold(float matchingThreshold)
Set the matching threshold of this person matcher.
|
void |
train(String[] queries)
Train the recogniser with examples retrieved from searching with the
given queries.
|
public PersonMatcher() throws Exception
Exception
public PersonMatcher(File recogniserFile) throws Exception
recogniserFile
- The recogniser file to loadException
public PersonMatcher(String person, File recogniserFile) throws Exception
person
- The person to create a recogniser forrecogniserFile
- The recogniser file to saveException
- If the face recognition engine could not be initialisedpublic PersonMatcher(List<String> queries, File recogniserFile, boolean addCounterExamples) throws Exception
queries
- The query strings to userecogniserFile
- The file to save the recogniser intoaddCounterExamples
- Whether to add counter examplesException
- If the face recognition engine could not be initialisedpublic PersonMatcher(String[] queries, File recogniserFile, boolean addCounterExamples) throws Exception
queries
- The query strings to userecogniserFile
- The file to save the recogniser into (NULL for no saving)addCounterExamples
- Whether to add counter examplesException
- If the face recognition engine could not be initialisedpublic void saveRecogniser(File recogniserFile) throws IOException
recogniserFile
- The recogniser file to save toIOException
public void train(String[] queries)
queries
- The query stringspublic List<? extends IndependentPair<? extends DetectedFace,ScoredAnnotation<String>>> query(FImage fi)
fi
- The image to find the query person withinpublic void addCounterExamples()
public float getMatchingThreshold()
public void setMatchingThreshold(float matchingThreshold)
matchingThreshold
- The matching threshold to setpublic static MBFImage displayQueryResults(URL resource) throws Exception
resource
- Exception
public static void main(String[] args) throws IOException
args
- IOException