public class FaceSimilarityTool extends Object
This tool can be used both from the command-line and programmatically.
Programmatically, there are some convenience functions for comparing
List
s of File
s and lists of FImage
s, however, you are
welcome to give the
getDistances(List, boolean, ImageGetter, FaceSimilarityEngine)
method any List
as long as you supply an FaceSimilarityTool.ImageGetter
that can
return FImage
s from that list.
Modifier and Type | Class and Description |
---|---|
static interface |
FaceSimilarityTool.ImageGetter<T>
An interface to get images and names from a list of things.
|
Constructor and Description |
---|
FaceSimilarityTool() |
Modifier and Type | Method and Description |
---|---|
Map<String,Map<String,Double>> |
getDistances(File first,
List<File> others,
FaceSimilarityEngine<?,?,FImage> strategy)
Calculates the distance between all the faces in the first image with all
the faces in the given images.
|
Map<String,Map<String,Double>> |
getDistances(List<File> inputFiles,
boolean withFirst,
FaceSimilarityEngine<?,?,FImage> strategy)
Calculates the distance between faces in the given images.
|
Map<String,Map<String,Double>> |
getDistances(List<File> inputFiles,
FaceSimilarityEngine<?,?,FImage> strategy)
Calculates the distance between faces in the given images.
|
Map<String,Map<String,Double>> |
getDistances(List<String> imageIdentifiers,
List<FImage> inputImages,
boolean withFirst,
FaceSimilarityEngine<?,?,FImage> strategy)
Calculates the distance between faces in the given images.
|
<T> Map<String,Map<String,Double>> |
getDistances(List<T> inputList,
boolean withFirst,
FaceSimilarityTool.ImageGetter<T> iGetter,
FaceSimilarityEngine<?,?,FImage> strategy)
This is the actual comparison function that performs the nested loops as
necessary to match all the faces against each other.
|
static void |
main(String[] args) |
public FaceSimilarityTool()
public Map<String,Map<String,Double>> getDistances(File first, List<File> others, FaceSimilarityEngine<?,?,FImage> strategy)
first
- The query imageothers
- The list of files to compare againststrategy
- The strategypublic Map<String,Map<String,Double>> getDistances(List<File> inputFiles, FaceSimilarityEngine<?,?,FImage> strategy)
inputFiles
- The list of files to processstrategy
- the strategypublic Map<String,Map<String,Double>> getDistances(List<File> inputFiles, boolean withFirst, FaceSimilarityEngine<?,?,FImage> strategy)
inputFiles
- The list of files to processwithFirst
- if TRUE, the first image in the list will be matched against
all others, otherwise all images are matches against each
other.strategy
- The strategypublic Map<String,Map<String,Double>> getDistances(List<String> imageIdentifiers, List<FImage> inputImages, boolean withFirst, FaceSimilarityEngine<?,?,FImage> strategy)
imageIdentifiers
- A list of image namesinputImages
- The list of images to processwithFirst
- if TRUE, the first image in the list will be matched against
all others, otherwise all images are matches against each
other.strategy
- The strategy.public <T> Map<String,Map<String,Double>> getDistances(List<T> inputList, boolean withFirst, FaceSimilarityTool.ImageGetter<T> iGetter, FaceSimilarityEngine<?,?,FImage> strategy)
T
- The type of thing in the input listinputList
- A list of things to processwithFirst
- Whether to compare the first against all others (TRUE) or
compare all against each other (FALSE)iGetter
- The getter that can make FImages from the input list.strategy
- The strategy