├── .gitattributes ├── FaceAlignment.dll ├── FaceDetection.dll ├── FaceIdentification.dll ├── GeneratedFiles ├── Debug │ └── moc_OpenVideo.cpp ├── Release │ ├── moc_MyThread.cpp │ └── moc_OpenVideo.cpp ├── qrc_OpenVideo.cpp └── ui_OpenVideo.h ├── MyThread.cpp ├── MyThread.h ├── OpenVideo.aps ├── OpenVideo.cpp ├── OpenVideo.h ├── OpenVideo.pri ├── OpenVideo.pro ├── OpenVideo.qrc ├── OpenVideo.ui ├── OpenVideo.vcxproj ├── OpenVideo.vcxproj.filters ├── OpenVideo.vcxproj.user ├── README.md ├── SeetaFaceHeader ├── FaceIdentification │ ├── 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 ├── cfan.h ├── classifier.h ├── common.h ├── detector.h ├── face_alignment.h ├── face_detection.h ├── feature_map.h ├── fust.h ├── image_pyramid.h ├── lab_boost_model_reader.h ├── lab_boosted_classifier.h ├── lab_feature_map.h ├── math_func.h ├── mlp.h ├── model_reader.h ├── nms.h ├── sift.h ├── surf_feature_map.h ├── surf_mlp.h └── surf_mlp_model_reader.h ├── SeetaFacelib ├── FaceAlignment.lib ├── FaceDetection.lib └── FaceIdentification.lib ├── UiFile ├── 1.gif ├── 2.gif ├── Button_circle_person_128px_1198024_easyicon.net.ico ├── background.png ├── close1.png ├── close2 (2).png ├── close2.png ├── close3.png ├── closeWhite.png ├── eye_128px_1204362_easyicon.net.ico └── picture_128px_1201195_easyicon.net.ico ├── icon.ico ├── icon.rc ├── main.cpp ├── model ├── seeta_fa_v1.1.bin ├── seeta_fd_frontal_v1.0.bin ├── seeta_fr_v1.0.part1.rar ├── seeta_fr_v1.0.part2.rar └── 说明(必看).txt ├── mp3 └── Recognition.mp3 └── x64 ├── Debug ├── OpenVideo.Build.CppClean.log ├── OpenVideo.log ├── OpenVideo.obj ├── OpenVideo.tlog │ ├── CL.10792.write.1.tlog │ ├── CL.command.1.tlog │ ├── CL.read.1.tlog │ ├── OpenVideo.lastbuildstate │ ├── OpenVideo.write.1u.tlog │ ├── link.5900-cvtres.read.1.tlog │ ├── link.5900-cvtres.write.1.tlog │ ├── link.5900-rc.read.1.tlog │ ├── link.5900-rc.write.1.tlog │ ├── link.5900.read.1.tlog │ ├── link.5900.write.1.tlog │ ├── link.command.1.tlog │ ├── link.read.1.tlog │ ├── link.write.1.tlog │ └── unsuccessfulbuild ├── main.obj ├── moc_OpenVideo.obj ├── qrc_OpenVideo.obj ├── qt.log └── vc141.pdb └── Release ├── MyThread.obj ├── OpenVideo.Build.CppClean.log ├── OpenVideo.log ├── OpenVideo.obj ├── OpenVideo.tlog ├── CL.command.1.tlog ├── CL.read.1.tlog ├── CL.write.1.tlog ├── OpenVideo.lastbuildstate ├── OpenVideo.write.1u.tlog ├── link.command.1.tlog ├── link.read.1.tlog ├── link.write.1.tlog ├── rc.command.1.tlog ├── rc.read.1.tlog └── rc.write.1.tlog ├── icon.res ├── main.obj ├── moc_MyThread.obj ├── moc_OpenVideo.obj ├── qrc_OpenVideo.obj └── qt.log /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /FaceAlignment.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/FaceAlignment.dll -------------------------------------------------------------------------------- /FaceDetection.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/FaceDetection.dll -------------------------------------------------------------------------------- /FaceIdentification.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/FaceIdentification.dll -------------------------------------------------------------------------------- /GeneratedFiles/Debug/moc_OpenVideo.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Meta object code from reading C++ file 'OpenVideo.h' 3 | ** 4 | ** Created by: The Qt Meta Object Compiler version 67 (Qt 5.10.1) 5 | ** 6 | ** WARNING! All changes made in this file will be lost! 7 | *****************************************************************************/ 8 | 9 | #include "../../OpenVideo.h" 10 | #include 11 | #include 12 | #if !defined(Q_MOC_OUTPUT_REVISION) 13 | #error "The header file 'OpenVideo.h' doesn't include ." 14 | #elif Q_MOC_OUTPUT_REVISION != 67 15 | #error "This file was generated using the moc from 5.10.1. It" 16 | #error "cannot be used with the include files from this version of Qt." 17 | #error "(The moc has changed too much.)" 18 | #endif 19 | 20 | QT_BEGIN_MOC_NAMESPACE 21 | QT_WARNING_PUSH 22 | QT_WARNING_DISABLE_DEPRECATED 23 | struct qt_meta_stringdata_OpenVideo_t { 24 | QByteArrayData data[16]; 25 | char stringdata0[207]; 26 | }; 27 | #define QT_MOC_LITERAL(idx, ofs, len) \ 28 | Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ 29 | qptrdiff(offsetof(qt_meta_stringdata_OpenVideo_t, stringdata0) + ofs \ 30 | - idx * sizeof(QByteArrayData)) \ 31 | ) 32 | static const qt_meta_stringdata_OpenVideo_t qt_meta_stringdata_OpenVideo = { 33 | { 34 | QT_MOC_LITERAL(0, 0, 9), // "OpenVideo" 35 | QT_MOC_LITERAL(1, 10, 13), // "OpenVideoFile" 36 | QT_MOC_LITERAL(2, 24, 0), // "" 37 | QT_MOC_LITERAL(3, 25, 10), // "OpenCamera" 38 | QT_MOC_LITERAL(4, 36, 11), // "CloseCamera" 39 | QT_MOC_LITERAL(5, 48, 10), // "ScreenShot" 40 | QT_MOC_LITERAL(6, 59, 3), // "REC" 41 | QT_MOC_LITERAL(7, 63, 6), // "EndREC" 42 | QT_MOC_LITERAL(8, 70, 22), // "FaceDetectionAlignment" 43 | QT_MOC_LITERAL(9, 93, 10), // "InputImage" 44 | QT_MOC_LITERAL(10, 104, 15), // "FaceRecognition" 45 | QT_MOC_LITERAL(11, 120, 9), // "nextFrame" 46 | QT_MOC_LITERAL(12, 130, 25), // "nextSeetaFaceProcessFrame" 47 | QT_MOC_LITERAL(13, 156, 19), // "nextFaceRecognition" 48 | QT_MOC_LITERAL(14, 176, 18), // "currentDateAndTime" 49 | QT_MOC_LITERAL(15, 195, 11) // "CloseWindow" 50 | 51 | }, 52 | "OpenVideo\0OpenVideoFile\0\0OpenCamera\0" 53 | "CloseCamera\0ScreenShot\0REC\0EndREC\0" 54 | "FaceDetectionAlignment\0InputImage\0" 55 | "FaceRecognition\0nextFrame\0" 56 | "nextSeetaFaceProcessFrame\0nextFaceRecognition\0" 57 | "currentDateAndTime\0CloseWindow" 58 | }; 59 | #undef QT_MOC_LITERAL 60 | 61 | static const uint qt_meta_data_OpenVideo[] = { 62 | 63 | // content: 64 | 7, // revision 65 | 0, // classname 66 | 0, 0, // classinfo 67 | 14, 14, // methods 68 | 0, 0, // properties 69 | 0, 0, // enums/sets 70 | 0, 0, // constructors 71 | 0, // flags 72 | 0, // signalCount 73 | 74 | // slots: name, argc, parameters, tag, flags 75 | 1, 0, 84, 2, 0x08 /* Private */, 76 | 3, 0, 85, 2, 0x08 /* Private */, 77 | 4, 0, 86, 2, 0x08 /* Private */, 78 | 5, 0, 87, 2, 0x08 /* Private */, 79 | 6, 0, 88, 2, 0x08 /* Private */, 80 | 7, 0, 89, 2, 0x08 /* Private */, 81 | 8, 0, 90, 2, 0x08 /* Private */, 82 | 9, 0, 91, 2, 0x08 /* Private */, 83 | 10, 0, 92, 2, 0x08 /* Private */, 84 | 11, 0, 93, 2, 0x08 /* Private */, 85 | 12, 0, 94, 2, 0x08 /* Private */, 86 | 13, 0, 95, 2, 0x08 /* Private */, 87 | 14, 0, 96, 2, 0x08 /* Private */, 88 | 15, 0, 97, 2, 0x08 /* Private */, 89 | 90 | // slots: parameters 91 | QMetaType::Void, 92 | QMetaType::Void, 93 | QMetaType::Void, 94 | QMetaType::Void, 95 | QMetaType::Void, 96 | QMetaType::Void, 97 | QMetaType::Void, 98 | QMetaType::Void, 99 | QMetaType::Void, 100 | QMetaType::Void, 101 | QMetaType::Void, 102 | QMetaType::Void, 103 | QMetaType::Void, 104 | QMetaType::Void, 105 | 106 | 0 // eod 107 | }; 108 | 109 | void OpenVideo::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) 110 | { 111 | if (_c == QMetaObject::InvokeMetaMethod) { 112 | OpenVideo *_t = static_cast(_o); 113 | Q_UNUSED(_t) 114 | switch (_id) { 115 | case 0: _t->OpenVideoFile(); break; 116 | case 1: _t->OpenCamera(); break; 117 | case 2: _t->CloseCamera(); break; 118 | case 3: _t->ScreenShot(); break; 119 | case 4: _t->REC(); break; 120 | case 5: _t->EndREC(); break; 121 | case 6: _t->FaceDetectionAlignment(); break; 122 | case 7: _t->InputImage(); break; 123 | case 8: _t->FaceRecognition(); break; 124 | case 9: _t->nextFrame(); break; 125 | case 10: _t->nextSeetaFaceProcessFrame(); break; 126 | case 11: _t->nextFaceRecognition(); break; 127 | case 12: _t->currentDateAndTime(); break; 128 | case 13: _t->CloseWindow(); break; 129 | default: ; 130 | } 131 | } 132 | Q_UNUSED(_a); 133 | } 134 | 135 | QT_INIT_METAOBJECT const QMetaObject OpenVideo::staticMetaObject = { 136 | { &QWidget::staticMetaObject, qt_meta_stringdata_OpenVideo.data, 137 | qt_meta_data_OpenVideo, qt_static_metacall, nullptr, nullptr} 138 | }; 139 | 140 | 141 | const QMetaObject *OpenVideo::metaObject() const 142 | { 143 | return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; 144 | } 145 | 146 | void *OpenVideo::qt_metacast(const char *_clname) 147 | { 148 | if (!_clname) return nullptr; 149 | if (!strcmp(_clname, qt_meta_stringdata_OpenVideo.stringdata0)) 150 | return static_cast(this); 151 | return QWidget::qt_metacast(_clname); 152 | } 153 | 154 | int OpenVideo::qt_metacall(QMetaObject::Call _c, int _id, void **_a) 155 | { 156 | _id = QWidget::qt_metacall(_c, _id, _a); 157 | if (_id < 0) 158 | return _id; 159 | if (_c == QMetaObject::InvokeMetaMethod) { 160 | if (_id < 14) 161 | qt_static_metacall(this, _c, _id, _a); 162 | _id -= 14; 163 | } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { 164 | if (_id < 14) 165 | *reinterpret_cast(_a[0]) = -1; 166 | _id -= 14; 167 | } 168 | return _id; 169 | } 170 | QT_WARNING_POP 171 | QT_END_MOC_NAMESPACE 172 | -------------------------------------------------------------------------------- /GeneratedFiles/Release/moc_MyThread.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Meta object code from reading C++ file 'MyThread.h' 3 | ** 4 | ** Created by: The Qt Meta Object Compiler version 67 (Qt 5.10.1) 5 | ** 6 | ** WARNING! All changes made in this file will be lost! 7 | *****************************************************************************/ 8 | 9 | #include "../../MyThread.h" 10 | #include 11 | #include 12 | #if !defined(Q_MOC_OUTPUT_REVISION) 13 | #error "The header file 'MyThread.h' doesn't include ." 14 | #elif Q_MOC_OUTPUT_REVISION != 67 15 | #error "This file was generated using the moc from 5.10.1. It" 16 | #error "cannot be used with the include files from this version of Qt." 17 | #error "(The moc has changed too much.)" 18 | #endif 19 | 20 | QT_BEGIN_MOC_NAMESPACE 21 | QT_WARNING_PUSH 22 | QT_WARNING_DISABLE_DEPRECATED 23 | struct qt_meta_stringdata_MyThread_t { 24 | QByteArrayData data[8]; 25 | char stringdata0[73]; 26 | }; 27 | #define QT_MOC_LITERAL(idx, ofs, len) \ 28 | Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ 29 | qptrdiff(offsetof(qt_meta_stringdata_MyThread_t, stringdata0) + ofs \ 30 | - idx * sizeof(QByteArrayData)) \ 31 | ) 32 | static const qt_meta_stringdata_MyThread_t qt_meta_stringdata_MyThread = { 33 | { 34 | QT_MOC_LITERAL(0, 0, 8), // "MyThread" 35 | QT_MOC_LITERAL(1, 9, 17), // "UpdateRecognition" 36 | QT_MOC_LITERAL(2, 27, 0), // "" 37 | QT_MOC_LITERAL(3, 28, 14), // "GalleryFaceNum" 38 | QT_MOC_LITERAL(4, 43, 12), // "ProbeFaceNum" 39 | QT_MOC_LITERAL(5, 56, 5), // "image" 40 | QT_MOC_LITERAL(6, 62, 3), // "sim" 41 | QT_MOC_LITERAL(7, 66, 6) // "NoFace" 42 | 43 | }, 44 | "MyThread\0UpdateRecognition\0\0GalleryFaceNum\0" 45 | "ProbeFaceNum\0image\0sim\0NoFace" 46 | }; 47 | #undef QT_MOC_LITERAL 48 | 49 | static const uint qt_meta_data_MyThread[] = { 50 | 51 | // content: 52 | 7, // revision 53 | 0, // classname 54 | 0, 0, // classinfo 55 | 2, 14, // methods 56 | 0, 0, // properties 57 | 0, 0, // enums/sets 58 | 0, 0, // constructors 59 | 0, // flags 60 | 2, // signalCount 61 | 62 | // signals: name, argc, parameters, tag, flags 63 | 1, 4, 24, 2, 0x06 /* Public */, 64 | 7, 0, 33, 2, 0x06 /* Public */, 65 | 66 | // signals: parameters 67 | QMetaType::Void, QMetaType::Int, QMetaType::Int, QMetaType::QImage, QMetaType::Float, 3, 4, 5, 6, 68 | QMetaType::Void, 69 | 70 | 0 // eod 71 | }; 72 | 73 | void MyThread::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) 74 | { 75 | if (_c == QMetaObject::InvokeMetaMethod) { 76 | MyThread *_t = static_cast(_o); 77 | Q_UNUSED(_t) 78 | switch (_id) { 79 | case 0: _t->UpdateRecognition((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< QImage(*)>(_a[3])),(*reinterpret_cast< float(*)>(_a[4]))); break; 80 | case 1: _t->NoFace(); break; 81 | default: ; 82 | } 83 | } else if (_c == QMetaObject::IndexOfMethod) { 84 | int *result = reinterpret_cast(_a[0]); 85 | { 86 | typedef void (MyThread::*_t)(int , int , QImage , float ); 87 | if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&MyThread::UpdateRecognition)) { 88 | *result = 0; 89 | return; 90 | } 91 | } 92 | { 93 | typedef void (MyThread::*_t)(); 94 | if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&MyThread::NoFace)) { 95 | *result = 1; 96 | return; 97 | } 98 | } 99 | } 100 | } 101 | 102 | QT_INIT_METAOBJECT const QMetaObject MyThread::staticMetaObject = { 103 | { &QObject::staticMetaObject, qt_meta_stringdata_MyThread.data, 104 | qt_meta_data_MyThread, qt_static_metacall, nullptr, nullptr} 105 | }; 106 | 107 | 108 | const QMetaObject *MyThread::metaObject() const 109 | { 110 | return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; 111 | } 112 | 113 | void *MyThread::qt_metacast(const char *_clname) 114 | { 115 | if (!_clname) return nullptr; 116 | if (!strcmp(_clname, qt_meta_stringdata_MyThread.stringdata0)) 117 | return static_cast(this); 118 | return QObject::qt_metacast(_clname); 119 | } 120 | 121 | int MyThread::qt_metacall(QMetaObject::Call _c, int _id, void **_a) 122 | { 123 | _id = QObject::qt_metacall(_c, _id, _a); 124 | if (_id < 0) 125 | return _id; 126 | if (_c == QMetaObject::InvokeMetaMethod) { 127 | if (_id < 2) 128 | qt_static_metacall(this, _c, _id, _a); 129 | _id -= 2; 130 | } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { 131 | if (_id < 2) 132 | *reinterpret_cast(_a[0]) = -1; 133 | _id -= 2; 134 | } 135 | return _id; 136 | } 137 | 138 | // SIGNAL 0 139 | void MyThread::UpdateRecognition(int _t1, int _t2, QImage _t3, float _t4) 140 | { 141 | void *_a[] = { nullptr, const_cast(reinterpret_cast(&_t1)), const_cast(reinterpret_cast(&_t2)), const_cast(reinterpret_cast(&_t3)), const_cast(reinterpret_cast(&_t4)) }; 142 | QMetaObject::activate(this, &staticMetaObject, 0, _a); 143 | } 144 | 145 | // SIGNAL 1 146 | void MyThread::NoFace() 147 | { 148 | QMetaObject::activate(this, &staticMetaObject, 1, nullptr); 149 | } 150 | QT_WARNING_POP 151 | QT_END_MOC_NAMESPACE 152 | -------------------------------------------------------------------------------- /GeneratedFiles/Release/moc_OpenVideo.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Meta object code from reading C++ file 'OpenVideo.h' 3 | ** 4 | ** Created by: The Qt Meta Object Compiler version 67 (Qt 5.10.1) 5 | ** 6 | ** WARNING! All changes made in this file will be lost! 7 | *****************************************************************************/ 8 | 9 | #include "../../OpenVideo.h" 10 | #include 11 | #include 12 | #if !defined(Q_MOC_OUTPUT_REVISION) 13 | #error "The header file 'OpenVideo.h' doesn't include ." 14 | #elif Q_MOC_OUTPUT_REVISION != 67 15 | #error "This file was generated using the moc from 5.10.1. It" 16 | #error "cannot be used with the include files from this version of Qt." 17 | #error "(The moc has changed too much.)" 18 | #endif 19 | 20 | QT_BEGIN_MOC_NAMESPACE 21 | QT_WARNING_PUSH 22 | QT_WARNING_DISABLE_DEPRECATED 23 | struct qt_meta_stringdata_OpenVideo_t { 24 | QByteArrayData data[25]; 25 | char stringdata0[301]; 26 | }; 27 | #define QT_MOC_LITERAL(idx, ofs, len) \ 28 | Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ 29 | qptrdiff(offsetof(qt_meta_stringdata_OpenVideo_t, stringdata0) + ofs \ 30 | - idx * sizeof(QByteArrayData)) \ 31 | ) 32 | static const qt_meta_stringdata_OpenVideo_t qt_meta_stringdata_OpenVideo = { 33 | { 34 | QT_MOC_LITERAL(0, 0, 9), // "OpenVideo" 35 | QT_MOC_LITERAL(1, 10, 10), // "mainSignal" 36 | QT_MOC_LITERAL(2, 21, 0), // "" 37 | QT_MOC_LITERAL(3, 22, 3), // "str" 38 | QT_MOC_LITERAL(4, 26, 11), // "VideoSignal" 39 | QT_MOC_LITERAL(5, 38, 5), // "image" 40 | QT_MOC_LITERAL(6, 44, 4), // "flag" 41 | QT_MOC_LITERAL(7, 49, 13), // "OpenVideoFile" 42 | QT_MOC_LITERAL(8, 63, 10), // "OpenCamera" 43 | QT_MOC_LITERAL(9, 74, 11), // "CloseCamera" 44 | QT_MOC_LITERAL(10, 86, 10), // "ScreenShot" 45 | QT_MOC_LITERAL(11, 97, 3), // "REC" 46 | QT_MOC_LITERAL(12, 101, 6), // "EndREC" 47 | QT_MOC_LITERAL(13, 108, 22), // "FaceDetectionAlignment" 48 | QT_MOC_LITERAL(14, 131, 10), // "InputImage" 49 | QT_MOC_LITERAL(15, 142, 22), // "FaceRecognitionProcess" 50 | QT_MOC_LITERAL(16, 165, 9), // "nextFrame" 51 | QT_MOC_LITERAL(17, 175, 25), // "nextSeetaFaceProcessFrame" 52 | QT_MOC_LITERAL(18, 201, 18), // "currentDateAndTime" 53 | QT_MOC_LITERAL(19, 220, 11), // "CloseWindow" 54 | QT_MOC_LITERAL(20, 232, 25), // "getRecognitionInformation" 55 | QT_MOC_LITERAL(21, 258, 16), // "gallery_face_num" 56 | QT_MOC_LITERAL(22, 275, 14), // "probe_face_num" 57 | QT_MOC_LITERAL(23, 290, 3), // "sim" 58 | QT_MOC_LITERAL(24, 294, 6) // "NoFace" 59 | 60 | }, 61 | "OpenVideo\0mainSignal\0\0str\0VideoSignal\0" 62 | "image\0flag\0OpenVideoFile\0OpenCamera\0" 63 | "CloseCamera\0ScreenShot\0REC\0EndREC\0" 64 | "FaceDetectionAlignment\0InputImage\0" 65 | "FaceRecognitionProcess\0nextFrame\0" 66 | "nextSeetaFaceProcessFrame\0currentDateAndTime\0" 67 | "CloseWindow\0getRecognitionInformation\0" 68 | "gallery_face_num\0probe_face_num\0sim\0" 69 | "NoFace" 70 | }; 71 | #undef QT_MOC_LITERAL 72 | 73 | static const uint qt_meta_data_OpenVideo[] = { 74 | 75 | // content: 76 | 7, // revision 77 | 0, // classname 78 | 0, 0, // classinfo 79 | 17, 14, // methods 80 | 0, 0, // properties 81 | 0, 0, // enums/sets 82 | 0, 0, // constructors 83 | 0, // flags 84 | 2, // signalCount 85 | 86 | // signals: name, argc, parameters, tag, flags 87 | 1, 1, 99, 2, 0x06 /* Public */, 88 | 4, 2, 102, 2, 0x06 /* Public */, 89 | 90 | // slots: name, argc, parameters, tag, flags 91 | 7, 0, 107, 2, 0x0a /* Public */, 92 | 8, 0, 108, 2, 0x0a /* Public */, 93 | 9, 0, 109, 2, 0x0a /* Public */, 94 | 10, 0, 110, 2, 0x0a /* Public */, 95 | 11, 0, 111, 2, 0x0a /* Public */, 96 | 12, 0, 112, 2, 0x0a /* Public */, 97 | 13, 0, 113, 2, 0x0a /* Public */, 98 | 14, 0, 114, 2, 0x0a /* Public */, 99 | 15, 0, 115, 2, 0x0a /* Public */, 100 | 16, 0, 116, 2, 0x0a /* Public */, 101 | 17, 0, 117, 2, 0x0a /* Public */, 102 | 18, 0, 118, 2, 0x0a /* Public */, 103 | 19, 0, 119, 2, 0x0a /* Public */, 104 | 20, 4, 120, 2, 0x0a /* Public */, 105 | 24, 0, 129, 2, 0x0a /* Public */, 106 | 107 | // signals: parameters 108 | QMetaType::Void, QMetaType::QString, 3, 109 | QMetaType::Void, QMetaType::QImage, QMetaType::Bool, 5, 6, 110 | 111 | // slots: parameters 112 | QMetaType::Void, 113 | QMetaType::Void, 114 | QMetaType::Void, 115 | QMetaType::Void, 116 | QMetaType::Void, 117 | QMetaType::Void, 118 | QMetaType::Void, 119 | QMetaType::Void, 120 | QMetaType::Void, 121 | QMetaType::Void, 122 | QMetaType::Void, 123 | QMetaType::Void, 124 | QMetaType::Void, 125 | QMetaType::Void, QMetaType::Int, QMetaType::Int, QMetaType::QImage, QMetaType::Float, 21, 22, 5, 23, 126 | QMetaType::Void, 127 | 128 | 0 // eod 129 | }; 130 | 131 | void OpenVideo::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) 132 | { 133 | if (_c == QMetaObject::InvokeMetaMethod) { 134 | OpenVideo *_t = static_cast(_o); 135 | Q_UNUSED(_t) 136 | switch (_id) { 137 | case 0: _t->mainSignal((*reinterpret_cast< QString(*)>(_a[1]))); break; 138 | case 1: _t->VideoSignal((*reinterpret_cast< QImage(*)>(_a[1])),(*reinterpret_cast< bool(*)>(_a[2]))); break; 139 | case 2: _t->OpenVideoFile(); break; 140 | case 3: _t->OpenCamera(); break; 141 | case 4: _t->CloseCamera(); break; 142 | case 5: _t->ScreenShot(); break; 143 | case 6: _t->REC(); break; 144 | case 7: _t->EndREC(); break; 145 | case 8: _t->FaceDetectionAlignment(); break; 146 | case 9: _t->InputImage(); break; 147 | case 10: _t->FaceRecognitionProcess(); break; 148 | case 11: _t->nextFrame(); break; 149 | case 12: _t->nextSeetaFaceProcessFrame(); break; 150 | case 13: _t->currentDateAndTime(); break; 151 | case 14: _t->CloseWindow(); break; 152 | case 15: _t->getRecognitionInformation((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< QImage(*)>(_a[3])),(*reinterpret_cast< float(*)>(_a[4]))); break; 153 | case 16: _t->NoFace(); break; 154 | default: ; 155 | } 156 | } else if (_c == QMetaObject::IndexOfMethod) { 157 | int *result = reinterpret_cast(_a[0]); 158 | { 159 | typedef void (OpenVideo::*_t)(QString ); 160 | if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&OpenVideo::mainSignal)) { 161 | *result = 0; 162 | return; 163 | } 164 | } 165 | { 166 | typedef void (OpenVideo::*_t)(QImage , bool ); 167 | if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&OpenVideo::VideoSignal)) { 168 | *result = 1; 169 | return; 170 | } 171 | } 172 | } 173 | } 174 | 175 | QT_INIT_METAOBJECT const QMetaObject OpenVideo::staticMetaObject = { 176 | { &QWidget::staticMetaObject, qt_meta_stringdata_OpenVideo.data, 177 | qt_meta_data_OpenVideo, qt_static_metacall, nullptr, nullptr} 178 | }; 179 | 180 | 181 | const QMetaObject *OpenVideo::metaObject() const 182 | { 183 | return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; 184 | } 185 | 186 | void *OpenVideo::qt_metacast(const char *_clname) 187 | { 188 | if (!_clname) return nullptr; 189 | if (!strcmp(_clname, qt_meta_stringdata_OpenVideo.stringdata0)) 190 | return static_cast(this); 191 | return QWidget::qt_metacast(_clname); 192 | } 193 | 194 | int OpenVideo::qt_metacall(QMetaObject::Call _c, int _id, void **_a) 195 | { 196 | _id = QWidget::qt_metacall(_c, _id, _a); 197 | if (_id < 0) 198 | return _id; 199 | if (_c == QMetaObject::InvokeMetaMethod) { 200 | if (_id < 17) 201 | qt_static_metacall(this, _c, _id, _a); 202 | _id -= 17; 203 | } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { 204 | if (_id < 17) 205 | *reinterpret_cast(_a[0]) = -1; 206 | _id -= 17; 207 | } 208 | return _id; 209 | } 210 | 211 | // SIGNAL 0 212 | void OpenVideo::mainSignal(QString _t1) 213 | { 214 | void *_a[] = { nullptr, const_cast(reinterpret_cast(&_t1)) }; 215 | QMetaObject::activate(this, &staticMetaObject, 0, _a); 216 | } 217 | 218 | // SIGNAL 1 219 | void OpenVideo::VideoSignal(QImage _t1, bool _t2) 220 | { 221 | void *_a[] = { nullptr, const_cast(reinterpret_cast(&_t1)), const_cast(reinterpret_cast(&_t2)) }; 222 | QMetaObject::activate(this, &staticMetaObject, 1, _a); 223 | } 224 | QT_WARNING_POP 225 | QT_END_MOC_NAMESPACE 226 | -------------------------------------------------------------------------------- /GeneratedFiles/qrc_OpenVideo.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Resource object code 3 | ** 4 | ** Created by: The Resource Compiler for Qt version 5.10.1 5 | ** 6 | ** WARNING! All changes made in this file will be lost! 7 | *****************************************************************************/ 8 | 9 | #ifdef QT_NAMESPACE 10 | # define QT_RCC_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name 11 | # define QT_RCC_MANGLE_NAMESPACE0(x) x 12 | # define QT_RCC_MANGLE_NAMESPACE1(a, b) a##_##b 13 | # define QT_RCC_MANGLE_NAMESPACE2(a, b) QT_RCC_MANGLE_NAMESPACE1(a,b) 14 | # define QT_RCC_MANGLE_NAMESPACE(name) QT_RCC_MANGLE_NAMESPACE2( \ 15 | QT_RCC_MANGLE_NAMESPACE0(name), QT_RCC_MANGLE_NAMESPACE0(QT_NAMESPACE)) 16 | #else 17 | # define QT_RCC_PREPEND_NAMESPACE(name) name 18 | # define QT_RCC_MANGLE_NAMESPACE(name) name 19 | #endif 20 | 21 | #ifdef QT_NAMESPACE 22 | namespace QT_NAMESPACE { 23 | #endif 24 | 25 | #ifdef QT_NAMESPACE 26 | } 27 | #endif 28 | 29 | int QT_RCC_MANGLE_NAMESPACE(qInitResources_OpenVideo)(); 30 | int QT_RCC_MANGLE_NAMESPACE(qInitResources_OpenVideo)() 31 | { 32 | return 1; 33 | } 34 | 35 | int QT_RCC_MANGLE_NAMESPACE(qCleanupResources_OpenVideo)(); 36 | int QT_RCC_MANGLE_NAMESPACE(qCleanupResources_OpenVideo)() 37 | { 38 | return 1; 39 | } 40 | 41 | namespace { 42 | struct initializer { 43 | initializer() { QT_RCC_MANGLE_NAMESPACE(qInitResources_OpenVideo)(); } 44 | ~initializer() { QT_RCC_MANGLE_NAMESPACE(qCleanupResources_OpenVideo)(); } 45 | } dummy; 46 | } 47 | -------------------------------------------------------------------------------- /GeneratedFiles/ui_OpenVideo.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | ** Form generated from reading UI file 'OpenVideo.ui' 3 | ** 4 | ** Created by: Qt User Interface Compiler version 5.10.1 5 | ** 6 | ** WARNING! All changes made in this file will be lost when recompiling UI file! 7 | ********************************************************************************/ 8 | 9 | #ifndef UI_OPENVIDEO_H 10 | #define UI_OPENVIDEO_H 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | QT_BEGIN_NAMESPACE 22 | 23 | class Ui_OpenVideoClass 24 | { 25 | public: 26 | QPushButton *pushButton; 27 | QLabel *labelOpenVideo; 28 | QPushButton *pushButton_2; 29 | QPushButton *pushButton_3; 30 | QPushButton *pushButton_4; 31 | QLabel *labelScreenShot; 32 | QPushButton *pushButton_5; 33 | QPushButton *pushButton_6; 34 | QPushButton *buttonDetectionAndAlignment; 35 | QLabel *label; 36 | QLabel *InputImageLabel; 37 | QLabel *OutputImageLabel; 38 | QPushButton *pushButton_8; 39 | QPushButton *buttonFaceRecognition; 40 | QLabel *SimilarityLabel; 41 | QLabel *labelGif; 42 | QLabel *labelDateTime; 43 | QLabel *labelFaceNum; 44 | QPushButton *CloseButton; 45 | 46 | void setupUi(QWidget *OpenVideoClass) 47 | { 48 | if (OpenVideoClass->objectName().isEmpty()) 49 | OpenVideoClass->setObjectName(QStringLiteral("OpenVideoClass")); 50 | OpenVideoClass->setWindowModality(Qt::NonModal); 51 | OpenVideoClass->setEnabled(true); 52 | OpenVideoClass->resize(1125, 511); 53 | QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); 54 | sizePolicy.setHorizontalStretch(0); 55 | sizePolicy.setVerticalStretch(0); 56 | sizePolicy.setHeightForWidth(OpenVideoClass->sizePolicy().hasHeightForWidth()); 57 | OpenVideoClass->setSizePolicy(sizePolicy); 58 | QIcon icon; 59 | icon.addFile(QStringLiteral("UiFile/eye_128px_1204362_easyicon.net.ico"), QSize(), QIcon::Normal, QIcon::Off); 60 | OpenVideoClass->setWindowIcon(icon); 61 | pushButton = new QPushButton(OpenVideoClass); 62 | pushButton->setObjectName(QStringLiteral("pushButton")); 63 | pushButton->setGeometry(QRect(20, 470, 75, 35)); 64 | pushButton->setMinimumSize(QSize(0, 35)); 65 | labelOpenVideo = new QLabel(OpenVideoClass); 66 | labelOpenVideo->setObjectName(QStringLiteral("labelOpenVideo")); 67 | labelOpenVideo->setEnabled(true); 68 | labelOpenVideo->setGeometry(QRect(0, 0, 881, 421)); 69 | sizePolicy.setHeightForWidth(labelOpenVideo->sizePolicy().hasHeightForWidth()); 70 | labelOpenVideo->setSizePolicy(sizePolicy); 71 | labelOpenVideo->setMaximumSize(QSize(16777215, 16777213)); 72 | QFont font; 73 | font.setFamily(QString::fromUtf8("\346\245\267\344\275\223")); 74 | font.setPointSize(24); 75 | labelOpenVideo->setFont(font); 76 | pushButton_2 = new QPushButton(OpenVideoClass); 77 | pushButton_2->setObjectName(QStringLiteral("pushButton_2")); 78 | pushButton_2->setGeometry(QRect(120, 470, 75, 35)); 79 | pushButton_2->setMinimumSize(QSize(0, 35)); 80 | pushButton_2->setMaximumSize(QSize(16777215, 16777214)); 81 | pushButton_3 = new QPushButton(OpenVideoClass); 82 | pushButton_3->setObjectName(QStringLiteral("pushButton_3")); 83 | pushButton_3->setGeometry(QRect(630, 470, 101, 35)); 84 | pushButton_3->setMinimumSize(QSize(0, 35)); 85 | pushButton_4 = new QPushButton(OpenVideoClass); 86 | pushButton_4->setObjectName(QStringLiteral("pushButton_4")); 87 | pushButton_4->setGeometry(QRect(210, 470, 75, 35)); 88 | pushButton_4->setMinimumSize(QSize(0, 35)); 89 | labelScreenShot = new QLabel(OpenVideoClass); 90 | labelScreenShot->setObjectName(QStringLiteral("labelScreenShot")); 91 | labelScreenShot->setGeometry(QRect(710, 400, 201, 101)); 92 | pushButton_5 = new QPushButton(OpenVideoClass); 93 | pushButton_5->setObjectName(QStringLiteral("pushButton_5")); 94 | pushButton_5->setGeometry(QRect(300, 470, 75, 35)); 95 | pushButton_5->setMinimumSize(QSize(0, 35)); 96 | pushButton_6 = new QPushButton(OpenVideoClass); 97 | pushButton_6->setObjectName(QStringLiteral("pushButton_6")); 98 | pushButton_6->setEnabled(true); 99 | pushButton_6->setGeometry(QRect(540, 470, 75, 35)); 100 | pushButton_6->setMinimumSize(QSize(0, 35)); 101 | buttonDetectionAndAlignment = new QPushButton(OpenVideoClass); 102 | buttonDetectionAndAlignment->setObjectName(QStringLiteral("buttonDetectionAndAlignment")); 103 | buttonDetectionAndAlignment->setGeometry(QRect(390, 470, 101, 35)); 104 | buttonDetectionAndAlignment->setMinimumSize(QSize(0, 35)); 105 | label = new QLabel(OpenVideoClass); 106 | label->setObjectName(QStringLiteral("label")); 107 | label->setGeometry(QRect(0, 50, 91, 31)); 108 | InputImageLabel = new QLabel(OpenVideoClass); 109 | InputImageLabel->setObjectName(QStringLiteral("InputImageLabel")); 110 | InputImageLabel->setGeometry(QRect(880, 0, 251, 171)); 111 | OutputImageLabel = new QLabel(OpenVideoClass); 112 | OutputImageLabel->setObjectName(QStringLiteral("OutputImageLabel")); 113 | OutputImageLabel->setGeometry(QRect(880, 200, 261, 171)); 114 | pushButton_8 = new QPushButton(OpenVideoClass); 115 | pushButton_8->setObjectName(QStringLiteral("pushButton_8")); 116 | pushButton_8->setGeometry(QRect(910, 470, 101, 35)); 117 | pushButton_8->setMinimumSize(QSize(0, 35)); 118 | pushButton_8->setStyleSheet(QLatin1String("QPushButton\n" 119 | "{\n" 120 | " color:white;\n" 121 | "}\n" 122 | "QPushButton:hover\n" 123 | "{\n" 124 | " color:white;\n" 125 | " background-color:rgb(0 , 137 , 255);\n" 126 | " border: 1px solid rgb(11 , 137 , 234);\n" 127 | "}\n" 128 | "QPushButton:pressed\n" 129 | "{\n" 130 | " color: rgb(255, 255, 255);\n" 131 | " background-color: rgb(80, 200, 59);\n" 132 | "}")); 133 | QIcon icon1; 134 | icon1.addFile(QStringLiteral("UiFile/picture_128px_1201195_easyicon.net.ico"), QSize(), QIcon::Normal, QIcon::Off); 135 | pushButton_8->setIcon(icon1); 136 | pushButton_8->setIconSize(QSize(45, 30)); 137 | pushButton_8->setCheckable(false); 138 | pushButton_8->setAutoRepeat(false); 139 | pushButton_8->setAutoExclusive(false); 140 | pushButton_8->setAutoDefault(false); 141 | pushButton_8->setFlat(true); 142 | buttonFaceRecognition = new QPushButton(OpenVideoClass); 143 | buttonFaceRecognition->setObjectName(QStringLiteral("buttonFaceRecognition")); 144 | buttonFaceRecognition->setGeometry(QRect(1030, 470, 101, 35)); 145 | buttonFaceRecognition->setMinimumSize(QSize(0, 35)); 146 | buttonFaceRecognition->setStyleSheet(QLatin1String("QPushButton\n" 147 | "{\n" 148 | " color:white;\n" 149 | "}\n" 150 | "QPushButton:hover\n" 151 | "{\n" 152 | " color:white;\n" 153 | " background-color:rgb(0 , 137 , 255);\n" 154 | " border: 1px solid rgb(11 , 137 , 234);\n" 155 | "}\n" 156 | "QPushButton:pressed\n" 157 | "{\n" 158 | " color: rgb(255, 255, 255);\n" 159 | " background-color: rgb(80, 200, 59);\n" 160 | "}")); 161 | QIcon icon2; 162 | icon2.addFile(QStringLiteral("UiFile/Button_circle_person_128px_1198024_easyicon.net.ico"), QSize(), QIcon::Normal, QIcon::Off); 163 | buttonFaceRecognition->setIcon(icon2); 164 | buttonFaceRecognition->setIconSize(QSize(45, 30)); 165 | buttonFaceRecognition->setAutoDefault(false); 166 | buttonFaceRecognition->setFlat(true); 167 | SimilarityLabel = new QLabel(OpenVideoClass); 168 | SimilarityLabel->setObjectName(QStringLiteral("SimilarityLabel")); 169 | SimilarityLabel->setGeometry(QRect(880, 380, 241, 41)); 170 | SimilarityLabel->setStyleSheet(QString::fromUtf8("color: rgb(255, 255, 255);\n" 171 | "font: 12pt \"\351\232\266\344\271\246\";")); 172 | labelGif = new QLabel(OpenVideoClass); 173 | labelGif->setObjectName(QStringLiteral("labelGif")); 174 | labelGif->setGeometry(QRect(0, 420, 1141, 41)); 175 | labelDateTime = new QLabel(OpenVideoClass); 176 | labelDateTime->setObjectName(QStringLiteral("labelDateTime")); 177 | labelDateTime->setGeometry(QRect(890, 170, 241, 31)); 178 | labelDateTime->setStyleSheet(QString::fromUtf8("font: 11pt \"\351\232\266\344\271\246\";\n" 179 | "color: rgb(255, 255, 255);")); 180 | labelDateTime->setScaledContents(true); 181 | labelFaceNum = new QLabel(OpenVideoClass); 182 | labelFaceNum->setObjectName(QStringLiteral("labelFaceNum")); 183 | labelFaceNum->setGeometry(QRect(640, 10, 231, 31)); 184 | labelFaceNum->setStyleSheet(QString::fromUtf8("color: rgb(103, 5, 200);\n" 185 | "font: 14pt \"\351\232\266\344\271\246\";")); 186 | CloseButton = new QPushButton(OpenVideoClass); 187 | CloseButton->setObjectName(QStringLiteral("CloseButton")); 188 | CloseButton->setGeometry(QRect(1075, -1, 51, 31)); 189 | CloseButton->setAutoFillBackground(false); 190 | CloseButton->setStyleSheet(QStringLiteral("")); 191 | QIcon icon3; 192 | icon3.addFile(QStringLiteral("UiFile/closeWhite.png"), QSize(), QIcon::Normal, QIcon::Off); 193 | CloseButton->setIcon(icon3); 194 | CloseButton->setIconSize(QSize(18, 18)); 195 | CloseButton->setAutoDefault(false); 196 | CloseButton->setFlat(false); 197 | labelGif->raise(); 198 | labelOpenVideo->raise(); 199 | pushButton_3->raise(); 200 | pushButton_4->raise(); 201 | labelScreenShot->raise(); 202 | pushButton_5->raise(); 203 | pushButton_6->raise(); 204 | buttonDetectionAndAlignment->raise(); 205 | label->raise(); 206 | InputImageLabel->raise(); 207 | OutputImageLabel->raise(); 208 | pushButton_8->raise(); 209 | buttonFaceRecognition->raise(); 210 | SimilarityLabel->raise(); 211 | pushButton->raise(); 212 | pushButton_2->raise(); 213 | labelDateTime->raise(); 214 | labelFaceNum->raise(); 215 | CloseButton->raise(); 216 | 217 | retranslateUi(OpenVideoClass); 218 | QObject::connect(pushButton, SIGNAL(clicked()), OpenVideoClass, SLOT(OpenVideoFile())); 219 | QObject::connect(pushButton_2, SIGNAL(clicked()), OpenVideoClass, SLOT(OpenCamera())); 220 | QObject::connect(pushButton_3, SIGNAL(clicked()), OpenVideoClass, SLOT(CloseCamera())); 221 | QObject::connect(pushButton_4, SIGNAL(clicked()), OpenVideoClass, SLOT(ScreenShot())); 222 | QObject::connect(pushButton_5, SIGNAL(clicked()), OpenVideoClass, SLOT(REC())); 223 | QObject::connect(pushButton_6, SIGNAL(clicked()), OpenVideoClass, SLOT(EndREC())); 224 | QObject::connect(buttonDetectionAndAlignment, SIGNAL(clicked()), OpenVideoClass, SLOT(FaceDetectionAlignment())); 225 | QObject::connect(pushButton_8, SIGNAL(clicked()), OpenVideoClass, SLOT(InputImage())); 226 | QObject::connect(buttonFaceRecognition, SIGNAL(clicked()), OpenVideoClass, SLOT(FaceRecognition())); 227 | QObject::connect(CloseButton, SIGNAL(clicked()), OpenVideoClass, SLOT(CloseWindow())); 228 | 229 | pushButton_8->setDefault(false); 230 | buttonFaceRecognition->setDefault(false); 231 | 232 | 233 | QMetaObject::connectSlotsByName(OpenVideoClass); 234 | } // setupUi 235 | 236 | void retranslateUi(QWidget *OpenVideoClass) 237 | { 238 | OpenVideoClass->setWindowTitle(QApplication::translate("OpenVideoClass", "OpenVideo", nullptr)); 239 | pushButton->setText(QApplication::translate("OpenVideoClass", "\346\211\223\345\274\200\350\247\206\351\242\221", nullptr)); 240 | labelOpenVideo->setText(QApplication::translate("OpenVideoClass", " \347\247\257\350\267\254\346\255\245\357\274\214\350\207\263\345\215\203\351\207\214", nullptr)); 241 | pushButton_2->setText(QApplication::translate("OpenVideoClass", "\346\211\223\345\274\200\346\221\204\345\203\217\345\244\264", nullptr)); 242 | pushButton_3->setText(QApplication::translate("OpenVideoClass", "\345\205\263\351\227\255\346\221\204\345\203\217\345\244\264/\350\247\206\351\242\221", nullptr)); 243 | pushButton_4->setText(QApplication::translate("OpenVideoClass", "\346\213\215\347\205\247/\346\210\252\345\233\276", nullptr)); 244 | labelScreenShot->setText(QString()); 245 | pushButton_5->setText(QApplication::translate("OpenVideoClass", "\345\275\225\345\210\266\350\247\206\351\242\221", nullptr)); 246 | pushButton_6->setText(QApplication::translate("OpenVideoClass", "\347\273\223\346\235\237\345\275\225\345\210\266", nullptr)); 247 | buttonDetectionAndAlignment->setText(QApplication::translate("OpenVideoClass", "\344\272\272\350\204\270\346\243\200\346\265\213\344\270\216\345\257\271\351\275\220", nullptr)); 248 | label->setText(QString()); 249 | InputImageLabel->setText(QString()); 250 | OutputImageLabel->setText(QString()); 251 | #ifndef QT_NO_TOOLTIP 252 | pushButton_8->setToolTip(QApplication::translate("OpenVideoClass", "

\346\217\220\344\276\233\344\270\200\345\274\240\345\233\276\347\211\207

", nullptr)); 253 | #endif // QT_NO_TOOLTIP 254 | pushButton_8->setText(QApplication::translate("OpenVideoClass", "\350\276\223\345\205\245\345\233\276\347\211\207", nullptr)); 255 | #ifndef QT_NO_TOOLTIP 256 | buttonFaceRecognition->setToolTip(QApplication::translate("OpenVideoClass", "

\350\277\233\350\241\214\344\272\272\350\204\270\350\257\206\345\210\253

", nullptr)); 257 | #endif // QT_NO_TOOLTIP 258 | #ifndef QT_NO_WHATSTHIS 259 | buttonFaceRecognition->setWhatsThis(QApplication::translate("OpenVideoClass", "


", nullptr)); 260 | #endif // QT_NO_WHATSTHIS 261 | buttonFaceRecognition->setText(QApplication::translate("OpenVideoClass", "\344\272\272\350\204\270\350\257\206\345\210\253", nullptr)); 262 | SimilarityLabel->setText(QString()); 263 | labelGif->setText(QString()); 264 | labelDateTime->setText(QString()); 265 | labelFaceNum->setText(QString()); 266 | #ifndef QT_NO_TOOLTIP 267 | CloseButton->setToolTip(QApplication::translate("OpenVideoClass", "

\345\205\263\351\227\255

", nullptr)); 268 | #endif // QT_NO_TOOLTIP 269 | CloseButton->setText(QString()); 270 | } // retranslateUi 271 | 272 | }; 273 | 274 | namespace Ui { 275 | class OpenVideoClass: public Ui_OpenVideoClass {}; 276 | } // namespace Ui 277 | 278 | QT_END_NAMESPACE 279 | 280 | #endif // UI_OPENVIDEO_H 281 | -------------------------------------------------------------------------------- /MyThread.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/MyThread.cpp -------------------------------------------------------------------------------- /MyThread.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/MyThread.h -------------------------------------------------------------------------------- /OpenVideo.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/OpenVideo.aps -------------------------------------------------------------------------------- /OpenVideo.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/OpenVideo.cpp -------------------------------------------------------------------------------- /OpenVideo.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/OpenVideo.h -------------------------------------------------------------------------------- /OpenVideo.pri: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------- 2 | # This file is generated by the Qt Visual Studio Tools. 3 | # ------------------------------------------------------ 4 | 5 | # This is a reminder that you are using a generated .pro file. 6 | # Remove it when you are finished editing this file. 7 | message("You are running qmake on a generated .pro file. This may not work!") 8 | 9 | 10 | HEADERS += ./OpenVideo.h 11 | SOURCES += ./main.cpp \ 12 | ./OpenVideo.cpp 13 | FORMS += ./OpenVideo.ui 14 | RESOURCES += OpenVideo.qrc 15 | RC_FILE = logo.rc -------------------------------------------------------------------------------- /OpenVideo.pro: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------- 2 | # This file is generated by the Qt Visual Studio Tools. 3 | # ------------------------------------------------------ 4 | 5 | TEMPLATE = app 6 | TARGET = OpenVideo 7 | DESTDIR = ../x64/Release 8 | QT += core gui multimedia widgets 9 | CONFIG += release 10 | DEFINES += _UNICODE WIN64 QT_DLL QT_MULTIMEDIA_LIB QT_WIDGETS_LIB 11 | INCLUDEPATH += ./GeneratedFiles \ 12 | . \ 13 | ./GeneratedFiles/$(ConfigurationName) \ 14 | ../SeetaFaceHeader \ 15 | ../SeetaFaceHeader/FaceIdentification 16 | LIBS += -L"../SeetaFacelib" \ 17 | -lFaceAlignment \ 18 | -lFaceDetection \ 19 | -lFaceIdentification \ 20 | -lopencv_world341 21 | DEPENDPATH += . 22 | MOC_DIR += ./GeneratedFiles/$(ConfigurationName) 23 | OBJECTS_DIR += release 24 | UI_DIR += ./GeneratedFiles 25 | RCC_DIR += ./GeneratedFiles 26 | include(OpenVideo.pri) 27 | 28 | RC_FILE = logo.rc -------------------------------------------------------------------------------- /OpenVideo.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /OpenVideo.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | x64 7 | 8 | 9 | Release 10 | x64 11 | 12 | 13 | 14 | {B12702AD-ABFB-343A-A199-8E24837244A3} 15 | Qt4VSv1.0 16 | 10.0.17134.0 17 | 18 | 19 | 20 | Application 21 | v141 22 | 23 | 24 | Application 25 | v141 26 | 27 | 28 | 29 | $(MSBuildProjectDirectory)\QtMsBuild 30 | 31 | 32 | $(SolutionDir)$(Platform)\$(Configuration)\ 33 | 34 | 35 | $(SolutionDir)$(Platform)\$(Configuration)\ 36 | $(IncludePath) 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | true 56 | UNICODE;_UNICODE;WIN32;WIN64;QT_DLL;QT_CORE_LIB;QT_GUI_LIB;QT_MULTIMEDIA_LIB;QT_WIDGETS_LIB;%(PreprocessorDefinitions) 57 | .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtMultimedia;$(QTDIR)\include\QtWidgets;E:\C++\Demo\OpenVideo\OpenVideo\SeetaFaceHeader;E:\C++\Demo\OpenVideo\OpenVideo\SeetaFaceHeader\FaceIdentification;%(AdditionalIncludeDirectories) 58 | Disabled 59 | ProgramDatabase 60 | MultiThreadedDebugDLL 61 | true 62 | 63 | 64 | Windows 65 | $(OutDir)\$(ProjectName).exe 66 | $(QTDIR)\lib;E:\C++\Demo\OpenVideo\OpenVideo\SeetaFacelib;%(AdditionalLibraryDirectories) 67 | true 68 | qtmaind.lib;Qt5Cored.lib;Qt5Guid.lib;Qt5Multimediad.lib;Qt5Widgetsd.lib;FaceAlignment.lib;FaceDetection.lib;FaceIdentification.lib;%(AdditionalDependencies) 69 | 70 | 71 | .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp 72 | Moc'ing %(Identity)... 73 | .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtMultimedia;$(QTDIR)\include\QtWidgets;E:\C++\Demo\OpenVideo\OpenVideo\SeetaFaceHeader;E:\C++\Demo\OpenVideo\OpenVideo\SeetaFaceHeader\FaceIdentification;%(AdditionalIncludeDirectories) 74 | UNICODE;_UNICODE;WIN32;WIN64;QT_DLL;QT_CORE_LIB;QT_GUI_LIB;QT_MULTIMEDIA_LIB;QT_WIDGETS_LIB;%(PreprocessorDefinitions) 75 | 76 | 77 | Uic'ing %(Identity)... 78 | .\GeneratedFiles\ui_%(Filename).h 79 | 80 | 81 | Rcc'ing %(Identity)... 82 | .\GeneratedFiles\qrc_%(Filename).cpp 83 | 84 | 85 | 86 | 87 | true 88 | UNICODE;_UNICODE;WIN32;WIN64;QT_DLL;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QT_GUI_LIB;QT_MULTIMEDIA_LIB;QT_WIDGETS_LIB;%(PreprocessorDefinitions) 89 | .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtMultimedia;$(QTDIR)\include\QtWidgets;E:\C++\Demo\OpenVideo\OpenVideo\SeetaFaceHeader;E:\C++\Demo\OpenVideo\OpenVideo\SeetaFaceHeader\FaceIdentification;%(AdditionalIncludeDirectories) 90 | 91 | MultiThreadedDLL 92 | true 93 | 94 | 95 | Windows 96 | $(OutDir)\$(ProjectName).exe 97 | $(QTDIR)\lib;E:\C++\Demo\OpenVideo\OpenVideo\SeetaFacelib;%(AdditionalLibraryDirectories) 98 | false 99 | opencv_world341.lib;qtmain.lib;Qt5Core.lib;Qt5Gui.lib;Qt5Multimedia.lib;Qt5Widgets.lib;FaceDetection.lib;FaceAlignment.lib;FaceIdentification.lib;%(AdditionalDependencies) 100 | 101 | 102 | .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp 103 | Moc'ing %(Identity)... 104 | .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtMultimedia;$(QTDIR)\include\QtWidgets;E:\C++\Demo\OpenVideo\OpenVideo\SeetaFaceHeader;E:\C++\Demo\OpenVideo\OpenVideo\SeetaFaceHeader\FaceIdentification;%(AdditionalIncludeDirectories) 105 | UNICODE;_UNICODE;WIN32;WIN64;QT_DLL;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QT_GUI_LIB;QT_MULTIMEDIA_LIB;QT_WIDGETS_LIB;%(PreprocessorDefinitions) 106 | 107 | 108 | Uic'ing %(Identity)... 109 | .\GeneratedFiles\ui_%(Filename).h 110 | 111 | 112 | Rcc'ing %(Identity)... 113 | .\GeneratedFiles\qrc_%(Filename).cpp 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName)\.;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtMultimedia;$(QTDIR)\include\QtWidgets;E:\C++\Demo\OpenVideo\OpenVideo\SeetaFaceHeader;E:\C++\Demo\OpenVideo\OpenVideo\SeetaFaceHeader\FaceIdentification 133 | UNICODE;_UNICODE;WIN32;WIN64;QT_DLL;QT_CORE_LIB;QT_GUI_LIB;QT_MULTIMEDIA_LIB;QT_WIDGETS_LIB 134 | .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName)\.;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtMultimedia;$(QTDIR)\include\QtWidgets;E:\C++\Demo\OpenVideo\OpenVideo\SeetaFaceHeader;E:\C++\Demo\OpenVideo\OpenVideo\SeetaFaceHeader\FaceIdentification 135 | UNICODE;_UNICODE;WIN32;WIN64;QT_DLL;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QT_GUI_LIB;QT_MULTIMEDIA_LIB;QT_WIDGETS_LIB 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | -------------------------------------------------------------------------------- /OpenVideo.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 | {D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E} 14 | qrc;* 15 | false 16 | 17 | 18 | {99349809-55BA-4b9d-BF79-8FDBB0286EB3} 19 | ui 20 | 21 | 22 | {D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E} 23 | qrc;* 24 | false 25 | 26 | 27 | {71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11} 28 | moc;h;cpp 29 | False 30 | 31 | 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | 44 | 45 | Header Files 46 | 47 | 48 | Header Files 49 | 50 | 51 | 52 | 53 | Resource Files 54 | 55 | 56 | 57 | 58 | Form Files 59 | 60 | 61 | 62 | 63 | Header Files 64 | 65 | 66 | Header Files 67 | 68 | 69 | Header Files 70 | 71 | 72 | Header Files 73 | 74 | 75 | Header Files 76 | 77 | 78 | Header Files 79 | 80 | 81 | Header Files 82 | 83 | 84 | Header Files 85 | 86 | 87 | Header Files 88 | 89 | 90 | Header Files 91 | 92 | 93 | Header Files 94 | 95 | 96 | Header Files 97 | 98 | 99 | Header Files 100 | 101 | 102 | Header Files 103 | 104 | 105 | Header Files 106 | 107 | 108 | Header Files 109 | 110 | 111 | Header Files 112 | 113 | 114 | Header Files 115 | 116 | 117 | Header Files 118 | 119 | 120 | Header Files 121 | 122 | 123 | Header Files 124 | 125 | 126 | Header Files 127 | 128 | 129 | Header Files 130 | 131 | 132 | Header Files 133 | 134 | 135 | Header Files 136 | 137 | 138 | Header Files 139 | 140 | 141 | Header Files 142 | 143 | 144 | Header Files 145 | 146 | 147 | Header Files 148 | 149 | 150 | Header Files 151 | 152 | 153 | Header Files 154 | 155 | 156 | Header Files 157 | 158 | 159 | Header Files 160 | 161 | 162 | Header Files 163 | 164 | 165 | Header Files 166 | 167 | 168 | Header Files 169 | 170 | 171 | Header Files 172 | 173 | 174 | Header Files 175 | 176 | 177 | Header Files 178 | 179 | 180 | Header Files 181 | 182 | 183 | Header Files 184 | 185 | 186 | 187 | 188 | 189 | -------------------------------------------------------------------------------- /OpenVideo.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | E:\Qt\5.10.1\msvc2017_64 6 | PATH=$(QTDIR)\bin%3b$(PATH) 7 | 8 | 9 | E:\Qt\5.10.1\msvc2017_64 10 | PATH=$(QTDIR)\bin%3b$(PATH) 11 | 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SeetaFace-VS2017-Qt 2 | 目前计算机视觉技术已经比较成熟,相关的开源项目与算法很多,可以将这些开源算法进行整合,进而做成一个小项目,以供日后学习与研究。本实验主要将利用人脸识别开源项目SeetaFace,结合使用OpenCV工具,结合VS2017与Qt实现一个人脸识别的小项目。最后对实验系统进行测试评估。 3 | 本Demo博客https://blog.csdn.net/Young__Fan/article/details/81385612 4 | -------------------------------------------------------------------------------- /SeetaFaceHeader/FaceIdentification/aligner.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 Identification module, containing codes implementing the 7 | * face identification method described in the following paper: 8 | * 9 | * 10 | * VIPLFaceNet: An Open Source Deep Face Recognition SDK, 11 | * Xin Liu, Meina Kan, Wanglong Wu, Shiguang Shan, Xilin Chen. 12 | * In Frontiers of Computer Science. 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 Wanglong 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 | #ifndef ALIGNER_H_ 32 | #define ALIGNER_H_ 33 | 34 | #include "common.h" 35 | #include "common_net.h" 36 | #include "net.h" 37 | 38 | namespace seeta { 39 | class Aligner { 40 | public: 41 | Aligner(); 42 | Aligner(int crop_height, int crop_width, std::string type = "bicubic"); 43 | ~Aligner(); 44 | // Alignment and return to a ImageData 45 | void Alignment(const ImageData &src_img, 46 | const float* const llpoint, 47 | const ImageData &dst_img); 48 | // Alignment and return to a Blob 49 | void Alignment(const ImageData &src_img, 50 | const float* const llpoint, 51 | Blob* const dst_blob); 52 | 53 | void set_height(int height) { crop_height_ = height; } 54 | void set_width(int width) {crop_width_ = width; } 55 | 56 | int crop_height() { return crop_height_; } 57 | int crop_width() { return crop_width_; } 58 | private: 59 | int crop_height_; 60 | int crop_width_; 61 | std::shared_ptr net_; 62 | }; 63 | } // namespace 64 | #endif // ALIGNER_H_ 65 | -------------------------------------------------------------------------------- /SeetaFaceHeader/FaceIdentification/bias_adder_net.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 Identification module, containing codes implementing the 7 | * face identification method described in the following paper: 8 | * 9 | * 10 | * VIPLFaceNet: An Open Source Deep Face Recognition SDK, 11 | * Xin Liu, Meina Kan, Wanglong Wu, Shiguang Shan, Xilin Chen. 12 | * In Frontiers of Computer Science. 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 Mengru Zhang(a M.S. 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 | #ifndef BIAS_ADDER_NET_H_ 32 | #define BIAS_ADDER_NET_H_ 33 | 34 | #include "net.h" 35 | #include "net_factory.h" 36 | 37 | class BiasAdderNet : public Net { 38 | public: 39 | BiasAdderNet():Net() {} 40 | virtual ~BiasAdderNet(){} 41 | virtual void SetUp(); 42 | virtual void Execute(); 43 | }; 44 | #endif // BIAS_ADDER_NET_H_ 45 | -------------------------------------------------------------------------------- /SeetaFaceHeader/FaceIdentification/blob.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 Identification module, containing codes implementing the 7 | * face identification method described in the following paper: 8 | * 9 | * 10 | * VIPLFaceNet: An Open Source Deep Face Recognition SDK, 11 | * Xin Liu, Meina Kan, Wanglong Wu, Shiguang Shan, Xilin Chen. 12 | * In Frontiers of Computer Science. 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 Wanglong 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 BLOB_H_ 33 | #define BLOB_H_ 34 | #include "log.h" 35 | #include "viplnet.h" 36 | 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | // basic computational unit 43 | 44 | class Blob { 45 | public: 46 | Blob(); 47 | Blob(const Blob &source); 48 | Blob(int n, int c, int h, int w); 49 | Blob(int n, int c, int h, int w, float* data); 50 | Blob(FILE* file); 51 | 52 | virtual ~Blob(); 53 | void reshape(int n, int c, int h, int w); 54 | void Permute(int dim1, int dim2, int dim3, int dim4); 55 | void Release(); 56 | inline int offset(const int n, const int c=0, const int h=0, 57 | const int w=0) const { 58 | if (n < 0 || n >= num() || c < 0 || c >= channels() || 59 | h < 0 || h >= height() || w < 0 || w >= width()) { 60 | LOG(ERROR) 61 | << "Index: (" << n << ", " << c << ", " << h << ", " << w << "), " 62 | << "Bound: [" << num() << ", " << channels() << ", " << height() 63 | <<", " << width() << "]."; 64 | exit(0); 65 | } 66 | return ((n * channels() + c) * height() + h) * width() + w; 67 | } 68 | void SetData(); 69 | void SetData(Blob &source); 70 | void SetData(int n, int c, int h, int w); 71 | void CopyData(int n, int c, int h, int w, const float* const data); 72 | // copy data from unsigned char 73 | void CopyData(int n, int c, int h, int w, const unsigned char* const data); 74 | // copy data to unsigned char 75 | void CopyTo(unsigned char* const data); 76 | // copy data to float 77 | void CopyTo(float* const data); 78 | void ToFile(const std::string file_name); 79 | void ToBinaryFile(const std::string file_name); 80 | 81 | inline const float operator [](int i) const { 82 | return data_.get()[i]; 83 | } 84 | inline float & operator [](int i) { 85 | return data_.get()[i]; 86 | } 87 | 88 | inline int num() const { return shape(0); } 89 | inline int channels() const { return shape(1); } 90 | inline int height() const { return shape(2); } 91 | inline int width() const { return shape(3); } 92 | inline std::vector shape() const { return shape_; } 93 | int count() const { return count_; } 94 | std::shared_ptr data() const { return data_; } 95 | private: 96 | inline int shape(int index) const { 97 | return index < shape_.size() ? shape_[index] : 1; 98 | } 99 | std::shared_ptr data_; 100 | std::vector shape_; 101 | int count_; 102 | }; 103 | 104 | #endif // BLOB_H_ 105 | -------------------------------------------------------------------------------- /SeetaFaceHeader/FaceIdentification/bn_net.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 Identification module, containing codes implementing the 7 | * face identification method described in the following paper: 8 | * 9 | * 10 | * VIPLFaceNet: An Open Source Deep Face Recognition SDK, 11 | * Xin Liu, Meina Kan, Wanglong Wu, Shiguang Shan, Xilin Chen. 12 | * In Frontiers of Computer Science. 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 Mengru Zhang(a M.S. 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 BN_NET_H_ 33 | #define BN_NET_H_ 34 | 35 | #include "net.h" 36 | #include "net_factory.h" 37 | 38 | class BnNet : public Net { 39 | public: 40 | BnNet(): Net() {} 41 | virtual ~BnNet() {} 42 | virtual void SetUp(); 43 | virtual void Execute(); 44 | 45 | private: 46 | float epsilon_; 47 | }; 48 | 49 | 50 | # endif //BN_NET_H_ 51 | -------------------------------------------------------------------------------- /SeetaFaceHeader/FaceIdentification/common.h: -------------------------------------------------------------------------------- 1 | #ifndef SEETA_COMMON_H_ 2 | #define SEETA_COMMON_H_ 3 | 4 | #include 5 | 6 | #if defined (_MSC_VER) || defined (_WIN32) || defined (_WIN64) 7 | #ifndef SEETA_EXPORTS 8 | #define SEETA_API __declspec(dllexport) 9 | #else 10 | #define SEETA_API __declspec(dllimport) 11 | #endif // SEETA_API 12 | #else // defined (windows) 13 | #define SEETA_API 14 | #endif 15 | 16 | #define DISABLE_COPY_AND_ASSIGN(classname) \ 17 | private: \ 18 | classname(const classname&); \ 19 | classname& operator=(const classname&) 20 | 21 | #ifdef USE_OPENMP 22 | #include 23 | 24 | #define SEETA_NUM_THREADS 4 25 | #endif 26 | 27 | namespace seeta { 28 | 29 | typedef struct ImageData { 30 | ImageData() { 31 | data = nullptr; 32 | width = 0; 33 | height = 0; 34 | num_channels = 0; 35 | } 36 | 37 | ImageData(int32_t img_width, int32_t img_height, 38 | int32_t img_num_channels = 1) { 39 | data = nullptr; 40 | width = img_width; 41 | height = img_height; 42 | num_channels = img_num_channels; 43 | } 44 | 45 | uint8_t* data; 46 | int32_t width; 47 | int32_t height; 48 | int32_t num_channels; 49 | } ImageData; 50 | 51 | typedef struct Rect { 52 | int32_t x; 53 | int32_t y; 54 | int32_t width; 55 | int32_t height; 56 | } Rect; 57 | 58 | typedef struct FaceInfo { 59 | seeta::Rect bbox; 60 | 61 | double roll; 62 | double pitch; 63 | double yaw; 64 | 65 | double score; /**< Larger score should mean higher confidence. */ 66 | } FaceInfo; 67 | 68 | typedef struct { 69 | double x; 70 | double y; 71 | } FacialLandmark; 72 | } // namespace seeta 73 | 74 | #endif // SEETA_COMMON_H_ 75 | 76 | -------------------------------------------------------------------------------- /SeetaFaceHeader/FaceIdentification/common_net.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 Identification module, containing codes implementing the 7 | * face identification method described in the following paper: 8 | * 9 | * 10 | * VIPLFaceNet: An Open Source Deep Face Recognition SDK, 11 | * Xin Liu, Meina Kan, Wanglong Wu, Shiguang Shan, Xilin Chen. 12 | * In Frontiers of Computer Science. 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 Wanglong 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 COMMON_NET_H_ 33 | #define COMMON_NET_H_ 34 | 35 | #include "blob.h" 36 | #include "log.h" 37 | #include "net_factory.h" 38 | #include "net.h" 39 | 40 | #include 41 | 42 | class CommonNet : public Net { 43 | public: 44 | CommonNet(); 45 | ~CommonNet(); 46 | // load model 47 | static std::shared_ptr Load(FILE* file); 48 | // initialize the networks from a binary file 49 | virtual void SetUp(); 50 | // execute the networks 51 | virtual void Execute(); 52 | }; 53 | 54 | #endif // COMMON_NET_H_ 55 | -------------------------------------------------------------------------------- /SeetaFaceHeader/FaceIdentification/conv_net.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 Identification module, containing codes implementing the 7 | * face identification method described in the following paper: 8 | * 9 | * 10 | * VIPLFaceNet: An Open Source Deep Face Recognition SDK, 11 | * Xin Liu, Meina Kan, Wanglong Wu, Shiguang Shan, Xilin Chen. 12 | * In Frontiers of Computer Science. 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 Zining Xu(a M.S. 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 CONV_NET_H_ 33 | #define CONV_NET_H_ 34 | 35 | #include "net.h" 36 | #include "net_factory.h" 37 | 38 | #include 39 | #include 40 | #include 41 | 42 | class ConvNet: public Net { 43 | public: 44 | ConvNet(): Net() {} 45 | virtual ~ConvNet() {} 46 | virtual void SetUp(); 47 | virtual void Execute(); 48 | 49 | protected: 50 | int stride_h_; 51 | int stride_w_; 52 | }; 53 | 54 | #endif //CONV_NET_H_ 55 | 56 | -------------------------------------------------------------------------------- /SeetaFaceHeader/FaceIdentification/eltwise_net.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 | * VIPLFaceNet: An Open Source Deep Face Recognition SDK, 11 | * Xin Liu, Meina Kan, Wanglong Wu, Shiguang Shan, Xilin Chen. 12 | * In Frontiers of Computer Science. 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 Wanglong 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 _ELTWISE_NET_H 33 | #define _ELTWISE_NET_H 34 | 35 | #include "net.h" 36 | #include "net_factory.h" 37 | #include 38 | 39 | class EltwiseNet: public Net { 40 | public: 41 | EltwiseNet(): Net() {} 42 | virtual ~EltwiseNet() {} 43 | virtual void SetUp(); 44 | virtual void Execute(); 45 | protected: 46 | std::string op_; 47 | float scale_; 48 | float upper_; 49 | float lower_; 50 | }; 51 | 52 | #endif // _ELTWISE_NET_H 53 | -------------------------------------------------------------------------------- /SeetaFaceHeader/FaceIdentification/face_identification.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 Identification module, containing codes implementing the 7 | * face identification method described in the following paper: 8 | * 9 | * 10 | * VIPLFaceNet: An Open Source Deep Face Recognition SDK, 11 | * Xin Liu, Meina Kan, Wanglong Wu, Shiguang Shan, Xilin Chen. 12 | * In Frontiers of Computer Science. 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 Wanglong 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_FACE_IDENTIFICATION_H_ 33 | #define SEETA_FACE_IDENTIFICATION_H_ 34 | 35 | 36 | #include "common.h" 37 | 38 | typedef float* FaceFeatures; 39 | 40 | namespace seeta { 41 | class FaceIdentification { 42 | public: 43 | // For cropping face only, you don't need a identification model, modelPath \ 44 | can be set NULL. 45 | // For identification, you need to create a 'FaceIdentification' object with \ 46 | the path of identification model, or call function 'LoadModel' after create \ 47 | an object. 48 | SEETA_API FaceIdentification(const char* model_path = nullptr); 49 | 50 | SEETA_API ~FaceIdentification(); 51 | 52 | // If you create an 'FaceIdentification' object without identification model \ 53 | , you need to call LoadModel for recognition use. 54 | SEETA_API uint32_t LoadModel(const char* model_path); 55 | 56 | // Get feature's dimension. 57 | SEETA_API uint32_t feature_size(); 58 | 59 | // Get cropping face width. 60 | SEETA_API uint32_t crop_width(); 61 | 62 | // Get cropping face height. 63 | SEETA_API uint32_t crop_height(); 64 | 65 | // Get cropping face channel. 66 | SEETA_API uint32_t crop_channels(); 67 | 68 | // Crop face with 3-channels image and 5 located landmark points. 69 | // 'dst_image' can be initialized as a cv::Mat which cols equal to \ 70 | crop_width(), rows equal to crop_height() and channels equal to \ 71 | crop_channels(). 72 | SEETA_API uint8_t CropFace(const ImageData &src_image, 73 | const FacialLandmark *llpoint, 74 | const ImageData &dst_image); 75 | 76 | // Extract feature with a cropping face. 77 | // 'feats' must be initialized with size of feature_size(). 78 | SEETA_API uint8_t ExtractFeature(const ImageData &crop_image, 79 | FaceFeatures const feats); 80 | 81 | // Extract feature for face in a 3-channels image given 5 located landmark \ 82 | points. 83 | // 'feats' must be initialized with size of GetFeatureSize(). 84 | SEETA_API uint8_t ExtractFeatureWithCrop(const ImageData &src_image, 85 | const FacialLandmark *llpoint, 86 | FaceFeatures const feats); 87 | 88 | // Calculate similarity of face features fc1 and fc2. 89 | // dim = -1 default feature size 90 | SEETA_API float CalcSimilarity(FaceFeatures const fc1, 91 | FaceFeatures const fc2, 92 | long dim = -1); 93 | 94 | private: 95 | class Recognizer; 96 | Recognizer* recognizer; 97 | }; 98 | } 99 | #endif // SEETA_FACE_IDENTIFICATION_H_ 100 | -------------------------------------------------------------------------------- /SeetaFaceHeader/FaceIdentification/hyper_param.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 Identification module, containing codes implementing the 7 | * face identification method described in the following paper: 8 | * 9 | * 10 | * VIPLFaceNet: An Open Source Deep Face Recognition SDK, 11 | * Xin Liu, Meina Kan, Wanglong Wu, Shiguang Shan, Xilin Chen. 12 | * In Frontiers of Computer Science. 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 Wanglong 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 HYPER_PARAM_H_ 33 | #define HYPER_PARAM_H_ 34 | 35 | #include "log.h" 36 | 37 | #include 38 | #include 39 | #include 40 | 41 | #define PARAM_INT 1 42 | #define PARAM_FLOAT 2 43 | #define PARAM_STRING 3 44 | 45 | class HyperParam { 46 | public: 47 | HyperParam() { 48 | params_.clear(); 49 | v_int_.reserve(20); 50 | v_float_.reserve(20); 51 | v_str_.reserve(20); 52 | } 53 | void Load(FILE* file) { 54 | std::string param_name = read_str(file); 55 | while (param_name.compare("end") != 0) { 56 | int type; 57 | CHECK_EQ(fread(&type, sizeof(int), 1, file), 1); 58 | if (type == PARAM_INT) { 59 | InsertInt(param_name, read_int(file)); 60 | } 61 | else if (type == PARAM_FLOAT) { 62 | InsertFloat(param_name, read_float(file)); 63 | } 64 | else if (type == PARAM_STRING) { 65 | InsertString(param_name, read_str(file)); 66 | } 67 | param_name = read_str(file); 68 | } 69 | } 70 | void ToBinaryFile(FILE* file) { 71 | 72 | } 73 | ~HyperParam() { 74 | params_.clear(); 75 | v_int_.clear(); 76 | v_float_.clear(); 77 | v_str_.clear(); 78 | } 79 | bool has_param(std::string param_name) { 80 | return params_.count(param_name) != 0; 81 | } 82 | void* param(std::string param_name) { 83 | if (!has_param(param_name)) { 84 | LOG(ERROR) << "Param name " << param_name << " not exists."; 85 | } 86 | return params_[param_name]; 87 | } 88 | void InsertInt(const std::string& key, const int value) { 89 | if (params_.count(key) != 0) { 90 | LOG(ERROR) << "Param name " << key << " already exists."; 91 | exit(0); 92 | } 93 | v_int_.push_back(value); 94 | params_[key] = &(v_int_.back()); 95 | LOG(INFO) << key << ": " << value; 96 | } 97 | void InsertFloat(const std::string& key, const float value) { 98 | if (params_.count(key) != 0) { 99 | LOG(ERROR) << "Param name " << key << " already exists."; 100 | exit(0); 101 | } 102 | v_float_.push_back(value); 103 | params_[key] = &(v_float_.back()); 104 | LOG(INFO) << key << ": " << value; 105 | } 106 | void InsertString(const std::string& key, const std::string& value) { 107 | if (params_.count(key) != 0) { 108 | LOG(ERROR) << "Param name " << key << " already exists."; 109 | exit(0); 110 | } 111 | v_str_.push_back(value); 112 | params_[key] = &(v_str_.back()); 113 | LOG(INFO) << key << ": " << value; 114 | } 115 | private: 116 | std::string read_str(FILE* file) { 117 | int len; 118 | CHECK_EQ(fread(&len, sizeof(int), 1, file), 1); 119 | if (len <= 0) return ""; 120 | char* c_str = new char[len + 1]; 121 | CHECK_EQ(fread(c_str, sizeof(char), len, file), len); 122 | c_str[len] = '\0'; 123 | std::string str(c_str); 124 | delete []c_str; 125 | return str; 126 | } 127 | int read_int(FILE* file) { 128 | int i; 129 | CHECK_EQ(fread(&i, sizeof(int), 1, file), 1); 130 | return i; 131 | } 132 | float read_float(FILE* file) { 133 | float f; 134 | CHECK_EQ(fread(&f, sizeof(int), 1, file), 1); 135 | return f; 136 | } 137 | int num_; 138 | std::map params_; 139 | std::vector v_int_; 140 | std::vector v_float_; 141 | std::vector v_str_; 142 | }; 143 | 144 | #endif //HYPER_PARAM_H_ 145 | -------------------------------------------------------------------------------- /SeetaFaceHeader/FaceIdentification/inner_product_net.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 Identification module, containing codes implementing the 7 | * face identification method described in the following paper: 8 | * 9 | * 10 | * VIPLFaceNet: An Open Source Deep Face Recognition SDK, 11 | * Xin Liu, Meina Kan, Wanglong Wu, Shiguang Shan, Xilin Chen. 12 | * In Frontiers of Computer Science. 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 Zining Xu(a M.S. 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 INNER_PRODUCT_NET_H_ 33 | #define INNER_PRODUCT_NET_H_ 34 | 35 | #include "net.h" 36 | #include "net_factory.h" 37 | 38 | #include 39 | #include 40 | #include 41 | 42 | class InnerProductNet: public Net { 43 | public: 44 | InnerProductNet(): Net() {} 45 | virtual ~InnerProductNet() {} 46 | virtual void SetUp(); 47 | virtual void Execute(); 48 | 49 | protected: 50 | }; 51 | 52 | #endif //INNER_PRODUCT_NET_H_ 53 | 54 | -------------------------------------------------------------------------------- /SeetaFaceHeader/FaceIdentification/log.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 Identification module, containing codes implementing the 7 | * face identification method described in the following paper: 8 | * 9 | * 10 | * VIPLFaceNet: An Open Source Deep Face Recognition SDK, 11 | * Xin Liu, Meina Kan, Wanglong Wu, Shiguang Shan, Xilin Chen. 12 | * In Frontiers of Computer Science. 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 Wanglong 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 LOG_H_ 33 | #define LOG_H_ 34 | 35 | #include "viplnet.h" 36 | 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | #if defined(__unix__) || defined(__APPLE__) 44 | #define _BEGIN_INFO_ "\033[1;32m" 45 | #define _BEGIN_ERROR_ "\033[1;31m" 46 | #define _BEGIN_DEBUG_ "\033[1;33m" 47 | #define _END_COLOR_ "\033[0m" 48 | 49 | #define ERROR _BEGIN_ERROR_ "[ERROR] " 50 | #define DEBUG _BEGIN_DEBUG_ "[DEBUG] " 51 | #define INFO _BEGIN_INFO_ "[INFO ] " 52 | #define __FILENAME__ (strrchr(__FILE__, '/') ? (strrchr(__FILE__, '/') + 1) \ 53 | :__FILE__) 54 | #else 55 | #define _BEGIN_INFO_ "LOG_COLOR_G" 56 | #define _BEGIN_ERROR_ "LOG_COLOR_R" 57 | #define _BEGIN_DEBUG_ "LOG_COLOR_Y" 58 | #define _END_COLOR_ "LOG_COLOR_W" 59 | 60 | #define ERROR _BEGIN_ERROR_ "[ERROR] " 61 | #define DEBUG _BEGIN_DEBUG_ "[DEBUG] " 62 | #define INFO _BEGIN_INFO_ "[INFO ] " 63 | #define __FILENAME__ (strrchr(__FILE__, '\\') ? (strrchr(__FILE__, '\\') + 1) \ 64 | :__FILE__) 65 | #endif // __unix__, __APPLE__ 66 | 67 | class ViplLog { 68 | public: 69 | template 70 | ViplLog(const T &options) { 71 | my_cout_ << options; 72 | } 73 | ~ViplLog(); 74 | template 75 | inline ViplLog &operator << (const T &x) { 76 | #ifdef __VIPL_LOG__ 77 | my_cout_ << x; 78 | #endif 79 | return *this; 80 | } 81 | private: 82 | std::ostringstream my_cout_; 83 | }; 84 | 85 | #define LOG(OPTION) ViplLog(OPTION) << "[" << __FILENAME__ << ":" << \ 86 | __LINE__ << "] " << _END_COLOR_ 87 | 88 | // check A == B 89 | #define CHECK_EQ(A, B) if ((A) != (B)) LOG(ERROR) << "Check failed:" << "(" \ 90 | << #A << " == " << #B << ") " << "(" << A << " vs. " << B <<") " << "Inputs " \ 91 | << #A<<" must be equal " << #B << "." 92 | 93 | // check A != B 94 | #define CHECK_NE(A, B) if ((A) == (B)) LOG(ERROR) << "Check failed:" << "(" \ 95 | << #A << " != " << #B << ") " << "(" << A << " vs. " << B <<") " << "Inputs " \ 96 | << #A<<" must be not equal " << #B << "." 97 | 98 | // check A < B 99 | #define CHECK_LT(A, B) if ((A) >= (B)) LOG(ERROR) << "Check failed:" << "(" \ 100 | << #A << " < " << #B << ") " << "(" << A << " vs. " << B <<") " << "Inputs " \ 101 | << #A <<" must be less than " << #B <<"." 102 | 103 | // check A > B 104 | #define CHECK_GT(A, B) if ((A) <= (B)) LOG(ERROR) << "Check failed:" << "(" \ 105 | << #A << " > " << #B << ") " << "(" << A << " vs. " << B <<") " << "Inputs " \ 106 | << #A << " must be great than " << #B << "." 107 | 108 | // check A <= B 109 | #define CHECK_LE(A, B) if ((A) > (B)) LOG(ERROR) << "Check failed:" << "(" \ 110 | << #A << " <= " << #B << ") " << "(" << A << " vs. " << B <<") " << "Inputs "\ 111 | << #A <<" must be less than or equal to " << #B <<"." 112 | 113 | // check A >= B 114 | #define CHECK_GE(A, B) if ((A) < (B)) LOG(ERROR) << "Check failed:" << "(" \ 115 | << #A << " >= " << #B << ") " << "(" << A << " vs. " << B <<") " << "Inputs " \ 116 | << #A << " must be great than or equal to " << #B << "." 117 | 118 | // check int A is near to int B 119 | #define CHECK_INT_NEAR(A, B, C) if (abs(A-B) > C) LOG(ERROR) << "Check failed:"\ 120 | << #A << " is not near to " << #B << " within the range " << #C <<"." 121 | 122 | // check double A is neart to double B 123 | #define CHECK_DOUBLE_NEAR(A, B, C) if (fabs(A-B) > C) LOG(ERROR) \ 124 | << "Check failed: " << #A << " is not near to " << #B << " within the range " \ 125 | << #C <<"." 126 | 127 | // check A is true 128 | #define CHECK_TRUE(A) if (!(A)) LOG(ERROR) << "Check failed:" << "(" << #A \ 129 | << " Must be true" << ")." 130 | 131 | #endif // LOG_H_ 132 | -------------------------------------------------------------------------------- /SeetaFaceHeader/FaceIdentification/math_functions.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 Identification module, containing codes implementing the 7 | * face identification method described in the following paper: 8 | * 9 | * 10 | * VIPLFaceNet: An Open Source Deep Face Recognition SDK, 11 | * Xin Liu, Meina Kan, Wanglong Wu, Shiguang Shan, Xilin Chen. 12 | * In Frontiers of Computer Science. 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 Zining Xu(a M.S. 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 MATH_FUNCTIONS_H_ 33 | #define MATH_FUNCTIONS_H_ 34 | 35 | #include "log.h" 36 | 37 | #ifdef _BLAS 38 | #ifdef _WIN64 39 | #pragma comment( lib, "blas_win64_MT" ) 40 | #pragma comment( lib, "lapack_win64_MT" ) 41 | #else 42 | #pragma comment( lib, "libblas" ) 43 | #pragma comment( lib, "liblapack" ) 44 | #endif 45 | #include 46 | #endif 47 | 48 | float simd_dot(const float* x, const float* y, const long& len); 49 | 50 | // matrix product: 51 | // MA = ta ? A^T : A; 52 | // MB = tb ? B^T : B; 53 | // return C(n, m) = MA(n, k) * MB(k, m); 54 | void matrix_procuct(const float* A, const float* B, float* C, const int n, 55 | const int m, const int k, bool ta = false, bool tb = false); 56 | 57 | #endif // MATH_FUNCTIONS_H_ 58 | -------------------------------------------------------------------------------- /SeetaFaceHeader/FaceIdentification/max_pooling_net.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 Identification module, containing codes implementing the 7 | * face identification method described in the following paper: 8 | * 9 | * 10 | * VIPLFaceNet: An Open Source Deep Face Recognition SDK, 11 | * Xin Liu, Meina Kan, Wanglong Wu, Shiguang Shan, Xilin Chen. 12 | * In Frontiers of Computer Science. 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 Zining Xu(a M.S. 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 MAX_POOLING_NET_H_ 33 | #define MAX_POOLING_NET_H_ 34 | 35 | #include "net.h" 36 | #include "net_factory.h" 37 | 38 | #include 39 | #include 40 | #include 41 | 42 | class MaxPoolingNet: public Net { 43 | public: 44 | MaxPoolingNet(): Net() {} 45 | virtual ~MaxPoolingNet() {} 46 | virtual void SetUp(); 47 | virtual void Execute(); 48 | 49 | protected: 50 | int kernel_h_; 51 | int kernel_w_; 52 | int stride_h_; 53 | int stride_w_; 54 | }; 55 | 56 | #endif //MAX_POOLING_NET_H_ 57 | 58 | -------------------------------------------------------------------------------- /SeetaFaceHeader/FaceIdentification/net.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 Identification module, containing codes implementing the 7 | * face identification method described in the following paper: 8 | * 9 | * 10 | * VIPLFaceNet: An Open Source Deep Face Recognition SDK, 11 | * Xin Liu, Meina Kan, Wanglong Wu, Shiguang Shan, Xilin Chen. 12 | * In Frontiers of Computer Science. 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 Wanglong 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 NET_H_ 33 | #define NET_H_ 34 | 35 | #include "viplnet.h" 36 | #include "blob.h" 37 | #include "log.h" 38 | #include "hyper_param.h" 39 | 40 | #include 41 | 42 | class Net { 43 | public: 44 | Net(); 45 | virtual ~Net(); 46 | // initialize the networks from a binary file 47 | virtual void SetUp(); 48 | // execute the networks 49 | virtual void Execute() = 0; 50 | 51 | // check input blobs 52 | virtual void CheckInput(); 53 | 54 | // check output blobs 55 | virtual void CheckOutput(); 56 | 57 | virtual void Release() { 58 | for (int i = 0; i < output_blobs_.size(); ++i) 59 | output_blobs_[i].Release(); 60 | } 61 | 62 | Net* const father() { 63 | return father_; 64 | } 65 | void SetFather(Net* father) { 66 | father_ = father; 67 | } 68 | std::vector >& nets() { 69 | return nets_; 70 | } 71 | std::shared_ptr nets(int i) { 72 | return nets_[i]; 73 | } 74 | std::vector& input_blobs() { 75 | return input_blobs_; 76 | } 77 | Blob* input_blobs(int i) { 78 | return &(input_blobs_[i]); 79 | } 80 | std::vector& output_blobs() { 81 | return output_blobs_; 82 | } 83 | Blob* output_blobs(int i) { 84 | return &(output_blobs_[i]); 85 | } 86 | std::vector >& output_plugs() { 87 | return output_plugs_; 88 | } 89 | std::vector& output_plugs(int i) { 90 | return output_plugs_[i]; 91 | } 92 | std::vector >& input_plugs() { 93 | return input_plugs_; 94 | } 95 | std::vector& input_plugs(int i) { 96 | return input_plugs_[i]; 97 | } 98 | HyperParam* hyper_param() { 99 | return &hyper_params_; 100 | } 101 | std::vector& params() { 102 | return params_; 103 | } 104 | Blob* params(int i) { 105 | return &(params_[i]); 106 | } 107 | // count the number of unreleased output blobs 108 | inline int num_output() { 109 | int count = 0; 110 | for (int i = 0; i < output_blobs_.size(); ++ i) 111 | if (output_plugs_[i].size() == 0) count += 1; 112 | return count; 113 | } 114 | protected: 115 | // father net 116 | Net* father_; 117 | // the limit of net name size 118 | static const int MAX_NET_NAME_SIZE = 50; 119 | // net name 120 | std::string name_; 121 | 122 | // input and output blobs 123 | std::vector input_blobs_; 124 | std::vector output_blobs_; 125 | 126 | // subnet of the networks 127 | std::vector > nets_; 128 | 129 | // plugs 130 | std::vector > output_plugs_; 131 | std::vector > input_plugs_; 132 | 133 | // params in the networks 134 | HyperParam hyper_params_; 135 | std::vector params_; 136 | }; 137 | 138 | #endif //NET_H_ 139 | -------------------------------------------------------------------------------- /SeetaFaceHeader/FaceIdentification/net_factory.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 Identification module, containing codes implementing the 7 | * face identification method described in the following paper: 8 | * 9 | * 10 | * VIPLFaceNet: An Open Source Deep Face Recognition SDK, 11 | * Xin Liu, Meina Kan, Wanglong Wu, Shiguang Shan, Xilin Chen. 12 | * In Frontiers of Computer Science. 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 Wanglong 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 NET_FACTORY_H_ 33 | #define NET_FACTORY_H_ 34 | 35 | #include "net.h" 36 | 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | class NetRegistry { 43 | public: 44 | typedef std::shared_ptr (*Creator)(); 45 | typedef std::map CreatorRegistry; 46 | 47 | static CreatorRegistry& Registry() { 48 | static CreatorRegistry* g_registry_ = new CreatorRegistry(); 49 | return *g_registry_; 50 | } 51 | 52 | static void AddCreator(const std::string& type, Creator creator) { 53 | CreatorRegistry& registry = Registry(); 54 | if (registry.count(type) != 0) { 55 | LOG(INFO) << "Net type " << type << " already registered."; 56 | } 57 | registry[type] = creator; 58 | } 59 | 60 | static std::shared_ptr CreateNet(const std::string type) { 61 | CreatorRegistry& registry = Registry(); 62 | if (registry.count(type) != 1) { 63 | LOG(ERROR) << "Net type " << type << " haven't registered."; 64 | } 65 | return registry[type](); 66 | } 67 | private: 68 | NetRegistry() {} 69 | 70 | }; 71 | 72 | class NetRegisterer { 73 | public: 74 | NetRegisterer(const std::string& type, 75 | std::shared_ptr (*creator)()) { 76 | LOG(INFO) << "Registering net type: " << type; 77 | NetRegistry::AddCreator(type, creator); 78 | } 79 | }; 80 | 81 | #define REGISTER_NET_CREATOR(type, creator) \ 82 | static NetRegisterer g_creator_##type(#type, creator) 83 | 84 | #define REGISTER_NET_CLASS(type) \ 85 | std::shared_ptr Creator_##type##Net() \ 86 | { \ 87 | return std::shared_ptr(new type##Net()); \ 88 | } \ 89 | REGISTER_NET_CREATOR(type, Creator_##type##Net); \ 90 | static type##Net type 91 | #endif //NET_FACTORY_H_ 92 | -------------------------------------------------------------------------------- /SeetaFaceHeader/FaceIdentification/pad_net.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 Identification module, containing codes implementing the 7 | * face identification method described in the following paper: 8 | * 9 | * 10 | * VIPLFaceNet: An Open Source Deep Face Recognition SDK, 11 | * Xin Liu, Meina Kan, Wanglong Wu, Shiguang Shan, Xilin Chen. 12 | * In Frontiers of Computer Science. 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 Wanglong 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 PAD_NET_H_ 33 | #define PAD_NET_H_ 34 | 35 | #include "net.h" 36 | #include "net_factory.h" 37 | 38 | #include 39 | #include 40 | #include 41 | 42 | class PadNet: public Net { 43 | public: 44 | PadNet(): Net() {} 45 | virtual ~PadNet() {} 46 | virtual void SetUp(); 47 | virtual void Execute(); 48 | 49 | protected: 50 | int left_, right_, bottom_, top_; 51 | }; 52 | 53 | #endif //PAD_NET_H_ 54 | -------------------------------------------------------------------------------- /SeetaFaceHeader/FaceIdentification/recognizer.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 Identification module, containing codes implementing the 7 | * face identification method described in the following paper: 8 | * 9 | * 10 | * VIPLFaceNet: An Open Source Deep Face Recognition SDK, 11 | * Xin Liu, Meina Kan, Wanglong Wu, Shiguang Shan, Xilin Chen. 12 | * In Frontiers of Computer Science. 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 Wanglong 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 RECOGNIZER_H_ 33 | #define RECOGNIZER_H_ 34 | 35 | #include "face_identification.h" 36 | #include "aligner.h" 37 | #include "common_net.h" 38 | 39 | #include 40 | #include 41 | #include 42 | #include 43 | 44 | namespace seeta { 45 | class FaceIdentification::Recognizer { 46 | public: 47 | Recognizer(const char* model_path = nullptr) { 48 | if (model_path == nullptr) { 49 | crop_width_ = 256; 50 | crop_height_ = 256; 51 | crop_channels_ = 3; 52 | net_ = nullptr; 53 | aligner_.reset(new Aligner(crop_height_, crop_width_, "linear")); 54 | feat_size_ = 0; 55 | } 56 | else { 57 | crop_width_ = 0; 58 | crop_height_ = 0; 59 | crop_channels_ = 0; 60 | net_ = nullptr; 61 | aligner_ = nullptr; 62 | feat_size_ = 0; 63 | LoadModel(model_path); 64 | } 65 | } 66 | 67 | ~Recognizer() { 68 | } 69 | 70 | uint8_t LoadModel(const char* model_path) { 71 | FILE* file = nullptr; 72 | if (fopen_s(&file, model_path, "rb") != 0) { 73 | std::cout<< model_path << " not exist!" << std::endl; 74 | exit(-1); 75 | } 76 | CHECK_EQ(fread(&crop_channels_, sizeof(int), 1, file), 1); 77 | CHECK_EQ(fread(&crop_height_, sizeof(int), 1, file), 1); 78 | CHECK_EQ(fread(&crop_width_, sizeof(int), 1, file), 1); 79 | CHECK_EQ(fread(&feat_size_, sizeof(int), 1, file), 1); 80 | /*if (!aligner_ || crop_height_ != aligner_->CropHeight() 81 | || crop_width_ != aligner_->CropHeight())*/ 82 | aligner_.reset(new Aligner(crop_height_, crop_width_, "linear")); 83 | net_ = CommonNet::Load(file); 84 | return 1; 85 | } 86 | 87 | uint8_t Crop(const ImageData &src_img, const float* const points, 88 | const ImageData &dst_img) { 89 | aligner_->Alignment(src_img, points, dst_img); 90 | return 1; 91 | } 92 | 93 | uint8_t ExtractFeature(unsigned char* const u_data, float* const feat, 94 | int n = 1) { 95 | net_->input_blobs(0)->CopyData(n, crop_height_, crop_width_, 96 | crop_channels_, u_data); 97 | net_->input_blobs(0)->Permute(1, 4, 2, 3); 98 | net_->Execute(); 99 | 100 | net_->output_blobs(0)->CopyTo(feat); 101 | net_->Release(); 102 | return 1; 103 | } 104 | 105 | uint8_t ExtractFeatureWithCrop(const ImageData &src_img, 106 | float* const points, float* const feat) { 107 | // crop 108 | Blob crop_blob; 109 | aligner_->Alignment(src_img, points, &crop_blob); 110 | // extract feature 111 | net_->input_blobs(0)->SetData(crop_blob); 112 | net_->Execute(); 113 | 114 | net_->output_blobs(0)->CopyTo(feat); 115 | net_->Release(); 116 | return 1; 117 | } 118 | 119 | uint8_t ExtractFeature(unsigned char* const u_data, uint16_t* const feat) { 120 | //To do: compress features 121 | return 1; 122 | } 123 | 124 | uint32_t crop_width() { return crop_width_; } 125 | uint32_t crop_height() { return crop_height_; } 126 | uint32_t crop_channels() { return crop_channels_; } 127 | uint32_t crop_mem_size() { return crop_width_ * crop_height_ * crop_channels_; } 128 | uint32_t feature_size() { return feat_size_; } 129 | 130 | private: 131 | std::shared_ptr net_; 132 | std::shared_ptr aligner_; 133 | uint32_t crop_width_; 134 | uint32_t crop_height_; 135 | uint32_t crop_channels_; 136 | 137 | uint32_t feat_size_; 138 | uint8_t isLoadModel() { 139 | return net_ != nullptr; 140 | } 141 | }; 142 | } 143 | #endif // RECOGNIZER_H_ 144 | -------------------------------------------------------------------------------- /SeetaFaceHeader/FaceIdentification/spatial_transform_net.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 Identification module, containing codes implementing the 7 | * face identification method described in the following paper: 8 | * 9 | * 10 | * VIPLFaceNet: An Open Source Deep Face Recognition SDK, 11 | * Xin Liu, Meina Kan, Wanglong Wu, Shiguang Shan, Xilin Chen. 12 | * In Frontiers of Computer Science. 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 Wanglong 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 SPATIAL_TRANSFORM_NET_H_ 33 | #define SPATIAL_TRANSFORM_NET_H_ 34 | 35 | #include "net.h" 36 | #include "net_factory.h" 37 | 38 | class SpatialTransformNet : public Net { 39 | public: 40 | SpatialTransformNet() : Net() {} 41 | virtual ~SpatialTransformNet() {} 42 | virtual void SetUp(); 43 | virtual void Execute(); 44 | 45 | protected: 46 | // sampling for common blob data 47 | virtual double Sampling(const float* const feat_map, int H, int W, double x, 48 | double y, double scale = 1.0); 49 | 50 | // sampling for cv::Mat::data 51 | virtual double Sampling(const unsigned char* const feat_map, int c, int H, 52 | int W, int C, double x, double y, double scale = 1.0); 53 | 54 | virtual double Cubic(double x); 55 | 56 | inline void Norm(std::vector& weights) { 57 | float sum = 0; 58 | for (int i = 0; i < weights.size(); ++ i) 59 | sum += weights[i]; 60 | for (int i = 0; i < weights.size(); ++ i) 61 | weights[i] /= sum; 62 | } 63 | 64 | // transformation type: linear or bicubic 65 | std::string type_; 66 | // whether input with cv::Mat::data 67 | int is_mat_data_; 68 | // output feature map height and width 69 | int new_height_, new_width_; 70 | }; 71 | 72 | #endif //SPATIAL_TRANSFORM_NET_H_ 73 | -------------------------------------------------------------------------------- /SeetaFaceHeader/FaceIdentification/tform_maker_net.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 Identification module, containing codes implementing the 7 | * face identification method described in the following paper: 8 | * 9 | * 10 | * VIPLFaceNet: An Open Source Deep Face Recognition SDK, 11 | * Xin Liu, Meina Kan, Wanglong Wu, Shiguang Shan, Xilin Chen. 12 | * In Frontiers of Computer Science. 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 Wanglong 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 TFORM_MAKER_NET_H_ 33 | #define TFORM_MAKER_NET_H_ 34 | 35 | #include "net.h" 36 | 37 | // Calculate affine transformation according to feature points 38 | class TransformationMakerNet: public Net { 39 | public: 40 | TransformationMakerNet(): Net() {} 41 | virtual ~TransformationMakerNet() {} 42 | virtual void SetUp(); 43 | virtual void Execute(); 44 | protected: 45 | // the number of feature points 46 | int points_num_; 47 | }; 48 | 49 | #endif //TFORM_MAKER_NET_H_ 50 | -------------------------------------------------------------------------------- /SeetaFaceHeader/FaceIdentification/viplnet.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 Identification module, containing codes implementing the 7 | * face identification method described in the following paper: 8 | * 9 | * 10 | * VIPLFaceNet: An Open Source Deep Face Recognition SDK, 11 | * Xin Liu, Meina Kan, Wanglong Wu, Shiguang Shan, Xilin Chen. 12 | * In Frontiers of Computer Science. 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 Shiying Luo(a M.S. 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 VIPLNET_H_ 33 | #define VIPLNET_H_ 34 | 35 | #if defined(__unix__) || defined(__APPLE__) 36 | 37 | #ifndef fopen_s 38 | 39 | #define fopen_s(pFile,filename,mode) ((*(pFile))=fopen((filename),(mode)))==NULL 40 | 41 | #endif //fopen_s 42 | 43 | #endif //__unix__, __APPLE__ 44 | 45 | #endif //VIPLNET_H_ 46 | -------------------------------------------------------------------------------- /SeetaFaceHeader/cfan.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 | #pragma once 33 | #include 34 | #include "sift.h" 35 | #include "common.h" 36 | 37 | class CCFAN{ 38 | public: 39 | /** A constructor. 40 | * Initialize basic parameters. 41 | */ 42 | CCFAN(void); 43 | 44 | /** A destructor which should never be called explicitly. 45 | * Release all dynamically allocated resources. 46 | */ 47 | ~CCFAN(void); 48 | 49 | /** Initialize the facial landmark detection model. 50 | * @param model_path Path of the model file, either absolute or relative to 51 | * the working directory. 52 | */ 53 | void InitModel(const char *model_path); 54 | 55 | /** Detect five facial landmarks, i.e., two eye centers, nose tip and two mouth corners. 56 | * @param gray_im A grayscale image 57 | * @param im_width The width of the inpute image 58 | * @param im_height The height of the inpute image 59 | * @param face_loc The face bounding box 60 | * @param[out] facial_loc The locations of detected facial points 61 | */ 62 | void FacialPointLocate(const unsigned char *gray_im, int im_width, int im_height, seeta::FaceInfo face_loc, float *facial_loc); 63 | 64 | private: 65 | /** Extract shape indexed SIFT features. 66 | * @param gray_im A grayscale image 67 | * @param im_width The width of the inpute image 68 | * @param im_height The height of the inpute image 69 | * @param face_shape The locations of facial points 70 | * @param patch_size The size of the patch used for extracting SIFT feature 71 | * @param[out] sift_fea the extracted shape indexed SIFT features which are concatenated into a vector 72 | */ 73 | void TtSift(const unsigned char *gray_im, int im_width, int im_height, float *face_shape, int patch_size, double *sift_fea); 74 | 75 | /** Extract a image patch which is centered at point(point_x, point_y) with a given patch size. 76 | * @param gray_im A grayscale image 77 | * @param im_width The width of the inpute image 78 | * @param im_height The height of the inpute image 79 | * @param point_x The X coordinate of one point 80 | * @param point_y The Y coordinate of one point 81 | * @param patch_size The size of the extracted patch 82 | * @param[out] sub_img A grayscale image patch 83 | */ 84 | void GetSubImg(const unsigned char *gray_im, int im_width, int im_height, float point_x, float point_y, int patch_size, BYTE *sub_img); 85 | 86 | /** Resize the image by bilinear interpolation. 87 | * @param src_im A source image in grayscale 88 | * @param src_width The width of the source image 89 | * @param src_height The height of the source image 90 | * @param[out] dst_im The target image in grayscale 91 | * @param dst_width The width of the target image 92 | * @param dst_height The height of the target image 93 | */ 94 | bool ResizeImage(const unsigned char *src_im, int src_width, int src_height, 95 | unsigned char* dst_im, int dst_width, int dst_height); 96 | 97 | private: 98 | /*The number of facial points*/ 99 | int pts_num_; 100 | /*The dimension of the shape indexed features*/ 101 | int fea_dim_; 102 | /*The mean face shape containing five landmarks*/ 103 | float *mean_shape_; 104 | 105 | /*The parameters of the first local stacked autoencoder network*/ 106 | float **lan1_w_; 107 | float **lan1_b_; 108 | int *lan1_structure_; 109 | int lan1_size_; 110 | 111 | /*The parameters of the second local stacked autoencoder network*/ 112 | float **lan2_w_; 113 | float **lan2_b_; 114 | int *lan2_structure_; 115 | int lan2_size_; 116 | 117 | }; 118 | 119 | -------------------------------------------------------------------------------- /SeetaFaceHeader/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 | -------------------------------------------------------------------------------- /SeetaFaceHeader/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 | -------------------------------------------------------------------------------- /SeetaFaceHeader/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 | -------------------------------------------------------------------------------- /SeetaFaceHeader/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 | -------------------------------------------------------------------------------- /SeetaFaceHeader/face_detection.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_FACE_DETECTION_H_ 33 | #define SEETA_FACE_DETECTION_H_ 34 | 35 | #include 36 | #include 37 | 38 | #include "common.h" 39 | 40 | namespace seeta { 41 | 42 | class FaceDetection { 43 | public: 44 | SEETA_API explicit FaceDetection(const char* model_path); 45 | SEETA_API ~FaceDetection(); 46 | 47 | /** 48 | * @brief Detect faces on input image. 49 | * 50 | * (1) The input image should be gray-scale, i.e. `num_channels` set to 1. 51 | * (2) Currently this function does not give the Euler angles, which are 52 | * left with invalid values. 53 | */ 54 | SEETA_API std::vector Detect(const seeta::ImageData & img); 55 | 56 | /** 57 | * @brief Set the minimum size of faces to detect. 58 | * 59 | * The minimum size is constrained as no smaller than 20. Invalid values will 60 | * be ignored. 61 | */ 62 | SEETA_API void SetMinFaceSize(int32_t size); 63 | 64 | /** 65 | * @brief Set the maximum size of faces to detect. 66 | * 67 | * The maximum face size actually used is computed as the minimum among: user 68 | * specified size, image width, image height. 69 | */ 70 | SEETA_API void SetMaxFaceSize(int32_t size); 71 | 72 | /** 73 | * @brief Set the factor between adjacent scales of image pyramid. 74 | * 75 | * The value of the factor lies in (0, 1). For example, when it is set as 0.5, 76 | * an input image of size w x h will be resized to 0.5w x 0.5h, 0.25w x 0.25h, 77 | * 0.125w x 0.125h, etc. Invalid values will be ignored. 78 | */ 79 | SEETA_API void SetImagePyramidScaleFactor(float factor); 80 | 81 | /** 82 | * @brief Set the sliding window step in horizontal and vertical directions. 83 | * 84 | * The steps should take positive values, and invalid ones will be ignored. 85 | * Usually a step of 4 is a reasonable choice. 86 | */ 87 | SEETA_API void SetWindowStep(int32_t step_x, int32_t step_y); 88 | 89 | /** 90 | * @brief Set the score thresh of detected faces. 91 | * 92 | * Detections with scores smaller than the threshold will not be returned. 93 | * Typical threshold values include 0.95, 2.8, 4.5. One can adjust the 94 | * threshold based on his or her own test set. 95 | */ 96 | SEETA_API void SetScoreThresh(float thresh); 97 | 98 | DISABLE_COPY_AND_ASSIGN(FaceDetection); 99 | 100 | private: 101 | class Impl; 102 | Impl* impl_; 103 | }; 104 | 105 | } // namespace seeta 106 | 107 | #endif // SEETA_FACE_DETECTION_H_ 108 | -------------------------------------------------------------------------------- /SeetaFaceHeader/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 | -------------------------------------------------------------------------------- /SeetaFaceHeader/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 38 | #include 39 | #include 40 | #include 41 | 42 | #include "classifier.h" 43 | #include "detector.h" 44 | #include "feature_map.h" 45 | #include "model_reader.h" 46 | 47 | namespace seeta { 48 | namespace fd { 49 | 50 | class FuStDetector : public Detector { 51 | public: 52 | FuStDetector() 53 | : wnd_size_(40), slide_wnd_step_x_(4), slide_wnd_step_y_(4), 54 | num_hierarchy_(0) { 55 | wnd_data_buf_.resize(wnd_size_ * wnd_size_); 56 | wnd_data_.resize(wnd_size_ * wnd_size_); 57 | } 58 | 59 | ~FuStDetector() {} 60 | 61 | virtual bool LoadModel(const std::string & model_path); 62 | virtual std::vector Detect(seeta::fd::ImagePyramid* img_pyramid); 63 | 64 | inline virtual void SetWindowSize(int32_t size) { 65 | if (size >= 20) 66 | wnd_size_ = size; 67 | } 68 | 69 | inline virtual void SetSlideWindowStep(int32_t step_x, int32_t step_y) { 70 | if (step_x > 0) 71 | slide_wnd_step_x_ = step_x; 72 | if (step_y > 0) 73 | slide_wnd_step_y_ = step_y; 74 | } 75 | 76 | private: 77 | std::shared_ptr CreateModelReader(seeta::fd::ClassifierType type); 78 | std::shared_ptr CreateClassifier(seeta::fd::ClassifierType type); 79 | std::shared_ptr CreateFeatureMap(seeta::fd::ClassifierType type); 80 | 81 | void GetWindowData(const seeta::ImageData & img, const seeta::Rect & wnd); 82 | 83 | int32_t wnd_size_; 84 | int32_t slide_wnd_step_x_; 85 | int32_t slide_wnd_step_y_; 86 | 87 | int32_t num_hierarchy_; 88 | std::vector hierarchy_size_; 89 | std::vector num_stage_; 90 | std::vector > wnd_src_id_; 91 | 92 | std::vector wnd_data_buf_; 93 | std::vector wnd_data_; 94 | 95 | std::vector > model_; 96 | std::vector > feat_map_; 97 | std::map cls2feat_idx_; 98 | 99 | DISABLE_COPY_AND_ASSIGN(FuStDetector); 100 | }; 101 | 102 | } // namespace fd 103 | } // namespace seeta 104 | 105 | #endif // SEETA_FD_FUST_H_ 106 | -------------------------------------------------------------------------------- /SeetaFaceHeader/image_pyramid.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_UTIL_IMAGE_PYRAMID_H_ 33 | #define SEETA_FD_UTIL_IMAGE_PYRAMID_H_ 34 | 35 | #include 36 | #include 37 | #include 38 | 39 | #include "common.h" 40 | 41 | namespace seeta { 42 | namespace fd { 43 | 44 | static void ResizeImage(const seeta::ImageData & src, seeta::ImageData* dest) { 45 | int32_t src_width = src.width; 46 | int32_t src_height = src.height; 47 | int32_t dest_width = dest->width; 48 | int32_t dest_height = dest->height; 49 | if (src_width == dest_width && src_height == dest_height) { 50 | std::memcpy(dest->data, src.data, src_width * src_height * sizeof(uint8_t)); 51 | return; 52 | } 53 | 54 | double lf_x_scl = static_cast(src_width) / dest_width; 55 | double lf_y_Scl = static_cast(src_height) / dest_height; 56 | const uint8_t* src_data = src.data; 57 | uint8_t* dest_data = dest->data; 58 | 59 | #pragma omp parallel num_threads(SEETA_NUM_THREADS) 60 | { 61 | #pragma omp for nowait 62 | for (int32_t y = 0; y < dest_height; y++) { 63 | for (int32_t x = 0; x < dest_width; x++) { 64 | double lf_x_s = lf_x_scl * x; 65 | double lf_y_s = lf_y_Scl * y; 66 | 67 | int32_t n_x_s = static_cast(lf_x_s); 68 | n_x_s = (n_x_s <= (src_width - 2) ? n_x_s : (src_width - 2)); 69 | int32_t n_y_s = static_cast(lf_y_s); 70 | n_y_s = (n_y_s <= (src_height - 2) ? n_y_s : (src_height - 2)); 71 | 72 | double lf_weight_x = lf_x_s - n_x_s; 73 | double lf_weight_y = lf_y_s - n_y_s; 74 | 75 | double dest_val = (1 - lf_weight_y) * ((1 - lf_weight_x) * 76 | src_data[n_y_s * src_width + n_x_s] + 77 | lf_weight_x * src_data[n_y_s * src_width + n_x_s + 1]) + 78 | lf_weight_y * ((1 - lf_weight_x) * src_data[(n_y_s + 1) * src_width + n_x_s] + 79 | lf_weight_x * src_data[(n_y_s + 1) * src_width + n_x_s + 1]); 80 | 81 | dest_data[y * dest_width + x] = static_cast(dest_val); 82 | } 83 | } 84 | } 85 | } 86 | 87 | class ImagePyramid { 88 | public: 89 | ImagePyramid() 90 | : max_scale_(1.0f), min_scale_(1.0f), 91 | scale_factor_(1.0f), scale_step_(0.8f), 92 | width1x_(0), height1x_(0), 93 | width_scaled_(0), height_scaled_(0), 94 | buf_img_width_(2), buf_img_height_(2), 95 | buf_scaled_width_(2), buf_scaled_height_(2) { 96 | buf_img_ = new uint8_t[buf_img_width_ * buf_img_height_]; 97 | buf_img_scaled_ = new uint8_t[buf_scaled_width_ * buf_scaled_height_]; 98 | } 99 | 100 | ~ImagePyramid() { 101 | delete[] buf_img_; 102 | buf_img_ = nullptr; 103 | 104 | buf_img_width_ = 0; 105 | buf_img_height_ = 0; 106 | 107 | delete[] buf_img_scaled_; 108 | buf_img_scaled_ = nullptr; 109 | 110 | buf_scaled_width_ = 0; 111 | buf_scaled_height_ = 0; 112 | 113 | img_scaled_.data = nullptr; 114 | img_scaled_.width = 0; 115 | img_scaled_.height = 0; 116 | } 117 | 118 | inline void SetScaleStep(float step) { 119 | if (step > 0.0f && step <= 1.0f) 120 | scale_step_ = step; 121 | } 122 | 123 | inline void SetMinScale(float min_scale) { 124 | min_scale_ = min_scale; 125 | } 126 | 127 | inline void SetMaxScale(float max_scale) { 128 | max_scale_ = max_scale; 129 | scale_factor_ = max_scale; 130 | UpdateBufScaled(); 131 | } 132 | 133 | void SetImage1x(const uint8_t* img_data, int32_t width, int32_t height); 134 | 135 | inline float min_scale() const { return min_scale_; } 136 | inline float max_scale() const { return max_scale_; } 137 | 138 | inline seeta::ImageData image1x() { 139 | seeta::ImageData img(width1x_, height1x_, 1); 140 | img.data = buf_img_; 141 | return img; 142 | } 143 | 144 | const seeta::ImageData* GetNextScaleImage(float* scale_factor = nullptr); 145 | 146 | private: 147 | void UpdateBufScaled(); 148 | 149 | float max_scale_; 150 | float min_scale_; 151 | 152 | float scale_factor_; 153 | float scale_step_; 154 | 155 | int32_t width1x_; 156 | int32_t height1x_; 157 | 158 | int32_t width_scaled_; 159 | int32_t height_scaled_; 160 | 161 | uint8_t* buf_img_; 162 | int32_t buf_img_width_; 163 | int32_t buf_img_height_; 164 | 165 | uint8_t* buf_img_scaled_; 166 | int32_t buf_scaled_width_; 167 | int32_t buf_scaled_height_; 168 | 169 | seeta::ImageData img_scaled_; 170 | }; 171 | 172 | } // namespace fd 173 | } // namespace seeta 174 | 175 | #endif // SEETA_FD_UTIL_IMAGE_PYRAMID_H_ 176 | -------------------------------------------------------------------------------- /SeetaFaceHeader/lab_boost_model_reader.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_IO_LAB_BOOST_MODEL_READER_H_ 33 | #define SEETA_FD_IO_LAB_BOOST_MODEL_READER_H_ 34 | 35 | #include 36 | #include 37 | 38 | #include "model_reader.h" 39 | #include "classifier/lab_boosted_classifier.h" 40 | 41 | namespace seeta { 42 | namespace fd { 43 | 44 | class LABBoostModelReader : public ModelReader { 45 | public: 46 | LABBoostModelReader() : ModelReader() {} 47 | virtual ~LABBoostModelReader() {} 48 | 49 | virtual bool Read(std::istream* input, seeta::fd::Classifier* model); 50 | 51 | private: 52 | bool ReadFeatureParam(std::istream* input, 53 | seeta::fd::LABBoostedClassifier* model); 54 | bool ReadBaseClassifierParam(std::istream* input, 55 | seeta::fd::LABBoostedClassifier* model); 56 | 57 | int32_t num_bin_; 58 | int32_t num_base_classifer_; 59 | }; 60 | 61 | } // namespace fd 62 | } // namespace seeta 63 | 64 | #endif // SEETA_FD_IO_LAB_BOOST_MODEL_READER_H_ 65 | -------------------------------------------------------------------------------- /SeetaFaceHeader/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 | -------------------------------------------------------------------------------- /SeetaFaceHeader/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 | -------------------------------------------------------------------------------- /SeetaFaceHeader/math_func.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_UTIL_MATH_FUNC_H_ 33 | #define SEETA_FD_UTIL_MATH_FUNC_H_ 34 | 35 | #ifdef USE_SSE 36 | #include 37 | #endif 38 | 39 | #include 40 | 41 | namespace seeta { 42 | namespace fd { 43 | 44 | class MathFunction { 45 | public: 46 | static inline void UInt8ToInt32(const uint8_t* src, int32_t* dest, 47 | int32_t len) { 48 | for (int32_t i = 0; i < len; i++) 49 | *(dest++) = static_cast(*(src++)); 50 | } 51 | 52 | static inline void VectorAdd(const int32_t* x, const int32_t* y, int32_t* z, 53 | int32_t len) { 54 | int32_t i; 55 | #ifdef USE_SSE 56 | __m128i x1; 57 | __m128i y1; 58 | const __m128i* x2 = reinterpret_cast(x); 59 | const __m128i* y2 = reinterpret_cast(y); 60 | __m128i* z2 = reinterpret_cast<__m128i*>(z); 61 | 62 | for (i = 0; i < len - 4; i += 4) { 63 | x1 = _mm_loadu_si128(x2++); 64 | y1 = _mm_loadu_si128(y2++); 65 | _mm_storeu_si128(z2++, _mm_add_epi32(x1, y1)); 66 | } 67 | for (; i < len; i++) 68 | *(z + i) = (*(x + i)) + (*(y + i)); 69 | #else 70 | for (i = 0; i < len; i++) 71 | *(z + i) = (*(x + i)) + (*(y + i)); 72 | #endif 73 | } 74 | 75 | static inline void VectorSub(const int32_t* x, const int32_t* y, int32_t* z, 76 | int32_t len) { 77 | int32_t i; 78 | #ifdef USE_SSE 79 | __m128i x1; 80 | __m128i y1; 81 | const __m128i* x2 = reinterpret_cast(x); 82 | const __m128i* y2 = reinterpret_cast(y); 83 | __m128i* z2 = reinterpret_cast<__m128i*>(z); 84 | 85 | for (i = 0; i < len - 4; i += 4) { 86 | x1 = _mm_loadu_si128(x2++); 87 | y1 = _mm_loadu_si128(y2++); 88 | 89 | _mm_storeu_si128(z2++, _mm_sub_epi32(x1, y1)); 90 | } 91 | for (; i < len; i++) 92 | *(z + i) = (*(x + i)) - (*(y + i)); 93 | #else 94 | for (i = 0; i < len; i++) 95 | *(z + i) = (*(x + i)) - (*(y + i)); 96 | #endif 97 | } 98 | 99 | static inline void VectorAbs(const int32_t* src, int32_t* dest, int32_t len) { 100 | int32_t i; 101 | #ifdef USE_SSE 102 | __m128i val; 103 | __m128i val_abs; 104 | const __m128i* x = reinterpret_cast(src); 105 | __m128i* y = reinterpret_cast<__m128i*>(dest); 106 | 107 | for (i = 0; i < len - 4; i += 4) { 108 | val = _mm_loadu_si128(x++); 109 | val_abs = _mm_abs_epi32(val); 110 | _mm_storeu_si128(y++, val_abs); 111 | } 112 | for (; i < len; i++) 113 | dest[i] = (src[i] >= 0 ? src[i] : -src[i]); 114 | #else 115 | for (i = 0; i < len; i++) 116 | dest[i] = (src[i] >= 0 ? src[i] : -src[i]); 117 | #endif 118 | } 119 | 120 | static inline void Square(const int32_t* src, uint32_t* dest, int32_t len) { 121 | int32_t i; 122 | #ifdef USE_SSE 123 | __m128i x1; 124 | const __m128i* x2 = reinterpret_cast(src); 125 | __m128i* y2 = reinterpret_cast<__m128i*>(dest); 126 | 127 | for (i = 0; i < len - 4; i += 4) { 128 | x1 = _mm_loadu_si128(x2++); 129 | _mm_storeu_si128(y2++, _mm_mullo_epi32(x1, x1)); 130 | } 131 | for (; i < len; i++) 132 | *(dest + i) = (*(src + i)) * (*(src + i)); 133 | #else 134 | for (i = 0; i < len; i++) 135 | *(dest + i) = (*(src + i)) * (*(src + i)); 136 | #endif 137 | } 138 | 139 | static inline float VectorInnerProduct(const float* x, const float* y, 140 | int32_t len) { 141 | float prod = 0; 142 | int32_t i; 143 | #ifdef USE_SSE 144 | __m128 x1; 145 | __m128 y1; 146 | __m128 z1 = _mm_setzero_ps(); 147 | float buf[4]; 148 | 149 | for (i = 0; i < len - 4; i += 4) { 150 | x1 = _mm_loadu_ps(x + i); 151 | y1 = _mm_loadu_ps(y + i); 152 | z1 = _mm_add_ps(z1, _mm_mul_ps(x1, y1)); 153 | } 154 | _mm_storeu_ps(&buf[0], z1); 155 | prod = buf[0] + buf[1] + buf[2] + buf[3]; 156 | for (; i < len; i++) 157 | prod += x[i] * y[i]; 158 | #else 159 | for (i = 0; i < len; i++) 160 | prod += x[i] * y[i]; 161 | #endif 162 | return prod; 163 | } 164 | }; 165 | 166 | } // namespace fd 167 | } // namespace seeta 168 | 169 | #endif // SEETA_FD_UTIL_MATH_FUNC_H_ 170 | -------------------------------------------------------------------------------- /SeetaFaceHeader/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_MLP_H_ 33 | #define SEETA_FD_CLASSIFIER_MLP_H_ 34 | 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | #include "util/math_func.h" 42 | 43 | namespace seeta { 44 | namespace fd { 45 | 46 | class MLPLayer { 47 | public: 48 | explicit MLPLayer(int32_t act_func_type = 1) 49 | : input_dim_(0), output_dim_(0), act_func_type_(act_func_type) {} 50 | ~MLPLayer() {} 51 | 52 | void Compute(const float* input, float* output); 53 | 54 | inline int32_t GetInputDim() const { return input_dim_; } 55 | inline int32_t GetOutputDim() const { return output_dim_; } 56 | 57 | inline void SetSize(int32_t inputDim, int32_t outputDim) { 58 | if (inputDim <= 0 || outputDim <= 0) { 59 | return; // @todo handle the errors!!! 60 | } 61 | input_dim_ = inputDim; 62 | output_dim_ = outputDim; 63 | weights_.resize(inputDim * outputDim); 64 | bias_.resize(outputDim); 65 | } 66 | 67 | inline void SetWeights(const float* weights, int32_t len) { 68 | if (weights == nullptr || len != input_dim_ * output_dim_) { 69 | return; // @todo handle the errors!!! 70 | } 71 | std::copy(weights, weights + input_dim_ * output_dim_, weights_.begin()); 72 | } 73 | 74 | inline void SetBias(const float* bias, int32_t len) { 75 | if (bias == nullptr || len != output_dim_) { 76 | return; // @todo handle the errors!!! 77 | } 78 | std::copy(bias, bias + output_dim_, bias_.begin()); 79 | } 80 | 81 | private: 82 | inline float Sigmoid(float x) { 83 | return 1.0f / (1.0f + std::exp(x)); 84 | } 85 | 86 | inline float ReLU(float x) { 87 | return (x > 0.0f ? x : 0.0f); 88 | } 89 | 90 | private: 91 | int32_t act_func_type_; 92 | int32_t input_dim_; 93 | int32_t output_dim_; 94 | std::vector weights_; 95 | std::vector bias_; 96 | }; 97 | 98 | 99 | class MLP { 100 | public: 101 | MLP() {} 102 | ~MLP() {} 103 | 104 | void Compute(const float* input, float* output); 105 | 106 | inline int32_t GetInputDim() const { 107 | return layers_[0]->GetInputDim(); 108 | } 109 | 110 | inline int32_t GetOutputDim() const { 111 | return layers_.back()->GetOutputDim(); 112 | } 113 | 114 | inline int32_t GetLayerNum() const { 115 | return static_cast(layers_.size()); 116 | } 117 | 118 | void AddLayer(int32_t inputDim, int32_t outputDim, const float* weights, 119 | const float* bias, bool is_output = false); 120 | 121 | private: 122 | std::vector > layers_; 123 | std::vector layer_buf_[2]; 124 | }; 125 | 126 | } // namespace fd 127 | } // namespace seeta 128 | 129 | #endif // SEETA_FD_CLASSIFIER_MLP_H_ 130 | -------------------------------------------------------------------------------- /SeetaFaceHeader/model_reader.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_MODEL_READER_H_ 33 | #define SEETA_FD_MODEL_READER_H_ 34 | 35 | #include 36 | 37 | #include "classifier.h" 38 | 39 | namespace seeta { 40 | namespace fd { 41 | 42 | class ModelReader { 43 | public: 44 | ModelReader() {} 45 | virtual ~ModelReader() {} 46 | 47 | virtual bool Read(std::istream* input, seeta::fd::Classifier* model) = 0; 48 | 49 | DISABLE_COPY_AND_ASSIGN(ModelReader); 50 | }; 51 | 52 | } // namespace fd 53 | } // namespace seeta 54 | 55 | #endif // SEETA_FD_MODEL_READER_H_ 56 | -------------------------------------------------------------------------------- /SeetaFaceHeader/nms.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_UTIL_NMS_H_ 33 | #define SEETA_FD_UTIL_NMS_H_ 34 | 35 | #include 36 | 37 | #include "common.h" 38 | 39 | namespace seeta { 40 | namespace fd { 41 | 42 | void NonMaximumSuppression(std::vector* bboxes, 43 | std::vector* bboxes_nms, float iou_thresh = 0.8f); 44 | 45 | } // namespace fd 46 | } // namespace seeta 47 | 48 | #endif // SEETA_FD_UTIL_NMS_H_ 49 | -------------------------------------------------------------------------------- /SeetaFaceHeader/sift.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 firstly developed by Mengyi Liu (a Ph.D supervised by Prof. Shiguang Shan) and 19 | * further improved by Jie Zhang (a Ph.D supervised by Prof. Shiguang Shan) for more efficiency. 20 | * 21 | * As an open-source face recognition engine: you can redistribute SeetaFace source codes 22 | * and/or modify it under the terms of the BSD 2-Clause License. 23 | * 24 | * You should have received a copy of the BSD 2-Clause License along with the software. 25 | * If not, see < https://opensource.org/licenses/BSD-2-Clause>. 26 | * 27 | * Contact Info: you can send an email to SeetaFace@vipl.ict.ac.cn for any problems. 28 | * 29 | * Note: the above information must be kept whenever or wherever the codes are used. 30 | * 31 | */ 32 | 33 | #pragma once 34 | 35 | #include "stdio.h" 36 | #include 37 | #include 38 | 39 | typedef unsigned char BYTE; 40 | 41 | class SIFT{ 42 | public: 43 | SIFT(); 44 | ~SIFT(); 45 | 46 | /** Initialize the SIFT extractor. 47 | * @param im_width The width of the input image 48 | * @param im_height The height of the input image 49 | * @param patch_size The size of one patch for extracting SIFT 50 | * @param grid_spacing The stride for extracting SIFT 51 | */ 52 | void InitSIFT(int im_width, int im_height, int patch_size, int grid_spacing); 53 | 54 | /** Compute SIFT feature 55 | * @param gray_im A grayscale image 56 | * @param[out] sift_feature The output SIFT feature 57 | */ 58 | void CalcSIFT(BYTE* gray_im, double* sift_feature); 59 | 60 | private: 61 | /** Implement convolutional function "filter2" same in Matlab. 62 | * @param gray_im A grayscale image 63 | * @param kernel A convolutional kernel 64 | * @param kernel_size The size of convolutional kernel 65 | * @param[out] filter_im The output image map after convolution 66 | */ 67 | void filter2(double* gray_im, double* kernel, int kernel_size, double* filter_im); 68 | 69 | /** Sparse convolution for speed-up 70 | * @param gray_im A grayscale image 71 | * @param kernel A convolutional kernel 72 | * @param kernel_size The size of convolutional kernel 73 | * @param[out] filter_im The output image map after sparse convolution 74 | */ 75 | void SparseFilter2(double* gray_im, double* kernel, int kernel_size, double* filter_im); 76 | 77 | /** Calculate image orientation 78 | * @param gray_im A grayscale image 79 | * @param[out] image_orientation The output image orientation 80 | */ 81 | void ImageOrientation(double* gray_im, double* image_orientation); 82 | 83 | /** Calculate image orientation 84 | * @param image_orientation A image orientation map 85 | * @param[out] conv_im The output convolutional image 86 | */ 87 | void ConvImage(double* image_orientation, double* conv_im); 88 | 89 | private: 90 | struct SIFTParam 91 | { 92 | int image_width; 93 | int image_height; 94 | int patch_size; 95 | int grid_spacing; 96 | int angle_nums; 97 | int bin_nums; 98 | 99 | int image_pixel; 100 | int sample_nums; 101 | int sample_pixel; 102 | int patch_cnt_width; 103 | int patch_cnt_height; 104 | int patch_dims; 105 | int image_dims; 106 | 107 | int filter_size; 108 | double sigma; 109 | double alpha; 110 | 111 | }; 112 | 113 | SIFTParam param; 114 | 115 | static double delta_gauss_x[25]; 116 | static double delta_gauss_y[25]; 117 | 118 | }; 119 | 120 | -------------------------------------------------------------------------------- /SeetaFaceHeader/surf_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_SURF_FEATURE_MAP_H_ 33 | #define SEETA_FD_FEAT_SURF_FEATURE_MAP_H_ 34 | 35 | #include 36 | #include 37 | #include 38 | 39 | #include "common.h" 40 | #include "feature_map.h" 41 | #include "util/math_func.h" 42 | 43 | namespace seeta { 44 | namespace fd { 45 | 46 | typedef struct SURFFeature { 47 | seeta::Rect patch; 48 | int32_t num_cell_per_row; 49 | int32_t num_cell_per_col; 50 | } SURFFeature; 51 | 52 | class SURFFeaturePool { 53 | public: 54 | SURFFeaturePool() 55 | : sample_width_(40), sample_height_(40), 56 | patch_move_step_x_(16), patch_move_step_y_(16), patch_size_inc_step_(1), 57 | patch_min_width_(16), patch_min_height_(16) {} 58 | 59 | ~SURFFeaturePool() {} 60 | 61 | void Create(); 62 | void AddPatchFormat(int32_t width, int32_t height, int32_t num_cell_per_row, 63 | int32_t num_cell_per_col); 64 | 65 | inline bool empty() const { return pool_.empty(); } 66 | inline std::size_t size() const { return pool_.size(); } 67 | 68 | inline std::vector::const_iterator begin() const { 69 | return pool_.begin(); 70 | } 71 | 72 | inline std::vector::const_iterator end() const { 73 | return pool_.end(); 74 | } 75 | 76 | inline const SURFFeature & operator[](std::size_t idx) const { 77 | return pool_[idx]; 78 | } 79 | 80 | private: 81 | void AddAllFeaturesToPool(int32_t width, int32_t height, 82 | int32_t num_cell_per_row, int32_t num_cell_per_col); 83 | 84 | typedef struct SURFPatchFormat { 85 | /**< aspect ratio, s.t. GCD(width, height) = 1 */ 86 | int32_t width; 87 | int32_t height; 88 | 89 | /**< cell partition */ 90 | int32_t num_cell_per_row; 91 | int32_t num_cell_per_col; 92 | } SURFPatchFormat; 93 | 94 | int32_t sample_width_; 95 | int32_t sample_height_; 96 | int32_t patch_move_step_x_; 97 | int32_t patch_move_step_y_; 98 | int32_t patch_size_inc_step_; /**< incremental step of patch width and */ 99 | /**< height when build feature pool */ 100 | int32_t patch_min_width_; 101 | int32_t patch_min_height_; 102 | 103 | std::vector pool_; 104 | std::vector format_; 105 | }; 106 | 107 | class SURFFeatureMap : public FeatureMap { 108 | public: 109 | SURFFeatureMap() : buf_valid_reset_(false) { InitFeaturePool(); } 110 | virtual ~SURFFeatureMap() {} 111 | 112 | virtual void Compute(const uint8_t* input, int32_t width, int32_t height); 113 | 114 | inline virtual void SetROI(const seeta::Rect & roi) { 115 | roi_ = roi; 116 | if (buf_valid_reset_) { 117 | std::memset(buf_valid_.data(), 0, buf_valid_.size() * sizeof(int32_t)); 118 | buf_valid_reset_ = false; 119 | } 120 | } 121 | 122 | inline int32_t GetFeatureVectorDim(int32_t feat_id) const { 123 | return (feat_pool_[feat_id].num_cell_per_col * 124 | feat_pool_[feat_id].num_cell_per_row * kNumIntChannel); 125 | } 126 | 127 | void GetFeatureVector(int32_t featID, float* featVec); 128 | 129 | private: 130 | void InitFeaturePool(); 131 | void Reshape(int32_t width, int32_t height); 132 | 133 | void ComputeGradientImages(const uint8_t* input); 134 | void ComputeGradX(const int32_t* input); 135 | void ComputeGradY(const int32_t* input); 136 | void ComputeIntegralImages(); 137 | void Integral(); 138 | void MaskIntegralChannel(); 139 | 140 | inline void FillIntegralChannel(const int32_t* src, int32_t ch) { 141 | int32_t* dest = int_img_.data() + ch; 142 | int32_t len = width_ * height_; 143 | for (int32_t i = 0; i < len; i++) { 144 | *dest = *src; 145 | *(dest + 2) = *src; 146 | dest += kNumIntChannel; 147 | src++; 148 | } 149 | } 150 | 151 | void ComputeFeatureVector(const SURFFeature & feat, int32_t* feat_vec); 152 | void NormalizeFeatureVectorL2(const int32_t* feat_vec, float* feat_vec_normed, 153 | int32_t len) const; 154 | 155 | /** 156 | * Number of channels should be divisible by 4. 157 | */ 158 | void VectorCumAdd(int32_t* x, int32_t len, int32_t num_channel); 159 | 160 | static const int32_t kNumIntChannel = 8; 161 | 162 | bool buf_valid_reset_; 163 | 164 | std::vector grad_x_; 165 | std::vector grad_y_; 166 | std::vector int_img_; 167 | std::vector img_buf_; 168 | std::vector > feat_vec_buf_; 169 | std::vector > feat_vec_normed_buf_; 170 | std::vector buf_valid_; 171 | 172 | seeta::fd::SURFFeaturePool feat_pool_; 173 | }; 174 | 175 | } // namespace fd 176 | } // namespace seeta 177 | 178 | #endif // SEETA_FD_FEAT_SURF_FEATURE_MAP_H_ 179 | -------------------------------------------------------------------------------- /SeetaFaceHeader/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 | -------------------------------------------------------------------------------- /SeetaFaceHeader/surf_mlp_model_reader.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_IO_SURF_MLP_MODEL_READER_H_ 33 | #define SEETA_FD_IO_SURF_MLP_MODEL_READER_H_ 34 | 35 | #include 36 | #include 37 | 38 | #include "model_reader.h" 39 | 40 | namespace seeta { 41 | namespace fd { 42 | 43 | class SURFMLPModelReader : public ModelReader { 44 | public: 45 | SURFMLPModelReader() {} 46 | virtual ~SURFMLPModelReader() {} 47 | 48 | virtual bool Read(std::istream* input, seeta::fd::Classifier* model); 49 | 50 | private: 51 | std::vector feat_id_buf_; 52 | std::vector weights_buf_; 53 | std::vector bias_buf_; 54 | }; 55 | 56 | } // namespace fd 57 | } // namespace seeta 58 | 59 | #endif // SEETA_FD_IO_SURF_MLP_MODEL_READER_H_ 60 | -------------------------------------------------------------------------------- /SeetaFacelib/FaceAlignment.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/SeetaFacelib/FaceAlignment.lib -------------------------------------------------------------------------------- /SeetaFacelib/FaceDetection.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/SeetaFacelib/FaceDetection.lib -------------------------------------------------------------------------------- /SeetaFacelib/FaceIdentification.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/SeetaFacelib/FaceIdentification.lib -------------------------------------------------------------------------------- /UiFile/1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/UiFile/1.gif -------------------------------------------------------------------------------- /UiFile/2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/UiFile/2.gif -------------------------------------------------------------------------------- /UiFile/Button_circle_person_128px_1198024_easyicon.net.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/UiFile/Button_circle_person_128px_1198024_easyicon.net.ico -------------------------------------------------------------------------------- /UiFile/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/UiFile/background.png -------------------------------------------------------------------------------- /UiFile/close1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/UiFile/close1.png -------------------------------------------------------------------------------- /UiFile/close2 (2).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/UiFile/close2 (2).png -------------------------------------------------------------------------------- /UiFile/close2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/UiFile/close2.png -------------------------------------------------------------------------------- /UiFile/close3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/UiFile/close3.png -------------------------------------------------------------------------------- /UiFile/closeWhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/UiFile/closeWhite.png -------------------------------------------------------------------------------- /UiFile/eye_128px_1204362_easyicon.net.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/UiFile/eye_128px_1204362_easyicon.net.ico -------------------------------------------------------------------------------- /UiFile/picture_128px_1201195_easyicon.net.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/UiFile/picture_128px_1201195_easyicon.net.ico -------------------------------------------------------------------------------- /icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/icon.ico -------------------------------------------------------------------------------- /icon.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "icon.ico" -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | #include "OpenVideo.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | OpenVideo w; 8 | w.show(); 9 | return a.exec(); 10 | } 11 | -------------------------------------------------------------------------------- /model/seeta_fa_v1.1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/model/seeta_fa_v1.1.bin -------------------------------------------------------------------------------- /model/seeta_fd_frontal_v1.0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/model/seeta_fd_frontal_v1.0.bin -------------------------------------------------------------------------------- /model/seeta_fr_v1.0.part1.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/model/seeta_fr_v1.0.part1.rar -------------------------------------------------------------------------------- /model/seeta_fr_v1.0.part2.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/model/seeta_fr_v1.0.part2.rar -------------------------------------------------------------------------------- /model/说明(必看).txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/model/说明(必看).txt -------------------------------------------------------------------------------- /mp3/Recognition.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/mp3/Recognition.mp3 -------------------------------------------------------------------------------- /x64/Debug/OpenVideo.Build.CppClean.log: -------------------------------------------------------------------------------- 1 | e:\c++\demo\openvideo\openvideo\x64\debug\qrc_openvideo.obj 2 | e:\c++\demo\openvideo\openvideo\x64\debug\main.obj 3 | e:\c++\demo\openvideo\openvideo\x64\debug\openvideo.obj 4 | e:\c++\demo\openvideo\openvideo\x64\debug\moc_openvideo.obj 5 | e:\c++\demo\openvideo\openvideo\x64\debug\vc141.pdb 6 | e:\c++\demo\openvideo\x64\debug\openvideo.ilk 7 | e:\c++\demo\openvideo\x64\debug\openvideo.exe 8 | e:\c++\demo\openvideo\x64\debug\openvideo.pdb 9 | e:\c++\demo\openvideo\openvideo\generatedfiles\debug\moc_openvideo.cpp 10 | e:\c++\demo\openvideo\openvideo\generatedfiles\qrc_openvideo.cpp 11 | e:\c++\demo\openvideo\openvideo\generatedfiles\ui_openvideo.h 12 | e:\c++\demo\openvideo\openvideo\x64\debug\openvideo.tlog\cl.11060.write.1.tlog 13 | e:\c++\demo\openvideo\openvideo\x64\debug\openvideo.tlog\cl.command.1.tlog 14 | e:\c++\demo\openvideo\openvideo\x64\debug\openvideo.tlog\cl.read.1.tlog 15 | e:\c++\demo\openvideo\openvideo\x64\debug\openvideo.tlog\link.command.1.tlog 16 | e:\c++\demo\openvideo\openvideo\x64\debug\openvideo.tlog\link.read.1.tlog 17 | e:\c++\demo\openvideo\openvideo\x64\debug\openvideo.tlog\link.write.1.tlog 18 | e:\c++\demo\openvideo\openvideo\x64\debug\openvideo.tlog\openvideo.write.1u.tlog 19 | -------------------------------------------------------------------------------- /x64/Debug/OpenVideo.log: -------------------------------------------------------------------------------- 1 | OpenVideo.obj : error LNK2019: 无法解析的外部符号 "bool __cdecl cv::imwrite(class cv::String const &,class cv::debug_build_guard::_InputArray const &,class std::vector > const &)" (?imwrite@cv@@YA_NAEBVString@1@AEBV_InputArray@debug_build_guard@1@AEBV?$vector@HV?$allocator@H@std@@@std@@@Z),该符号在函数 "private: void __cdecl OpenVideo::nextFaceRecognition(void)" (?nextFaceRecognition@OpenVideo@@AEAAXXZ) 中被引用 2 | OpenVideo.obj : error LNK2019: 无法解析的外部符号 "void __cdecl cv::imshow(class cv::String const &,class cv::debug_build_guard::_InputArray const &)" (?imshow@cv@@YAXAEBVString@1@AEBV_InputArray@debug_build_guard@1@@Z),该符号在函数 "private: void __cdecl OpenVideo::REC(void)" (?REC@OpenVideo@@AEAAXXZ) 中被引用 3 | OpenVideo.obj : error LNK2019: 无法解析的外部符号 "void __cdecl cv::cvtColor(class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_OutputArray const &,int,int)" (?cvtColor@cv@@YAXAEBV_InputArray@debug_build_guard@1@AEBV_OutputArray@31@HH@Z),该符号在函数 "private: void __cdecl OpenVideo::nextFrame(void)" (?nextFrame@OpenVideo@@AEAAXXZ) 中被引用 4 | OpenVideo.obj : error LNK2019: 无法解析的外部符号 "void __cdecl cv::rectangle(class cv::debug_build_guard::_InputOutputArray const &,class cv::Point_,class cv::Point_,class cv::Scalar_ const &,int,int,int)" (?rectangle@cv@@YAXAEBV_InputOutputArray@debug_build_guard@1@V?$Point_@H@1@1AEBV?$Scalar_@N@1@HHH@Z),该符号在函数 "private: void __cdecl OpenVideo::nextSeetaFaceProcessFrame(void)" (?nextSeetaFaceProcessFrame@OpenVideo@@AEAAXXZ) 中被引用 5 | OpenVideo.obj : error LNK2019: 无法解析的外部符号 "void __cdecl cv::circle(class cv::debug_build_guard::_InputOutputArray const &,class cv::Point_,int,class cv::Scalar_ const &,int,int,int)" (?circle@cv@@YAXAEBV_InputOutputArray@debug_build_guard@1@V?$Point_@H@1@HAEBV?$Scalar_@N@1@HHH@Z),该符号在函数 "private: void __cdecl OpenVideo::nextSeetaFaceProcessFrame(void)" (?nextSeetaFaceProcessFrame@OpenVideo@@AEAAXXZ) 中被引用 6 | E:\C++\Demo\OpenVideo\x64\Debug\\OpenVideo.exe : fatal error LNK1120: 5 个无法解析的外部命令 7 | -------------------------------------------------------------------------------- /x64/Debug/OpenVideo.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Debug/OpenVideo.obj -------------------------------------------------------------------------------- /x64/Debug/OpenVideo.tlog/CL.10792.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Debug/OpenVideo.tlog/CL.10792.write.1.tlog -------------------------------------------------------------------------------- /x64/Debug/OpenVideo.tlog/CL.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Debug/OpenVideo.tlog/CL.command.1.tlog -------------------------------------------------------------------------------- /x64/Debug/OpenVideo.tlog/CL.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Debug/OpenVideo.tlog/CL.read.1.tlog -------------------------------------------------------------------------------- /x64/Debug/OpenVideo.tlog/OpenVideo.lastbuildstate: -------------------------------------------------------------------------------- 1 | #TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17134.0 2 | Debug|x64|E:\C++\Demo\OpenVideo\| 3 | -------------------------------------------------------------------------------- /x64/Debug/OpenVideo.tlog/OpenVideo.write.1u.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Debug/OpenVideo.tlog/OpenVideo.write.1u.tlog -------------------------------------------------------------------------------- /x64/Debug/OpenVideo.tlog/link.5900-cvtres.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Debug/OpenVideo.tlog/link.5900-cvtres.read.1.tlog -------------------------------------------------------------------------------- /x64/Debug/OpenVideo.tlog/link.5900-cvtres.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Debug/OpenVideo.tlog/link.5900-cvtres.write.1.tlog -------------------------------------------------------------------------------- /x64/Debug/OpenVideo.tlog/link.5900-rc.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Debug/OpenVideo.tlog/link.5900-rc.read.1.tlog -------------------------------------------------------------------------------- /x64/Debug/OpenVideo.tlog/link.5900-rc.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Debug/OpenVideo.tlog/link.5900-rc.write.1.tlog -------------------------------------------------------------------------------- /x64/Debug/OpenVideo.tlog/link.5900.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Debug/OpenVideo.tlog/link.5900.read.1.tlog -------------------------------------------------------------------------------- /x64/Debug/OpenVideo.tlog/link.5900.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Debug/OpenVideo.tlog/link.5900.write.1.tlog -------------------------------------------------------------------------------- /x64/Debug/OpenVideo.tlog/link.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Debug/OpenVideo.tlog/link.command.1.tlog -------------------------------------------------------------------------------- /x64/Debug/OpenVideo.tlog/link.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Debug/OpenVideo.tlog/link.read.1.tlog -------------------------------------------------------------------------------- /x64/Debug/OpenVideo.tlog/link.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Debug/OpenVideo.tlog/link.write.1.tlog -------------------------------------------------------------------------------- /x64/Debug/OpenVideo.tlog/unsuccessfulbuild: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Debug/OpenVideo.tlog/unsuccessfulbuild -------------------------------------------------------------------------------- /x64/Debug/main.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Debug/main.obj -------------------------------------------------------------------------------- /x64/Debug/moc_OpenVideo.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Debug/moc_OpenVideo.obj -------------------------------------------------------------------------------- /x64/Debug/qrc_OpenVideo.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Debug/qrc_OpenVideo.obj -------------------------------------------------------------------------------- /x64/Debug/qt.log: -------------------------------------------------------------------------------- 1 | OpenVideo.h|"E:\C++\Demo\OpenVideo\OpenVideo\OpenVideo.h" -o ".\GeneratedFiles\Debug\moc_OpenVideo.cpp" "-I.\GeneratedFiles" "-I." "-IE:\Qt\5.10.1\msvc2017_64\include" "-I.\GeneratedFiles\Debug" "-IE:\Qt\5.10.1\msvc2017_64\include\QtCore" "-IE:\Qt\5.10.1\msvc2017_64\include\QtGui" "-IE:\Qt\5.10.1\msvc2017_64\include\QtANGLE" "-IE:\Qt\5.10.1\msvc2017_64\include\QtMultimedia" "-IE:\Qt\5.10.1\msvc2017_64\include\QtWidgets" "-IE:\C++\Demo\OpenVideo\OpenVideo\SeetaFaceHeader" "-IE:\C++\Demo\OpenVideo\OpenVideo\SeetaFaceHeader\FaceIdentification" -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_WIDGETS_LIB 2 | OpenVideo.qrc|"E:\C++\Demo\OpenVideo\OpenVideo\OpenVideo.qrc" -o ".\GeneratedFiles\qrc_OpenVideo.cpp" --name OpenVideo 3 | OpenVideo.ui|"E:\C++\Demo\OpenVideo\OpenVideo\OpenVideo.ui" -o ".\GeneratedFiles\ui_OpenVideo.h" 4 | -------------------------------------------------------------------------------- /x64/Debug/vc141.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Debug/vc141.pdb -------------------------------------------------------------------------------- /x64/Release/MyThread.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Release/MyThread.obj -------------------------------------------------------------------------------- /x64/Release/OpenVideo.Build.CppClean.log: -------------------------------------------------------------------------------- 1 | e:\c++\demo\openvideo\openvideo\x64\release\main.obj 2 | e:\c++\demo\openvideo\openvideo\x64\release\qrc_openvideo.obj 3 | e:\c++\demo\openvideo\openvideo\x64\release\moc_openvideo.obj 4 | e:\c++\demo\openvideo\openvideo\x64\release\openvideo.obj 5 | e:\c++\demo\openvideo\x64\release\openvideo.exe 6 | e:\c++\demo\openvideo\openvideo\generatedfiles\release\moc_openvideo.cpp 7 | e:\c++\demo\openvideo\openvideo\generatedfiles\qrc_openvideo.cpp 8 | e:\c++\demo\openvideo\openvideo\generatedfiles\ui_openvideo.h 9 | e:\c++\demo\openvideo\openvideo\x64\release\icon.res 10 | e:\c++\demo\openvideo\openvideo\x64\release\openvideo.tlog\cl.10100.write.1.tlog 11 | e:\c++\demo\openvideo\openvideo\x64\release\openvideo.tlog\cl.command.1.tlog 12 | e:\c++\demo\openvideo\openvideo\x64\release\openvideo.tlog\cl.read.1.tlog 13 | e:\c++\demo\openvideo\openvideo\x64\release\openvideo.tlog\link.command.1.tlog 14 | e:\c++\demo\openvideo\openvideo\x64\release\openvideo.tlog\link.read.1.tlog 15 | e:\c++\demo\openvideo\openvideo\x64\release\openvideo.tlog\link.write.1.tlog 16 | e:\c++\demo\openvideo\openvideo\x64\release\openvideo.tlog\openvideo.write.1u.tlog 17 | e:\c++\demo\openvideo\openvideo\x64\release\openvideo.tlog\rc.command.1.tlog 18 | e:\c++\demo\openvideo\openvideo\x64\release\openvideo.tlog\rc.read.1.tlog 19 | e:\c++\demo\openvideo\openvideo\x64\release\openvideo.tlog\rc.write.1.tlog 20 | -------------------------------------------------------------------------------- /x64/Release/OpenVideo.log: -------------------------------------------------------------------------------- 1 |  OpenVideo.cpp 2 | e:\c++\demo\openvideo\openvideo\seetafaceheader\faceidentification\face_identification.h(44): warning C4010: 单行注释包含行继续符 3 | e:\c++\demo\openvideo\openvideo\seetafaceheader\faceidentification\face_identification.h(46): warning C4010: 单行注释包含行继续符 4 | e:\c++\demo\openvideo\openvideo\seetafaceheader\faceidentification\face_identification.h(47): warning C4010: 单行注释包含行继续符 5 | e:\c++\demo\openvideo\openvideo\seetafaceheader\faceidentification\face_identification.h(53): warning C4010: 单行注释包含行继续符 6 | e:\c++\demo\openvideo\openvideo\seetafaceheader\faceidentification\face_identification.h(70): warning C4010: 单行注释包含行继续符 7 | e:\c++\demo\openvideo\openvideo\seetafaceheader\faceidentification\face_identification.h(71): warning C4010: 单行注释包含行继续符 8 | e:\c++\demo\openvideo\openvideo\seetafaceheader\faceidentification\face_identification.h(82): warning C4010: 单行注释包含行继续符 9 | OpenVideo.vcxproj -> E:\C++\Demo\OpenVideo\x64\Release\OpenVideo.exe 10 | -------------------------------------------------------------------------------- /x64/Release/OpenVideo.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Release/OpenVideo.obj -------------------------------------------------------------------------------- /x64/Release/OpenVideo.tlog/CL.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Release/OpenVideo.tlog/CL.command.1.tlog -------------------------------------------------------------------------------- /x64/Release/OpenVideo.tlog/CL.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Release/OpenVideo.tlog/CL.read.1.tlog -------------------------------------------------------------------------------- /x64/Release/OpenVideo.tlog/CL.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Release/OpenVideo.tlog/CL.write.1.tlog -------------------------------------------------------------------------------- /x64/Release/OpenVideo.tlog/OpenVideo.lastbuildstate: -------------------------------------------------------------------------------- 1 | #TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17134.0 2 | Release|x64|E:\C++\Demo\OpenVideo\| 3 | -------------------------------------------------------------------------------- /x64/Release/OpenVideo.tlog/OpenVideo.write.1u.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Release/OpenVideo.tlog/OpenVideo.write.1u.tlog -------------------------------------------------------------------------------- /x64/Release/OpenVideo.tlog/link.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Release/OpenVideo.tlog/link.command.1.tlog -------------------------------------------------------------------------------- /x64/Release/OpenVideo.tlog/link.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Release/OpenVideo.tlog/link.read.1.tlog -------------------------------------------------------------------------------- /x64/Release/OpenVideo.tlog/link.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Release/OpenVideo.tlog/link.write.1.tlog -------------------------------------------------------------------------------- /x64/Release/OpenVideo.tlog/rc.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Release/OpenVideo.tlog/rc.command.1.tlog -------------------------------------------------------------------------------- /x64/Release/OpenVideo.tlog/rc.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Release/OpenVideo.tlog/rc.read.1.tlog -------------------------------------------------------------------------------- /x64/Release/OpenVideo.tlog/rc.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Release/OpenVideo.tlog/rc.write.1.tlog -------------------------------------------------------------------------------- /x64/Release/icon.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Release/icon.res -------------------------------------------------------------------------------- /x64/Release/main.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Release/main.obj -------------------------------------------------------------------------------- /x64/Release/moc_MyThread.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Release/moc_MyThread.obj -------------------------------------------------------------------------------- /x64/Release/moc_OpenVideo.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Release/moc_OpenVideo.obj -------------------------------------------------------------------------------- /x64/Release/qrc_OpenVideo.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YoungFan1993/SeetaFace-VS2017-Qt/bceca1d6b833d1dd3a0bc55e8fee5a30791c8108/x64/Release/qrc_OpenVideo.obj -------------------------------------------------------------------------------- /x64/Release/qt.log: -------------------------------------------------------------------------------- 1 | OpenVideo.qrc|"E:\C++\Demo\OpenVideo\OpenVideo\OpenVideo.qrc" -o ".\GeneratedFiles\qrc_OpenVideo.cpp" --name OpenVideo 2 | OpenVideo.ui|"E:\C++\Demo\OpenVideo\OpenVideo\OpenVideo.ui" -o ".\GeneratedFiles\ui_OpenVideo.h" 3 | OpenVideo.h|"E:\C++\Demo\OpenVideo\OpenVideo\OpenVideo.h" -o ".\GeneratedFiles\Release\moc_OpenVideo.cpp" "-I.\GeneratedFiles" "-I." "-IE:\Qt\5.10.1\msvc2017_64\include" "-I.\GeneratedFiles\Release" "-IE:\Qt\5.10.1\msvc2017_64\include\QtCore" "-IE:\Qt\5.10.1\msvc2017_64\include\QtGui" "-IE:\Qt\5.10.1\msvc2017_64\include\QtANGLE" "-IE:\Qt\5.10.1\msvc2017_64\include\QtMultimedia" "-IE:\Qt\5.10.1\msvc2017_64\include\QtWidgets" "-IE:\C++\Demo\OpenVideo\OpenVideo\SeetaFaceHeader" "-IE:\C++\Demo\OpenVideo\OpenVideo\SeetaFaceHeader\FaceIdentification" -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_WIDGETS_LIB 4 | MyThread.h|"E:\C++\Demo\OpenVideo\OpenVideo\MyThread.h" -o ".\GeneratedFiles\Release\moc_MyThread.cpp" "-I.\GeneratedFiles" "-I." "-IE:\Qt\5.10.1\msvc2017_64\include" "-I.\GeneratedFiles\Release\." "-IE:\Qt\5.10.1\msvc2017_64\include\QtCore" "-IE:\Qt\5.10.1\msvc2017_64\include\QtGui" "-IE:\Qt\5.10.1\msvc2017_64\include\QtANGLE" "-IE:\Qt\5.10.1\msvc2017_64\include\QtMultimedia" "-IE:\Qt\5.10.1\msvc2017_64\include\QtWidgets" "-IE:\C++\Demo\OpenVideo\OpenVideo\SeetaFaceHeader" "-IE:\C++\Demo\OpenVideo\OpenVideo\SeetaFaceHeader\FaceIdentification" -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_WIDGETS_LIB 5 | --------------------------------------------------------------------------------