Use openface to train a new dnn Model

Source: Internet
Author: User
Tags dnn

TAG set IMA represent ATI people error repr res

Openface-Based Neural Network Training

1. Install openface and related environments

Https://www.cnblogs.com/pandaroll/p/6590339.html

The test Link contains


2. Prepare training data

Dataset: facescrub
Link: http://vintage.winklerbros.net/facescrub.html
Download:
Https://github.com/lightalchemist/FaceScrub/pulse
Https://github.com/faceteam/facescrub



3. I am an actor, actors folder, and put the dataset under the specified directory.
After openface is installed, it is stored in the/home/ly/openface/data directory. Because the program directory is Casia-facescrub, a directory is created. Sudo mkdir/home/ly/openface/data/Casia-facescrub

 



4. Create the directory dlib-affine-SE: 96 to store the aligntest image. Raw is used to store original images. After alignment processing, the image is displayed? :
The processing statement is:
CD/home/ly/openface
For N in {1 .. 8}; do. /util/align-dlib.py. /data/Casia-facescrub/raw align outereyesandnose. /data/Casia-facescrub/dlib-affine-SZ: 96 -- size 96 & done

 


5. Exclude the absence of images in some folders (at least three, less than three files are deleted)
Run: python2./util/prune-dataset.pydata/Casia-facescrub/dlib-affine-SZ: 96
-Numimagesthreshold 3

6. Modify the file directory in the program
(1) train. Lua

 



(2) opt. Lua

CMD: Option ('-peopleperbatch', 15, 'number of people to sample in eachmini-batch .')
CMD: Option ('-imagesperperson', 20, 'number of images to sample per person in each mini-batch .')
Changed:

Because my directory is in the self-built directory, not the root directory, so change
CMD: Option ('-lfwdir',' ../data/lfw/aligned', 'lfw aligned image directory for testing .')
CMD: Option ('-lfwdir','/home/ly/openface/data/Casia-facescrub/aligntest/', 'lfw aligne

CMD: Option ('-testbatchsize', 800, 'batch size for testing.') to 80
Change
CMD: Option ('-testbatchsize', 80, 'batch size for testing .')
Modify the location of the aligned Dataset:
CMD: Option ('-data','/home/ly/openface/data/Casia-facescrub/dlib-affine-SZ: 96 /',
'Home of dataset. images separated by identity. ') -- align the position of the dataset

(3) test. Lua
Local batchrepresent = "~ /Openface/batch-represent/Main. Lua"
Local lfweval = "~ /Openface/evaluation/lfw. py"

 



(4) Add the tripletembedding. Lua file under the torch-tripletembedding file.
(5) add pairs.txt to this directory, from this http://vis-www.cs.umass.edu/lfw/pairs.txt
Download

 



(6) but there is a problem later. Errors are always reported during testing files and cannot be tested. The result of 1000 training iterations is

No method has been found for testing results. I do not know how to make any errors in the testing part?

 

 



Changes:
From sklearn. model_selection import kfold # model_selection cross_validation

Suddenly sklearn. cross_validation cannot be used. Instead, model_selection is used, and an error occurs.



Modify kfold: this problem is solved. It is the package I introduced.



Important:
Image Processing
For N in {1 .. 8}; do. /util/align-dlib.py. /data/Casia-facescrub/raw/align outereyesandnose. /data/Casia-facescrub/dlib-affine-SZ \: 96/-- size 96 & done
../Util/prune-dataset.py./data/Casia-facescrub/dlib-affine-SZ \: 96/-- numimagesthreshold 1

Why is there no image but an error reported?
Magick. image: error loading image: Unable to open file (/home/ly/openface/data/Casia-facescrub/dlib-affine-SZ: 96/jude_law/jude_law_66798.png) (predictiontype = 430)

The cause of the error is probably unknown, that is, the prompt that the person in the folder cannot be found, but sometimes the picture of the prompt can be found when you go to the following link, so you do not know what to do? If you have a full run, you can leave a message for me. Thank you.

Use openface to train a new dnn Model

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.