Make sure you have python, OpenFace and dlib installed. You can either install them manually or use a preconfigured docker image that has everying already installed:
docker pull bamos/openface
docker run -p 9000:9000 -p 8000:8000 -t -i bamos/openface /bin/bash
cd /root/openface
Make a folder called /training-images/
somewhere on your computer.
Make a subfolder for each person you want to recognize. For example:
/training-images/will-ferrell/
/training-images/chad-smith/
/training-images/jimmy-fallon/
Copy all your images of each person into the correct sub-folders
Run the openface scripts from inside the openface root directory:
First, do pose detection and alignment:
./util/align-dlib.py ./training-images/ align outerEyesAndNose ./aligned-images/ --size 96
Second, generate the representations from the aligned images:
./batch-represent/main.lua -outDir ./generated-embeddings/ -data ./aligned-images/
When you are done, the ./generated-embeddings/
folder will contain a csv file with the embeddings for each image.
thilakraj@thilakraj-Aspire-V5-471PG:
/openface$ ./util/align-dlib.py ./training-images/ align outerEyesAndNose ./aligned-images/ --size 96/openface$ ./batch-represent/main.lua -outDir ./generated-embeddings/ -data ./aligned-images/thilakraj@thilakraj-Aspire-V5-471PG:
{
data : "./aligned-images/"
imgDim : 96
model : "/home/thilakraj/openface/models/openface/nn4.small2.v1.t7"
device : 1
outDir : "./generated-embeddings/"
cache : false
cuda : false
batchSize : 50
}
./aligned-images/
cache lotation: /home/thilakraj/openface/aligned-images/cache.t7
Creating metadata for cache.
{
sampleSize :
{
1 : 3
2 : 96
3 : 96
}
split : 0
verbose : true
paths :
{
1 : "./aligned-images/"
}
samplingMode : "balanced"
loadSize :
{
1 : 3
2 : 96
3 : 96
}
}
running "find" on each class directory, and concatenate all those filenames into a single file containing all image paths for a given class
now combine all the files to a single large file
load the large concatenated list of sample paths to self.imagePath
/home/thilakraj/torch/install/bin/luajit: /home/thilakraj/openface/batch-represent/dataset.lua:193: Could not find any image file in the given input paths
stack traceback:
[C]: in function 'assert'
/home/thilakraj/openface/batch-represent/dataset.lua:193: in function '__init'
/home/thilakraj/torch/install/share/lua/5.1/torch/init.lua:91: in function </home/thilakraj/torch/install/share/lua/5.1/torch/init.lua:87>
[C]: in function 'dataLoader'
...e/thilakraj/openface/batch-represent/batch-represent.lua:19: in function 'batchRepresent'
./batch-represent/main.lua:42: in main chunk
[C]: in function 'dofile'
...kraj/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x00406670
thilakraj@thilakraj-Aspire-V5-471PG:~/openface$
Can someone tell me Why I got like this?