├── FaceAlignment
├── CMakeLists.txt
├── README.md
├── data
│ └── image_0001.png
├── doc
│ └── aflw_nrmse.png
├── examples
│ ├── FaceAlignment
│ │ ├── FaceAlignment.vcxproj
│ │ └── FaceAlignment.vcxproj.filters
│ ├── examples.sln
│ ├── examples.v12.suo
│ └── examples
│ │ ├── FaceDetection.dll
│ │ ├── FaceDetection.lib
│ │ ├── examples.vcxproj
│ │ ├── examples.vcxproj.filters
│ │ └── examples.vcxproj.user
├── include
│ ├── cfan.h
│ ├── common.h
│ ├── face_alignment.h
│ └── sift.h
├── model
│ └── seeta_fa_v1.1.bin
└── src
│ ├── cfan.cpp
│ ├── face_alignment.cpp
│ ├── sift.cpp
│ └── test
│ └── face_alignment_test.cpp
├── FaceDetection
├── .gitignore
├── CMakeLists.txt
├── README.md
├── data
│ └── 0_1_1.jpg
├── doc
│ └── fddb_roc.png
├── examples
│ ├── FaceDetection
│ │ ├── FaceDetection.vcxproj
│ │ └── FaceDetection.vcxproj.filters
│ ├── examples.sln
│ ├── examples.v12.suo
│ └── examples
│ │ ├── examples.vcxproj
│ │ ├── examples.vcxproj.filters
│ │ └── examples.vcxproj.user
├── include
│ ├── classifier.h
│ ├── classifier
│ │ ├── lab_boosted_classifier.h
│ │ ├── mlp.h
│ │ └── surf_mlp.h
│ ├── common.h
│ ├── detector.h
│ ├── face_detection.h
│ ├── feat
│ │ ├── lab_feature_map.h
│ │ └── surf_feature_map.h
│ ├── feature_map.h
│ ├── fust.h
│ ├── io
│ │ ├── lab_boost_model_reader.h
│ │ └── surf_mlp_model_reader.h
│ ├── model_reader.h
│ └── util
│ │ ├── image_pyramid.h
│ │ ├── math_func.h
│ │ └── nms.h
├── model
│ └── seeta_fd_frontal_v1.0.bin
└── src
│ ├── classifier
│ ├── lab_boosted_classifier.cpp
│ ├── mlp.cpp
│ └── surf_mlp.cpp
│ ├── face_detection.cpp
│ ├── feat
│ ├── lab_feature_map.cpp
│ └── surf_feature_map.cpp
│ ├── fust.cpp
│ ├── io
│ ├── lab_boost_model_reader.cpp
│ └── surf_mlp_model_reader.cpp
│ ├── test
│ └── facedetection_test.cpp
│ └── util
│ ├── image_pyramid.cpp
│ └── nms.cpp
├── FaceIdentification
├── .gitignore
├── CMakeLists.txt
├── README.md
├── data
│ └── test_face_recognizer
│ │ ├── crop_file_list.txt
│ │ ├── crop_sdk_file_list.txt
│ │ ├── feats.dat
│ │ ├── images
│ │ ├── compare_im
│ │ │ ├── Aaron_Peirsol_0001.jpg
│ │ │ └── Aaron_Peirsol_0004.jpg
│ │ ├── crop
│ │ │ ├── NF_200001_001.jpg
│ │ │ ├── NF_200002_002.jpg
│ │ │ ├── NF_200003_002.jpg
│ │ │ ├── NF_200004_003.jpg
│ │ │ ├── NF_200005_037.jpg
│ │ │ ├── NF_200006_005.jpg
│ │ │ ├── NF_200007_001.jpg
│ │ │ ├── NF_200008_002.jpg
│ │ │ ├── NF_200009_001.jpg
│ │ │ ├── NF_200010_003.jpg
│ │ │ ├── NF_200011_001.jpg
│ │ │ ├── NF_200012_001.jpg
│ │ │ ├── NF_200013_004.jpg
│ │ │ ├── NF_200014_006.jpg
│ │ │ ├── NF_200015_001.jpg
│ │ │ ├── NF_200016_005.jpg
│ │ │ ├── NF_200017_005.jpg
│ │ │ ├── NF_200018_001.jpg
│ │ │ ├── NF_200019_004.jpg
│ │ │ ├── NF_200020_003.jpg
│ │ │ ├── NF_200021_002.jpg
│ │ │ ├── NF_200022_001.jpg
│ │ │ ├── NF_200023_001.jpg
│ │ │ ├── NF_200024_004.jpg
│ │ │ ├── NF_200025_006.jpg
│ │ │ ├── NF_200026_003.jpg
│ │ │ ├── NF_200027_001.jpg
│ │ │ ├── NF_200028_002.jpg
│ │ │ ├── NF_200029_005.jpg
│ │ │ ├── NF_200030_003.jpg
│ │ │ ├── NF_200031_001.jpg
│ │ │ ├── NF_200032_001.jpg
│ │ │ ├── NF_200033_001.jpg
│ │ │ ├── NF_200034_001.jpg
│ │ │ ├── NF_200035_002.jpg
│ │ │ ├── NF_200036_004.jpg
│ │ │ ├── NF_200037_002.jpg
│ │ │ ├── NF_200038_002.jpg
│ │ │ ├── NF_200039_006.jpg
│ │ │ ├── NF_200040_003.jpg
│ │ │ ├── NF_200041_001.jpg
│ │ │ ├── NF_200042_001.jpg
│ │ │ ├── NF_200043_003.jpg
│ │ │ ├── NF_200044_006.jpg
│ │ │ ├── NF_200045_003.jpg
│ │ │ ├── NF_200046_006.jpg
│ │ │ ├── NF_200047_004.jpg
│ │ │ ├── NF_200048_002.jpg
│ │ │ ├── NF_200049_020.jpg
│ │ │ └── NF_200050_002.jpg
│ │ ├── crop_sdk
│ │ │ ├── NF_200001_001.jpg
│ │ │ ├── NF_200002_002.jpg
│ │ │ ├── NF_200003_002.jpg
│ │ │ ├── NF_200004_003.jpg
│ │ │ ├── NF_200005_037.jpg
│ │ │ ├── NF_200006_005.jpg
│ │ │ ├── NF_200007_001.jpg
│ │ │ ├── NF_200008_002.jpg
│ │ │ ├── NF_200009_001.jpg
│ │ │ ├── NF_200010_003.jpg
│ │ │ ├── NF_200011_001.jpg
│ │ │ ├── NF_200012_001.jpg
│ │ │ ├── NF_200013_004.jpg
│ │ │ ├── NF_200014_006.jpg
│ │ │ ├── NF_200015_001.jpg
│ │ │ ├── NF_200016_005.jpg
│ │ │ ├── NF_200017_005.jpg
│ │ │ ├── NF_200018_001.jpg
│ │ │ ├── NF_200019_004.jpg
│ │ │ ├── NF_200020_003.jpg
│ │ │ ├── NF_200021_002.jpg
│ │ │ ├── NF_200022_001.jpg
│ │ │ ├── NF_200023_001.jpg
│ │ │ ├── NF_200024_004.jpg
│ │ │ ├── NF_200025_006.jpg
│ │ │ ├── NF_200026_003.jpg
│ │ │ ├── NF_200027_001.jpg
│ │ │ ├── NF_200028_002.jpg
│ │ │ ├── NF_200029_005.jpg
│ │ │ ├── NF_200030_003.jpg
│ │ │ ├── NF_200031_001.jpg
│ │ │ ├── NF_200032_001.jpg
│ │ │ ├── NF_200033_001.jpg
│ │ │ ├── NF_200034_001.jpg
│ │ │ ├── NF_200035_002.jpg
│ │ │ ├── NF_200036_004.jpg
│ │ │ ├── NF_200037_002.jpg
│ │ │ ├── NF_200038_002.jpg
│ │ │ ├── NF_200039_006.jpg
│ │ │ ├── NF_200040_003.jpg
│ │ │ ├── NF_200041_001.jpg
│ │ │ ├── NF_200042_001.jpg
│ │ │ ├── NF_200043_003.jpg
│ │ │ ├── NF_200044_006.jpg
│ │ │ ├── NF_200045_003.jpg
│ │ │ ├── NF_200046_006.jpg
│ │ │ ├── NF_200047_004.jpg
│ │ │ ├── NF_200048_002.jpg
│ │ │ ├── NF_200049_020.jpg
│ │ │ └── NF_200050_002.jpg
│ │ └── src
│ │ │ ├── NF_200001_001.jpg
│ │ │ ├── NF_200002_002.jpg
│ │ │ ├── NF_200003_002.jpg
│ │ │ ├── NF_200004_003.jpg
│ │ │ ├── NF_200005_037.jpg
│ │ │ ├── NF_200006_005.jpg
│ │ │ ├── NF_200007_001.jpg
│ │ │ ├── NF_200008_002.jpg
│ │ │ ├── NF_200009_001.jpg
│ │ │ ├── NF_200010_003.jpg
│ │ │ ├── NF_200011_001.jpg
│ │ │ ├── NF_200012_001.jpg
│ │ │ ├── NF_200013_004.jpg
│ │ │ ├── NF_200014_006.jpg
│ │ │ ├── NF_200015_001.jpg
│ │ │ ├── NF_200016_005.jpg
│ │ │ ├── NF_200017_005.jpg
│ │ │ ├── NF_200018_001.jpg
│ │ │ ├── NF_200019_004.jpg
│ │ │ ├── NF_200020_003.jpg
│ │ │ ├── NF_200021_002.jpg
│ │ │ ├── NF_200022_001.jpg
│ │ │ ├── NF_200023_001.jpg
│ │ │ ├── NF_200024_004.jpg
│ │ │ ├── NF_200025_006.jpg
│ │ │ ├── NF_200026_003.jpg
│ │ │ ├── NF_200027_001.jpg
│ │ │ ├── NF_200028_002.jpg
│ │ │ ├── NF_200029_005.jpg
│ │ │ ├── NF_200030_003.jpg
│ │ │ ├── NF_200031_001.jpg
│ │ │ ├── NF_200032_001.jpg
│ │ │ ├── NF_200033_001.jpg
│ │ │ ├── NF_200034_001.jpg
│ │ │ ├── NF_200035_002.jpg
│ │ │ ├── NF_200036_004.jpg
│ │ │ ├── NF_200037_002.jpg
│ │ │ ├── NF_200038_002.jpg
│ │ │ ├── NF_200039_006.jpg
│ │ │ ├── NF_200040_003.jpg
│ │ │ ├── NF_200041_001.jpg
│ │ │ ├── NF_200042_001.jpg
│ │ │ ├── NF_200043_003.jpg
│ │ │ ├── NF_200044_006.jpg
│ │ │ ├── NF_200045_003.jpg
│ │ │ ├── NF_200046_006.jpg
│ │ │ ├── NF_200047_004.jpg
│ │ │ ├── NF_200048_002.jpg
│ │ │ ├── NF_200049_020.jpg
│ │ │ └── NF_200050_002.jpg
│ │ └── test_file_list.txt
├── examples
│ ├── Identification
│ │ ├── Identification.vcxproj
│ │ └── Identification.vcxproj.filters
│ ├── Tester
│ │ ├── Tester.vcxproj
│ │ ├── Tester.vcxproj.filters
│ │ └── Tester.vcxproj.user
│ ├── examples.sln
│ └── examples.v12.suo
├── include
│ ├── aligner.h
│ ├── bias_adder_net.h
│ ├── blob.h
│ ├── bn_net.h
│ ├── common.h
│ ├── common_net.h
│ ├── conv_net.h
│ ├── eltwise_net.h
│ ├── face_identification.h
│ ├── hyper_param.h
│ ├── inner_product_net.h
│ ├── log.h
│ ├── math_functions.h
│ ├── max_pooling_net.h
│ ├── net.h
│ ├── net_factory.h
│ ├── pad_net.h
│ ├── recognizer.h
│ ├── spatial_transform_net.h
│ ├── tform_maker_net.h
│ └── viplnet.h
├── model
│ ├── seeta_fr_v1.0.part1.rar
│ └── seeta_fr_v1.0.part2.rar
├── src
│ ├── CMakeLists.txt
│ ├── bias_adder_net.cpp
│ ├── blob.cpp
│ ├── bn_net.cpp
│ ├── common_net.cpp
│ ├── conv_net.cpp
│ ├── eltwise_net.cpp
│ ├── inner_product_net.cpp
│ ├── log.cpp
│ ├── math_functions.cpp
│ ├── max_pooling_net.cpp
│ ├── net.cpp
│ ├── pad_net.cpp
│ ├── spatial_transform_net.cpp
│ ├── test
│ │ ├── CMakeLists.txt
│ │ ├── test_face_recognizer.cpp
│ │ └── test_face_verification.cpp
│ └── tform_maker_net.cpp
└── tools
│ ├── aligner.cpp
│ └── face_identification.cpp
├── LICENSE
├── README.md
└── SeetaFace_config.docx
/FaceAlignment/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.4)
2 |
3 | project(seeta_fa_lib)
4 |
5 | # Build options
6 | option(BUILD_EXAMPLES "Set to ON to build examples" ON)
7 |
8 | # Use C++11
9 | #set(CMAKE_CXX_STANDARD 11)
10 | #set(CMAKE_CXX_STANDARD_REQUIRED ON)
11 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
12 | message(STATUS "C++11 support has been enabled by default.")
13 |
14 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
15 |
16 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1")
17 |
18 | include_directories(include)
19 |
20 | set(src_files
21 | src/cfan.cpp
22 | src/face_alignment.cpp
23 | src/sift.cpp
24 | )
25 |
26 | add_library(seeta_fa_lib SHARED ${src_files})
27 | set(fa_required_libs seeta_fa_lib)
28 |
29 | if (BUILD_EXAMPLES)
30 | message(STATUS "Build with examples.")
31 | find_package(OpenCV)
32 | if (NOT OpenCV_FOUND)
33 | message(WARNING "OpenCV not found. Test will not be built.")
34 | else()
35 | include_directories(${OpenCV_INCLUDE_DIRS} build)
36 | link_directories(build)
37 | list(APPEND fa_required_libs ${OpenCV_LIBS} seeta_facedet_lib)
38 | add_executable(fa_test src/test/face_alignment_test.cpp)
39 | target_link_libraries(fa_test ${fa_required_libs})
40 | endif()
41 | endif()
42 |
--------------------------------------------------------------------------------
/FaceAlignment/data/image_0001.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seetaface/SeetaFaceEngine/6068307b9ddc7ec1c6130dbe3f85a170be760225/FaceAlignment/data/image_0001.png
--------------------------------------------------------------------------------
/FaceAlignment/doc/aflw_nrmse.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seetaface/SeetaFaceEngine/6068307b9ddc7ec1c6130dbe3f85a170be760225/FaceAlignment/doc/aflw_nrmse.png
--------------------------------------------------------------------------------
/FaceAlignment/examples/FaceAlignment/FaceAlignment.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 | Source Files
23 |
24 |
25 | Source Files
26 |
27 |
28 |
--------------------------------------------------------------------------------
/FaceAlignment/examples/examples.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.31101.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "examples", "examples\examples.vcxproj", "{1270EE26-839E-4881-8AA8-B08D359CC17F}"
7 | EndProject
8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FaceAlignment", "FaceAlignment\FaceAlignment.vcxproj", "{FAF101E7-0459-44D0-B59B-3DC55642B25C}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Win32 = Debug|Win32
13 | Debug|x64 = Debug|x64
14 | Release|Win32 = Release|Win32
15 | Release|x64 = Release|x64
16 | EndGlobalSection
17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
18 | {1270EE26-839E-4881-8AA8-B08D359CC17F}.Debug|Win32.ActiveCfg = Debug|Win32
19 | {1270EE26-839E-4881-8AA8-B08D359CC17F}.Debug|Win32.Build.0 = Debug|Win32
20 | {1270EE26-839E-4881-8AA8-B08D359CC17F}.Debug|x64.ActiveCfg = Debug|x64
21 | {1270EE26-839E-4881-8AA8-B08D359CC17F}.Debug|x64.Build.0 = Debug|x64
22 | {1270EE26-839E-4881-8AA8-B08D359CC17F}.Release|Win32.ActiveCfg = Release|Win32
23 | {1270EE26-839E-4881-8AA8-B08D359CC17F}.Release|Win32.Build.0 = Release|Win32
24 | {1270EE26-839E-4881-8AA8-B08D359CC17F}.Release|x64.ActiveCfg = Release|x64
25 | {1270EE26-839E-4881-8AA8-B08D359CC17F}.Release|x64.Build.0 = Release|x64
26 | {FAF101E7-0459-44D0-B59B-3DC55642B25C}.Debug|Win32.ActiveCfg = Debug|Win32
27 | {FAF101E7-0459-44D0-B59B-3DC55642B25C}.Debug|Win32.Build.0 = Debug|Win32
28 | {FAF101E7-0459-44D0-B59B-3DC55642B25C}.Debug|x64.ActiveCfg = Debug|x64
29 | {FAF101E7-0459-44D0-B59B-3DC55642B25C}.Debug|x64.Build.0 = Debug|x64
30 | {FAF101E7-0459-44D0-B59B-3DC55642B25C}.Release|Win32.ActiveCfg = Release|Win32
31 | {FAF101E7-0459-44D0-B59B-3DC55642B25C}.Release|Win32.Build.0 = Release|Win32
32 | {FAF101E7-0459-44D0-B59B-3DC55642B25C}.Release|x64.ActiveCfg = Release|x64
33 | {FAF101E7-0459-44D0-B59B-3DC55642B25C}.Release|x64.Build.0 = Release|x64
34 | EndGlobalSection
35 | GlobalSection(SolutionProperties) = preSolution
36 | HideSolutionNode = FALSE
37 | EndGlobalSection
38 | EndGlobal
39 |
--------------------------------------------------------------------------------
/FaceAlignment/examples/examples.v12.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seetaface/SeetaFaceEngine/6068307b9ddc7ec1c6130dbe3f85a170be760225/FaceAlignment/examples/examples.v12.suo
--------------------------------------------------------------------------------
/FaceAlignment/examples/examples/FaceDetection.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seetaface/SeetaFaceEngine/6068307b9ddc7ec1c6130dbe3f85a170be760225/FaceAlignment/examples/examples/FaceDetection.dll
--------------------------------------------------------------------------------
/FaceAlignment/examples/examples/FaceDetection.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seetaface/SeetaFaceEngine/6068307b9ddc7ec1c6130dbe3f85a170be760225/FaceAlignment/examples/examples/FaceDetection.lib
--------------------------------------------------------------------------------
/FaceAlignment/examples/examples/examples.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 |
--------------------------------------------------------------------------------
/FaceAlignment/examples/examples/examples.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/FaceAlignment/include/common.h:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This file is part of the open-source SeetaFace engine, which includes three modules:
4 | * SeetaFace Detection, SeetaFace Alignment, and SeetaFace Identification.
5 | *
6 | * This file is part of the SeetaFace Alignment module, containing codes implementing the
7 | * facial landmarks location method described in the following paper:
8 | *
9 | *
10 | * Coarse-to-Fine Auto-Encoder Networks (CFAN) for Real-Time Face Alignment,
11 | * Jie Zhang, Shiguang Shan, Meina Kan, Xilin Chen. In Proceeding of the
12 | * European Conference on Computer Vision (ECCV), 2014
13 | *
14 | *
15 | * Copyright (C) 2016, Visual Information Processing and Learning (VIPL) group,
16 | * Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China.
17 | *
18 | * The codes are mainly developed by Jie Zhang (a Ph.D supervised by Prof. Shiguang Shan)
19 | *
20 | * As an open-source face recognition engine: you can redistribute SeetaFace source codes
21 | * and/or modify it under the terms of the BSD 2-Clause License.
22 | *
23 | * You should have received a copy of the BSD 2-Clause License along with the software.
24 | * If not, see < https://opensource.org/licenses/BSD-2-Clause>.
25 | *
26 | * Contact Info: you can send an email to SeetaFace@vipl.ict.ac.cn for any problems.
27 | *
28 | * Note: the above information must be kept whenever or wherever the codes are used.
29 | *
30 | */
31 |
32 | #ifndef SEETA_COMMON_H_
33 | #define SEETA_COMMON_H_
34 |
35 | #include
36 |
37 | #if defined (_MSC_VER) || defined (_WIN32) || defined (_WIN64)
38 | #ifdef SEETA_EXPORTS
39 | #define SEETA_API __declspec(dllexport)
40 | #else
41 | #define SEETA_API __declspec(dllimport)
42 | #endif // SEETA_API
43 | #else // defined (windows)
44 | #define SEETA_API
45 | #endif
46 |
47 | #define DISABLE_COPY_AND_ASSIGN(classname) \
48 | private: \
49 | classname(const classname&); \
50 | classname& operator=(const classname&)
51 |
52 | #ifdef USE_OPENMP
53 | #include
54 |
55 | #define SEETA_NUM_THREADS 4
56 | #endif
57 |
58 | namespace seeta {
59 |
60 | typedef struct ImageData {
61 | ImageData() {
62 | data = nullptr;
63 | width = 0;
64 | height = 0;
65 | num_channels = 0;
66 | }
67 |
68 | ImageData(int32_t img_width, int32_t img_height,
69 | int32_t img_num_channels = 1) {
70 | data = nullptr;
71 | width = img_width;
72 | height = img_height;
73 | num_channels = img_num_channels;
74 | }
75 |
76 | uint8_t* data;
77 | int32_t width;
78 | int32_t height;
79 | int32_t num_channels;
80 | } ImageData;
81 |
82 | typedef struct Rect {
83 | int32_t x;
84 | int32_t y;
85 | int32_t width;
86 | int32_t height;
87 | } Rect;
88 |
89 | typedef struct FaceInfo {
90 | seeta::Rect bbox;
91 |
92 | double roll;
93 | double pitch;
94 | double yaw;
95 |
96 | double score; /**< Larger score should mean higher confidence. */
97 | } FaceInfo;
98 |
99 | typedef struct {
100 | double x;
101 | double y;
102 | } FacialLandmark;
103 | } // namespace seeta
104 |
105 | #endif // SEETA_COMMON_H_
106 |
107 |
--------------------------------------------------------------------------------
/FaceAlignment/include/face_alignment.h:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This file is part of the open-source SeetaFace engine, which includes three modules:
4 | * SeetaFace Detection, SeetaFace Alignment, and SeetaFace Identification.
5 | *
6 | * This file is part of the SeetaFace Alignment module, containing codes implementing the
7 | * facial landmarks location method described in the following paper:
8 | *
9 | *
10 | * Coarse-to-Fine Auto-Encoder Networks (CFAN) for Real-Time Face Alignment,
11 | * Jie Zhang, Shiguang Shan, Meina Kan, Xilin Chen. In Proceeding of the
12 | * European Conference on Computer Vision (ECCV), 2014
13 | *
14 | *
15 | * Copyright (C) 2016, Visual Information Processing and Learning (VIPL) group,
16 | * Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China.
17 | *
18 | * The codes are mainly developed by Jie Zhang (a Ph.D supervised by Prof. Shiguang Shan)
19 | *
20 | * As an open-source face recognition engine: you can redistribute SeetaFace source codes
21 | * and/or modify it under the terms of the BSD 2-Clause License.
22 | *
23 | * You should have received a copy of the BSD 2-Clause License along with the software.
24 | * If not, see < https://opensource.org/licenses/BSD-2-Clause>.
25 | *
26 | * Contact Info: you can send an email to SeetaFace@vipl.ict.ac.cn for any problems.
27 | *
28 | * Note: the above information must be kept whenever or wherever the codes are used.
29 | *
30 | */
31 |
32 | #ifndef SEETA_FACE_ALIGNMENT_H_
33 | #define SEETA_FACE_ALIGNMENT_H_
34 |
35 | #include
36 | #include "common.h"
37 | class CCFAN;
38 |
39 | namespace seeta {
40 | class FaceAlignment{
41 | public:
42 | /** A constructor with an optional argument specifying path of the model file.
43 | * If called with no argument, the model file is assumed to be stored in the
44 | * the working directory as "seeta_fa_v1.1.bin".
45 | *
46 | * @param model_path Path of the model file, either absolute or relative to
47 | * the working directory.
48 | */
49 | SEETA_API FaceAlignment(const char* model_path = NULL);
50 |
51 | /** A Destructor which should never be called explicitly.
52 | * Release all dynamically allocated resources.
53 | */
54 | SEETA_API ~FaceAlignment();
55 |
56 | /** Detect five facial landmarks, i.e., two eye centers, nose tip and two mouth corners.
57 | * @param gray_im A grayscale image
58 | * @param face_info The face bounding box
59 | * @param[out] points The locations of detected facial points
60 | */
61 | SEETA_API bool PointDetectLandmarks(ImageData gray_im, FaceInfo face_info, FacialLandmark *points);
62 |
63 | private:
64 | CCFAN *facial_detector;
65 | };
66 | } // namespace seeta
67 |
68 | #endif
69 |
--------------------------------------------------------------------------------
/FaceAlignment/model/seeta_fa_v1.1.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seetaface/SeetaFaceEngine/6068307b9ddc7ec1c6130dbe3f85a170be760225/FaceAlignment/model/seeta_fa_v1.1.bin
--------------------------------------------------------------------------------
/FaceAlignment/src/face_alignment.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This file is part of the open-source SeetaFace engine, which includes three modules:
4 | * SeetaFace Detection, SeetaFace Alignment, and SeetaFace Identification.
5 | *
6 | * This file is part of the SeetaFace Alignment module, containing codes implementing the
7 | * facial landmarks location method described in the following paper:
8 | *
9 | *
10 | * Coarse-to-Fine Auto-Encoder Networks (CFAN) for Real-Time Face Alignment,
11 | * Jie Zhang, Shiguang Shan, Meina Kan, Xilin Chen. In Proceeding of the
12 | * European Conference on Computer Vision (ECCV), 2014
13 | *
14 | *
15 | * Copyright (C) 2016, Visual Information Processing and Learning (VIPL) group,
16 | * Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China.
17 | *
18 | * The codes are mainly developed by Jie Zhang (a Ph.D supervised by Prof. Shiguang Shan)
19 | *
20 | * As an open-source face recognition engine: you can redistribute SeetaFace source codes
21 | * and/or modify it under the terms of the BSD 2-Clause License.
22 | *
23 | * You should have received a copy of the BSD 2-Clause License along with the software.
24 | * If not, see < https://opensource.org/licenses/BSD-2-Clause>.
25 | *
26 | * Contact Info: you can send an email to SeetaFace@vipl.ict.ac.cn for any problems.
27 | *
28 | * Note: the above information must be kept whenever or wherever the codes are used.
29 | *
30 | */
31 |
32 | #include "face_alignment.h"
33 |
34 | #include
35 | #include
36 | #include "cfan.h"
37 |
38 | namespace seeta {
39 | /** A constructor with an optional argument specifying path of the model file.
40 | * If called with no argument, the model file is assumed to be stored in the
41 | * the working directory as "seeta_fa_v1.1.bin".
42 | *
43 | * @param model_path Path of the model file, either absolute or relative to
44 | * the working directory.
45 | */
46 | FaceAlignment::FaceAlignment(const char * model_path){
47 | facial_detector = new CCFAN();
48 | if (model_path == NULL)
49 | model_path = "seeta_fa_v1.1.bin";
50 | facial_detector->InitModel(model_path);
51 | }
52 |
53 | /** Detect five facial landmarks, i.e., two eye centers, nose tip and two mouth corners.
54 | * @param gray_im A grayscale image
55 | * @param face_info The face bounding box
56 | * @param[out] points The locations of detected facial points
57 | */
58 | bool FaceAlignment::PointDetectLandmarks(ImageData gray_im, FaceInfo face_info, FacialLandmark *points)
59 | {
60 | if (gray_im.num_channels != 1) {
61 | return false;
62 | }
63 | int pts_num = 5;
64 | float *facial_loc = new float[pts_num * 2];
65 | facial_detector->FacialPointLocate(gray_im.data, gray_im.width, gray_im.height, face_info, facial_loc);
66 |
67 | for (int i = 0; i < pts_num; i++) {
68 | points[i].x = facial_loc[i * 2];
69 | points[i].y = facial_loc[i * 2 + 1];
70 | }
71 |
72 | delete[]facial_loc;
73 | return true;
74 | }
75 |
76 | /** A Destructor which should never be called explicitly.
77 | * Release all dynamically allocated resources.
78 | */
79 | FaceAlignment::~FaceAlignment() {
80 | if (facial_detector != NULL) {
81 | delete facial_detector;
82 | facial_detector = NULL;
83 | }
84 | }
85 | } // namespace seeta
86 |
--------------------------------------------------------------------------------
/FaceDetection/.gitignore:
--------------------------------------------------------------------------------
1 | build/
2 |
--------------------------------------------------------------------------------
/FaceDetection/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.1.0)
2 |
3 | project(seeta_facedet_lib)
4 |
5 | # Build options
6 | option(BUILD_EXAMPLES "Set to ON to build examples" ON)
7 | option(USE_OPENMP "Set to ON to build use openmp" ON)
8 | option(USE_SSE "Set to ON to build use SSE" ON)
9 |
10 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
11 |
12 | # Use C++11
13 | set(CMAKE_CXX_STANDARD 11)
14 | set(CMAKE_CXX_STANDARD_REQUIRED ON)
15 | message(STATUS "C++11 support has been enabled by default.")
16 |
17 | # Use SSE
18 | if (USE_SSE)
19 | add_definitions(-DUSE_SSE)
20 | message(STATUS "Use SSE")
21 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1")
22 | endif()
23 |
24 | # Use OpenMP
25 | if (USE_OPENMP)
26 | find_package(OpenMP QUIET)
27 | if (OPENMP_FOUND)
28 | message(STATUS "Use OpenMP")
29 | add_definitions(-DUSE_OPENMP)
30 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
31 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
32 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
33 | endif()
34 | endif()
35 |
36 | include_directories(include)
37 |
38 | set(src_files
39 | src/util/nms.cpp
40 | src/util/image_pyramid.cpp
41 | src/io/lab_boost_model_reader.cpp
42 | src/io/surf_mlp_model_reader.cpp
43 | src/feat/lab_feature_map.cpp
44 | src/feat/surf_feature_map.cpp
45 | src/classifier/lab_boosted_classifier.cpp
46 | src/classifier/mlp.cpp
47 | src/classifier/surf_mlp.cpp
48 | src/face_detection.cpp
49 | src/fust.cpp
50 | )
51 |
52 | # Build shared library
53 | add_library(seeta_facedet_lib SHARED ${src_files})
54 | set(facedet_required_libs seeta_facedet_lib)
55 |
56 | # Build examples
57 | if (BUILD_EXAMPLES)
58 | message(STATUS "Build with examples.")
59 | find_package(OpenCV)
60 | if (NOT OpenCV_FOUND)
61 | message(WARNING "OpenCV not found. Test will not be built.")
62 | else()
63 | include_directories(${OpenCV_INCLUDE_DIRS})
64 | list(APPEND facedet_required_libs ${OpenCV_LIBS})
65 |
66 | add_executable(facedet_test src/test/facedetection_test.cpp)
67 | target_link_libraries(facedet_test ${facedet_required_libs})
68 | endif()
69 | endif()
70 |
--------------------------------------------------------------------------------
/FaceDetection/data/0_1_1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seetaface/SeetaFaceEngine/6068307b9ddc7ec1c6130dbe3f85a170be760225/FaceDetection/data/0_1_1.jpg
--------------------------------------------------------------------------------
/FaceDetection/doc/fddb_roc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seetaface/SeetaFaceEngine/6068307b9ddc7ec1c6130dbe3f85a170be760225/FaceDetection/doc/fddb_roc.png
--------------------------------------------------------------------------------
/FaceDetection/examples/FaceDetection/FaceDetection.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 | Source Files
23 |
24 |
25 | Source Files
26 |
27 |
28 | Source Files
29 |
30 |
31 | Source Files
32 |
33 |
34 | Source Files
35 |
36 |
37 | Source Files
38 |
39 |
40 | Source Files
41 |
42 |
43 | Source Files
44 |
45 |
46 | Source Files
47 |
48 |
49 | Source Files
50 |
51 |
52 |
--------------------------------------------------------------------------------
/FaceDetection/examples/examples.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.31101.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FaceDetection", "FaceDetection\FaceDetection.vcxproj", "{9A085B45-3F55-41CF-94CB-274C37584BA0}"
7 | EndProject
8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "examples", "examples\examples.vcxproj", "{DAAEFCB0-44DA-49B8-B666-91603E744600}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Mixed Platforms = Debug|Mixed Platforms
13 | Debug|Win32 = Debug|Win32
14 | Debug|x64 = Debug|x64
15 | Release|Mixed Platforms = Release|Mixed Platforms
16 | Release|Win32 = Release|Win32
17 | Release|x64 = Release|x64
18 | EndGlobalSection
19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
20 | {9A085B45-3F55-41CF-94CB-274C37584BA0}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
21 | {9A085B45-3F55-41CF-94CB-274C37584BA0}.Debug|Mixed Platforms.Build.0 = Debug|Win32
22 | {9A085B45-3F55-41CF-94CB-274C37584BA0}.Debug|Win32.ActiveCfg = Debug|x64
23 | {9A085B45-3F55-41CF-94CB-274C37584BA0}.Debug|Win32.Build.0 = Debug|x64
24 | {9A085B45-3F55-41CF-94CB-274C37584BA0}.Debug|x64.ActiveCfg = Debug|x64
25 | {9A085B45-3F55-41CF-94CB-274C37584BA0}.Debug|x64.Build.0 = Debug|x64
26 | {9A085B45-3F55-41CF-94CB-274C37584BA0}.Release|Mixed Platforms.ActiveCfg = Release|Win32
27 | {9A085B45-3F55-41CF-94CB-274C37584BA0}.Release|Mixed Platforms.Build.0 = Release|Win32
28 | {9A085B45-3F55-41CF-94CB-274C37584BA0}.Release|Win32.ActiveCfg = Release|Win32
29 | {9A085B45-3F55-41CF-94CB-274C37584BA0}.Release|Win32.Build.0 = Release|Win32
30 | {9A085B45-3F55-41CF-94CB-274C37584BA0}.Release|x64.ActiveCfg = Release|x64
31 | {9A085B45-3F55-41CF-94CB-274C37584BA0}.Release|x64.Build.0 = Release|x64
32 | {DAAEFCB0-44DA-49B8-B666-91603E744600}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
33 | {DAAEFCB0-44DA-49B8-B666-91603E744600}.Debug|Mixed Platforms.Build.0 = Debug|Win32
34 | {DAAEFCB0-44DA-49B8-B666-91603E744600}.Debug|Win32.ActiveCfg = Debug|Win32
35 | {DAAEFCB0-44DA-49B8-B666-91603E744600}.Debug|Win32.Build.0 = Debug|Win32
36 | {DAAEFCB0-44DA-49B8-B666-91603E744600}.Debug|x64.ActiveCfg = Debug|x64
37 | {DAAEFCB0-44DA-49B8-B666-91603E744600}.Debug|x64.Build.0 = Debug|x64
38 | {DAAEFCB0-44DA-49B8-B666-91603E744600}.Release|Mixed Platforms.ActiveCfg = Release|Win32
39 | {DAAEFCB0-44DA-49B8-B666-91603E744600}.Release|Mixed Platforms.Build.0 = Release|Win32
40 | {DAAEFCB0-44DA-49B8-B666-91603E744600}.Release|Win32.ActiveCfg = Release|Win32
41 | {DAAEFCB0-44DA-49B8-B666-91603E744600}.Release|Win32.Build.0 = Release|Win32
42 | {DAAEFCB0-44DA-49B8-B666-91603E744600}.Release|x64.ActiveCfg = Release|x64
43 | {DAAEFCB0-44DA-49B8-B666-91603E744600}.Release|x64.Build.0 = Release|x64
44 | EndGlobalSection
45 | GlobalSection(SolutionProperties) = preSolution
46 | HideSolutionNode = FALSE
47 | EndGlobalSection
48 | EndGlobal
49 |
--------------------------------------------------------------------------------
/FaceDetection/examples/examples.v12.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seetaface/SeetaFaceEngine/6068307b9ddc7ec1c6130dbe3f85a170be760225/FaceDetection/examples/examples.v12.suo
--------------------------------------------------------------------------------
/FaceDetection/examples/examples/examples.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 |
--------------------------------------------------------------------------------
/FaceDetection/examples/examples/examples.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ..\..\data\0_1_1.jpg ..\..\model\seeta_fd_frontal_v1.0.bin
5 | WindowsLocalDebugger
6 |
7 |
8 | ..\..\data\0_1_1.jpg ..\..\model\seeta_fd_frontal_v1.0.bin
9 | WindowsLocalDebugger
10 |
11 |
--------------------------------------------------------------------------------
/FaceDetection/include/classifier.h:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This file is part of the open-source SeetaFace engine, which includes three modules:
4 | * SeetaFace Detection, SeetaFace Alignment, and SeetaFace Identification.
5 | *
6 | * This file is part of the SeetaFace Detection module, containing codes implementing the
7 | * face detection method described in the following paper:
8 | *
9 | *
10 | * Funnel-structured cascade for multi-view face detection with alignment awareness,
11 | * Shuzhe Wu, Meina Kan, Zhenliang He, Shiguang Shan, Xilin Chen.
12 | * In Neurocomputing (under review)
13 | *
14 | *
15 | * Copyright (C) 2016, Visual Information Processing and Learning (VIPL) group,
16 | * Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China.
17 | *
18 | * The codes are mainly developed by Shuzhe Wu (a Ph.D supervised by Prof. Shiguang Shan)
19 | *
20 | * As an open-source face recognition engine: you can redistribute SeetaFace source codes
21 | * and/or modify it under the terms of the BSD 2-Clause License.
22 | *
23 | * You should have received a copy of the BSD 2-Clause License along with the software.
24 | * If not, see < https://opensource.org/licenses/BSD-2-Clause>.
25 | *
26 | * Contact Info: you can send an email to SeetaFace@vipl.ict.ac.cn for any problems.
27 | *
28 | * Note: the above information must be kept whenever or wherever the codes are used.
29 | *
30 | */
31 |
32 | #ifndef SEETA_FD_CLASSIFIER_H_
33 | #define SEETA_FD_CLASSIFIER_H_
34 |
35 | #include "common.h"
36 | #include "feature_map.h"
37 |
38 | namespace seeta {
39 | namespace fd {
40 |
41 | enum ClassifierType {
42 | LAB_Boosted_Classifier,
43 | SURF_MLP
44 | };
45 |
46 | class Classifier {
47 | public:
48 | Classifier() {}
49 | virtual ~Classifier() {}
50 |
51 | virtual void SetFeatureMap(seeta::fd::FeatureMap* feat_map) = 0;
52 | virtual bool Classify(float* score = nullptr, float* outputs = nullptr) = 0;
53 |
54 | virtual seeta::fd::ClassifierType type() = 0;
55 |
56 | DISABLE_COPY_AND_ASSIGN(Classifier);
57 | };
58 |
59 | } // namespace fd
60 | } // namespace seeta
61 |
62 | #endif // SEETA_FD_CLASSIFIER_H_
63 |
--------------------------------------------------------------------------------
/FaceDetection/include/classifier/lab_boosted_classifier.h:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This file is part of the open-source SeetaFace engine, which includes three modules:
4 | * SeetaFace Detection, SeetaFace Alignment, and SeetaFace Identification.
5 | *
6 | * This file is part of the SeetaFace Detection module, containing codes implementing the
7 | * face detection method described in the following paper:
8 | *
9 | *
10 | * Funnel-structured cascade for multi-view face detection with alignment awareness,
11 | * Shuzhe Wu, Meina Kan, Zhenliang He, Shiguang Shan, Xilin Chen.
12 | * In Neurocomputing (under review)
13 | *
14 | *
15 | * Copyright (C) 2016, Visual Information Processing and Learning (VIPL) group,
16 | * Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China.
17 | *
18 | * The codes are mainly developed by Shuzhe Wu (a Ph.D supervised by Prof. Shiguang Shan)
19 | *
20 | * As an open-source face recognition engine: you can redistribute SeetaFace source codes
21 | * and/or modify it under the terms of the BSD 2-Clause License.
22 | *
23 | * You should have received a copy of the BSD 2-Clause License along with the software.
24 | * If not, see < https://opensource.org/licenses/BSD-2-Clause>.
25 | *
26 | * Contact Info: you can send an email to SeetaFace@vipl.ict.ac.cn for any problems.
27 | *
28 | * Note: the above information must be kept whenever or wherever the codes are used.
29 | *
30 | */
31 |
32 | #ifndef SEETA_FD_CLASSIFIER_LAB_BOOSTED_CLASSIFIER_H_
33 | #define SEETA_FD_CLASSIFIER_LAB_BOOSTED_CLASSIFIER_H_
34 |
35 | #include
36 | #include
37 | #include
38 | #include
39 |
40 | #include "classifier.h"
41 | #include "feat/lab_feature_map.h"
42 |
43 | namespace seeta {
44 | namespace fd {
45 |
46 | /**
47 | * @class LABBaseClassifier
48 | * @brief Base classifier using LAB feature.
49 | */
50 | class LABBaseClassifier {
51 | public:
52 | LABBaseClassifier()
53 | : num_bin_(255), thresh_(0.0f) {
54 | weights_.resize(num_bin_ + 1);
55 | }
56 |
57 | ~LABBaseClassifier() {}
58 |
59 | void SetWeights(const float* weights, int32_t num_bin);
60 |
61 | inline void SetThreshold(float thresh) { thresh_ = thresh; }
62 |
63 | inline int32_t num_bin() const { return num_bin_; }
64 | inline float weights(int32_t val) const { return weights_[val]; }
65 | inline float threshold() const { return thresh_; }
66 |
67 | private:
68 | int32_t num_bin_;
69 |
70 | std::vector weights_;
71 | float thresh_;
72 | };
73 |
74 | /**
75 | * @class LABBoostedClassifier
76 | * @Brief A strong classifier constructed from base classifiers using LAB features.
77 | */
78 | class LABBoostedClassifier : public Classifier {
79 | public:
80 | LABBoostedClassifier() : use_std_dev_(true) {}
81 | virtual ~LABBoostedClassifier() {}
82 |
83 | virtual bool Classify(float* score = nullptr, float* outputs = nullptr);
84 |
85 | inline virtual seeta::fd::ClassifierType type() {
86 | return seeta::fd::ClassifierType::LAB_Boosted_Classifier;
87 | }
88 |
89 | void AddFeature(int32_t x, int32_t y);
90 | void AddBaseClassifier(const float* weights, int32_t num_bin, float thresh);
91 |
92 | inline virtual void SetFeatureMap(seeta::fd::FeatureMap* featMap) {
93 | feat_map_ = dynamic_cast(featMap);
94 | }
95 |
96 | inline void SetUseStdDev(bool useStdDev) { use_std_dev_ = useStdDev; }
97 |
98 | private:
99 | static const int32_t kFeatGroupSize = 10;
100 | const float kStdDevThresh = 10.0f;
101 |
102 | std::vector feat_;
103 | std::vector > base_classifiers_;
104 | seeta::fd::LABFeatureMap* feat_map_;
105 | bool use_std_dev_;
106 | };
107 |
108 | } // namespace fd
109 | } // namespace seeta
110 |
111 | #endif // SEETA_FD_CLASSIFIER_LAB_BOOSTED_CLASSIFIER_H_
112 |
--------------------------------------------------------------------------------
/FaceDetection/include/classifier/surf_mlp.h:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This file is part of the open-source SeetaFace engine, which includes three modules:
4 | * SeetaFace Detection, SeetaFace Alignment, and SeetaFace Identification.
5 | *
6 | * This file is part of the SeetaFace Detection module, containing codes implementing the
7 | * face detection method described in the following paper:
8 | *
9 | *
10 | * Funnel-structured cascade for multi-view face detection with alignment awareness,
11 | * Shuzhe Wu, Meina Kan, Zhenliang He, Shiguang Shan, Xilin Chen.
12 | * In Neurocomputing (under review)
13 | *
14 | *
15 | * Copyright (C) 2016, Visual Information Processing and Learning (VIPL) group,
16 | * Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China.
17 | *
18 | * The codes are mainly developed by Shuzhe Wu (a Ph.D supervised by Prof. Shiguang Shan)
19 | *
20 | * As an open-source face recognition engine: you can redistribute SeetaFace source codes
21 | * and/or modify it under the terms of the BSD 2-Clause License.
22 | *
23 | * You should have received a copy of the BSD 2-Clause License along with the software.
24 | * If not, see < https://opensource.org/licenses/BSD-2-Clause>.
25 | *
26 | * Contact Info: you can send an email to SeetaFace@vipl.ict.ac.cn for any problems.
27 | *
28 | * Note: the above information must be kept whenever or wherever the codes are used.
29 | *
30 | */
31 |
32 | #ifndef SEETA_FD_CLASSIFIER_SURF_MLP_H_
33 | #define SEETA_FD_CLASSIFIER_SURF_MLP_H_
34 |
35 | #include
36 | #include
37 |
38 | #include "classifier.h"
39 | #include "classifier/mlp.h"
40 | #include "feat/surf_feature_map.h"
41 |
42 | namespace seeta {
43 | namespace fd {
44 |
45 | class SURFMLP : public Classifier {
46 | public:
47 | SURFMLP() : Classifier(), model_(new seeta::fd::MLP()) {}
48 | virtual ~SURFMLP() {}
49 |
50 | virtual bool Classify(float* score = nullptr, float* outputs = nullptr);
51 |
52 | inline virtual void SetFeatureMap(seeta::fd::FeatureMap* feat_map) {
53 | feat_map_ = dynamic_cast(feat_map);
54 | }
55 |
56 | inline virtual seeta::fd::ClassifierType type() {
57 | return seeta::fd::ClassifierType::SURF_MLP;
58 | }
59 |
60 | void AddFeatureByID(int32_t feat_id);
61 | void AddLayer(int32_t input_dim, int32_t output_dim, const float* weights,
62 | const float* bias, bool is_output = false);
63 |
64 | inline void SetThreshold(float thresh) { thresh_ = thresh; }
65 |
66 | private:
67 | std::vector feat_id_;
68 | std::vector input_buf_;
69 | std::vector output_buf_;
70 |
71 | std::shared_ptr model_;
72 | float thresh_;
73 | seeta::fd::SURFFeatureMap* feat_map_;
74 | };
75 |
76 | } // namespace fd
77 | } // namespace seeta
78 |
79 | #endif // SEETA_FD_CLASSIFIER_SURF_MLP_H_
80 |
--------------------------------------------------------------------------------
/FaceDetection/include/common.h:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This file is part of the open-source SeetaFace engine, which includes three modules:
4 | * SeetaFace Detection, SeetaFace Alignment, and SeetaFace Identification.
5 | *
6 | * This file is part of the SeetaFace Detection module, containing codes implementing the
7 | * face detection method described in the following paper:
8 | *
9 | *
10 | * Funnel-structured cascade for multi-view face detection with alignment awareness,
11 | * Shuzhe Wu, Meina Kan, Zhenliang He, Shiguang Shan, Xilin Chen.
12 | * In Neurocomputing (under review)
13 | *
14 | *
15 | * Copyright (C) 2016, Visual Information Processing and Learning (VIPL) group,
16 | * Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China.
17 | *
18 | * The codes are mainly developed by Shuzhe Wu (a Ph.D supervised by Prof. Shiguang Shan)
19 | *
20 | * As an open-source face recognition engine: you can redistribute SeetaFace source codes
21 | * and/or modify it under the terms of the BSD 2-Clause License.
22 | *
23 | * You should have received a copy of the BSD 2-Clause License along with the software.
24 | * If not, see < https://opensource.org/licenses/BSD-2-Clause>.
25 | *
26 | * Contact Info: you can send an email to SeetaFace@vipl.ict.ac.cn for any problems.
27 | *
28 | * Note: the above information must be kept whenever or wherever the codes are used.
29 | *
30 | */
31 |
32 | #ifndef SEETA_COMMON_H_
33 | #define SEETA_COMMON_H_
34 |
35 | #include
36 |
37 | #if defined _WIN32
38 | #ifdef SEETA_EXPORTS
39 | #define SEETA_API __declspec(dllexport)
40 | #else
41 | #define SEETA_API __declspec(dllimport)
42 | #endif
43 |
44 | #else
45 | #define SEETA_API
46 | #endif
47 |
48 | #define DISABLE_COPY_AND_ASSIGN(classname) \
49 | private: \
50 | classname(const classname&); \
51 | classname& operator=(const classname&)
52 |
53 | #ifdef USE_OPENMP
54 | #include
55 |
56 | #define SEETA_NUM_THREADS 4
57 | #endif
58 |
59 | namespace seeta {
60 |
61 | typedef struct ImageData {
62 | ImageData() {
63 | data = nullptr;
64 | width = 0;
65 | height = 0;
66 | num_channels = 0;
67 | }
68 |
69 | ImageData(int32_t img_width, int32_t img_height,
70 | int32_t img_num_channels = 1) {
71 | data = nullptr;
72 | width = img_width;
73 | height = img_height;
74 | num_channels = img_num_channels;
75 | }
76 |
77 | uint8_t* data;
78 | int32_t width;
79 | int32_t height;
80 | int32_t num_channels;
81 | } ImageData;
82 |
83 | typedef struct Rect {
84 | int32_t x;
85 | int32_t y;
86 | int32_t width;
87 | int32_t height;
88 | } Rect;
89 |
90 | typedef struct FaceInfo {
91 | seeta::Rect bbox;
92 |
93 | double roll;
94 | double pitch;
95 | double yaw;
96 |
97 | double score; /**< Larger score should mean higher confidence. */
98 | } FaceInfo;
99 |
100 | typedef struct {
101 | double x;
102 | double y;
103 | } FacialLandmark;
104 | } // namespace seeta
105 |
106 | #endif // SEETA_COMMON_H_
107 |
--------------------------------------------------------------------------------
/FaceDetection/include/detector.h:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This file is part of the open-source SeetaFace engine, which includes three modules:
4 | * SeetaFace Detection, SeetaFace Alignment, and SeetaFace Identification.
5 | *
6 | * This file is part of the SeetaFace Detection module, containing codes implementing the
7 | * face detection method described in the following paper:
8 | *
9 | *
10 | * Funnel-structured cascade for multi-view face detection with alignment awareness,
11 | * Shuzhe Wu, Meina Kan, Zhenliang He, Shiguang Shan, Xilin Chen.
12 | * In Neurocomputing (under review)
13 | *
14 | *
15 | * Copyright (C) 2016, Visual Information Processing and Learning (VIPL) group,
16 | * Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China.
17 | *
18 | * The codes are mainly developed by Shuzhe Wu (a Ph.D supervised by Prof. Shiguang Shan)
19 | *
20 | * As an open-source face recognition engine: you can redistribute SeetaFace source codes
21 | * and/or modify it under the terms of the BSD 2-Clause License.
22 | *
23 | * You should have received a copy of the BSD 2-Clause License along with the software.
24 | * If not, see < https://opensource.org/licenses/BSD-2-Clause>.
25 | *
26 | * Contact Info: you can send an email to SeetaFace@vipl.ict.ac.cn for any problems.
27 | *
28 | * Note: the above information must be kept whenever or wherever the codes are used.
29 | *
30 | */
31 |
32 | #ifndef SEETA_FD_DETECTOR_H_
33 | #define SEETA_FD_DETECTOR_H_
34 |
35 | #include
36 | #include
37 | #include
38 |
39 | #include "common.h"
40 | #include "util/image_pyramid.h"
41 |
42 | namespace seeta {
43 | namespace fd {
44 |
45 | class Detector {
46 | public:
47 | Detector() {}
48 | virtual ~Detector() {}
49 |
50 | virtual bool LoadModel(const std::string & model_path) = 0;
51 | virtual std::vector Detect(seeta::fd::ImagePyramid* img_pyramid) = 0;
52 |
53 | virtual void SetWindowSize(int32_t size) {}
54 | virtual void SetSlideWindowStep(int32_t step_x, int32_t step_y) {}
55 |
56 | DISABLE_COPY_AND_ASSIGN(Detector);
57 | };
58 |
59 | } // namespace fd
60 | } // namespace seeta
61 |
62 | #endif // SEETA_FD_DETECTOR_H_
63 |
--------------------------------------------------------------------------------
/FaceDetection/include/feat/lab_feature_map.h:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This file is part of the open-source SeetaFace engine, which includes three modules:
4 | * SeetaFace Detection, SeetaFace Alignment, and SeetaFace Identification.
5 | *
6 | * This file is part of the SeetaFace Detection module, containing codes implementing the
7 | * face detection method described in the following paper:
8 | *
9 | *
10 | * Funnel-structured cascade for multi-view face detection with alignment awareness,
11 | * Shuzhe Wu, Meina Kan, Zhenliang He, Shiguang Shan, Xilin Chen.
12 | * In Neurocomputing (under review)
13 | *
14 | *
15 | * Copyright (C) 2016, Visual Information Processing and Learning (VIPL) group,
16 | * Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China.
17 | *
18 | * The codes are mainly developed by Shuzhe Wu (a Ph.D supervised by Prof. Shiguang Shan)
19 | *
20 | * As an open-source face recognition engine: you can redistribute SeetaFace source codes
21 | * and/or modify it under the terms of the BSD 2-Clause License.
22 | *
23 | * You should have received a copy of the BSD 2-Clause License along with the software.
24 | * If not, see < https://opensource.org/licenses/BSD-2-Clause>.
25 | *
26 | * Contact Info: you can send an email to SeetaFace@vipl.ict.ac.cn for any problems.
27 | *
28 | * Note: the above information must be kept whenever or wherever the codes are used.
29 | *
30 | */
31 |
32 | #ifndef SEETA_FD_FEAT_LAB_FEATURE_MAP_H_
33 | #define SEETA_FD_FEAT_LAB_FEATURE_MAP_H_
34 |
35 | #include
36 |
37 | #include "feature_map.h"
38 |
39 | namespace seeta {
40 | namespace fd {
41 |
42 | /** @struct LABFeature
43 | * @brief Locally Assembled Binary (LAB) feature.
44 | *
45 | * It is parameterized by the coordinates of top left corner.
46 | */
47 | typedef struct LABFeature {
48 | int32_t x;
49 | int32_t y;
50 | } LABFeature;
51 |
52 | class LABFeatureMap : public seeta::fd::FeatureMap {
53 | public:
54 | LABFeatureMap() : rect_width_(3), rect_height_(3), num_rect_(3) {}
55 | virtual ~LABFeatureMap() {}
56 |
57 | virtual void Compute(const uint8_t* input, int32_t width, int32_t height);
58 |
59 | inline uint8_t GetFeatureVal(int32_t offset_x, int32_t offset_y) const {
60 | return feat_map_[(roi_.y + offset_y) * width_ + roi_.x + offset_x];
61 | }
62 |
63 | float GetStdDev() const;
64 |
65 | private:
66 | void Reshape(int32_t width, int32_t height);
67 | void ComputeIntegralImages(const uint8_t* input);
68 | void ComputeRectSum();
69 | void ComputeFeatureMap();
70 |
71 | template
72 | inline void Integral(Int32Type* data) {
73 | const Int32Type* src = data;
74 | Int32Type* dest = data;
75 | const Int32Type* dest_above = dest;
76 |
77 | *dest = *(src++);
78 | for (int32_t c = 1; c < width_; c++, src++, dest++)
79 | *(dest + 1) = (*dest) + (*src);
80 | dest++;
81 | for (int32_t r = 1; r < height_; r++) {
82 | for (int32_t c = 0, s = 0; c < width_; c++, src++, dest++, dest_above++) {
83 | s += (*src);
84 | *dest = *dest_above + s;
85 | }
86 | }
87 | }
88 |
89 | const int32_t rect_width_;
90 | const int32_t rect_height_;
91 | const int32_t num_rect_;
92 |
93 | std::vector feat_map_;
94 | std::vector rect_sum_;
95 | std::vector int_img_;
96 | std::vector square_int_img_;
97 | };
98 |
99 | } // namespace fd
100 | } // namespace seeta
101 |
102 | #endif // SEETA_FD_FEAT_LAB_FEATURE_MAP_H_
103 |
--------------------------------------------------------------------------------
/FaceDetection/include/feature_map.h:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This file is part of the open-source SeetaFace engine, which includes three modules:
4 | * SeetaFace Detection, SeetaFace Alignment, and SeetaFace Identification.
5 | *
6 | * This file is part of the SeetaFace Detection module, containing codes implementing the
7 | * face detection method described in the following paper:
8 | *
9 | *
10 | * Funnel-structured cascade for multi-view face detection with alignment awareness,
11 | * Shuzhe Wu, Meina Kan, Zhenliang He, Shiguang Shan, Xilin Chen.
12 | * In Neurocomputing (under review)
13 | *
14 | *
15 | * Copyright (C) 2016, Visual Information Processing and Learning (VIPL) group,
16 | * Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China.
17 | *
18 | * The codes are mainly developed by Shuzhe Wu (a Ph.D supervised by Prof. Shiguang Shan)
19 | *
20 | * As an open-source face recognition engine: you can redistribute SeetaFace source codes
21 | * and/or modify it under the terms of the BSD 2-Clause License.
22 | *
23 | * You should have received a copy of the BSD 2-Clause License along with the software.
24 | * If not, see < https://opensource.org/licenses/BSD-2-Clause>.
25 | *
26 | * Contact Info: you can send an email to SeetaFace@vipl.ict.ac.cn for any problems.
27 | *
28 | * Note: the above information must be kept whenever or wherever the codes are used.
29 | *
30 | */
31 |
32 | #ifndef SEETA_FD_FEATURE_MAP_H_
33 | #define SEETA_FD_FEATURE_MAP_H_
34 |
35 | #include "common.h"
36 |
37 | namespace seeta {
38 | namespace fd {
39 |
40 | class FeatureMap {
41 | public:
42 | FeatureMap()
43 | : width_(0), height_(0) {
44 | roi_.x = 0;
45 | roi_.y = 0;
46 | roi_.width = 0;
47 | roi_.height = 0;
48 | }
49 |
50 | virtual ~FeatureMap() {}
51 |
52 | virtual void Compute(const uint8_t* input, int32_t width, int32_t height) = 0;
53 |
54 | inline virtual void SetROI(const seeta::Rect & roi) {
55 | roi_ = roi;
56 | }
57 |
58 | protected:
59 | int32_t width_;
60 | int32_t height_;
61 |
62 | seeta::Rect roi_;
63 | };
64 |
65 | } // namespace fd
66 | } // namespace seeta
67 |
68 | #endif // SEETA_FD_FEATURE_MAP_H_
69 |
--------------------------------------------------------------------------------
/FaceDetection/include/fust.h:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This file is part of the open-source SeetaFace engine, which includes three modules:
4 | * SeetaFace Detection, SeetaFace Alignment, and SeetaFace Identification.
5 | *
6 | * This file is part of the SeetaFace Detection module, containing codes implementing the
7 | * face detection method described in the following paper:
8 | *
9 | *
10 | * Funnel-structured cascade for multi-view face detection with alignment awareness,
11 | * Shuzhe Wu, Meina Kan, Zhenliang He, Shiguang Shan, Xilin Chen.
12 | * In Neurocomputing (under review)
13 | *
14 | *
15 | * Copyright (C) 2016, Visual Information Processing and Learning (VIPL) group,
16 | * Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China.
17 | *
18 | * The codes are mainly developed by Shuzhe Wu (a Ph.D supervised by Prof. Shiguang Shan)
19 | *
20 | * As an open-source face recognition engine: you can redistribute SeetaFace source codes
21 | * and/or modify it under the terms of the BSD 2-Clause License.
22 | *
23 | * You should have received a copy of the BSD 2-Clause License along with the software.
24 | * If not, see < https://opensource.org/licenses/BSD-2-Clause>.
25 | *
26 | * Contact Info: you can send an email to SeetaFace@vipl.ict.ac.cn for any problems.
27 | *
28 | * Note: the above information must be kept whenever or wherever the codes are used.
29 | *
30 | */
31 |
32 | #ifndef SEETA_FD_FUST_H_
33 | #define SEETA_FD_FUST_H_
34 |
35 | #include
36 | #include
37 | #include