Skip to content

Commit 91d8526

Browse files
committed
Modify READEM.md
1 parent d58cc9e commit 91d8526

10 files changed

Lines changed: 222 additions & 174 deletions

File tree

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
model/
12
*.swp
23
Makefile.Debug
34
Makefile.Release
@@ -16,7 +17,6 @@ test.xml
1617
CMakeSettings.json
1718
build_
1819
modul/
19-
*/
2020
build-*/
2121
build/
2222
build_android/
@@ -26,7 +26,6 @@ build_unix/
2626
build_windows_msvc/
2727
*.ncb
2828
.metadata/
29-
*~
3029
debug/
3130
bin/
3231
*.class

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ addons:
1111

1212
cache:
1313
- apt
14-
- directories:
15-
- Package
14+
# - directories:
15+
# - Package
1616

1717
compiler:
1818
- g++
@@ -70,6 +70,7 @@ before_install:
7070

7171
install:
7272
- cd ${SOURCE_DIR}
73+
- /bin/bash ci/backgroud_echo.sh &
7374
- git clone https://github.com/KangLin/RabbitCommon.git
7475
- export RabbitCommon_DIR="`pwd`/RabbitCommon"
7576
- bash ci/build-install-tools.sh > /dev/null

README.md

Lines changed: 117 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141

4242
### 支持平台
4343

44-
+ [x] windows
44+
+ [x] windows (windows xp 及已后)
4545
+ [x] linux
46-
+ [x] android
46+
+ [x] android (android 21 及已后)
4747
+ [ ] mac
4848
+ [ ] ios
4949
+ [x] 其它嵌入式平台,可联系本人(QQ:16614119)或你自己移植:)
@@ -52,35 +52,35 @@
5252

5353
### [下载安装包](https://github.com/KangLin/FaceRecognizer/releases/latest)
5454

55+
- windows
56+
- [FaceRecognizer-Setup-v0.0.3.exe](https://github.com/KangLin/FaceRecognizer/releases/download/v0.0.3/FaceRecognizer-Setup-v0.0.3.exe)
57+
Windows安装包,支持 Windows xp 以上系统
58+
59+
- android
60+
+ [FaceRecognizer_armeabi-v7a_v0.0.3.apk](https://github.com/KangLin/FaceRecognizer/releases/download/v0.0.3/FaceRecognizer_armeabi-v7a_v0.0.3.apk)
61+
5562
- linux
5663
- [FaceRecognizer_v0.0.3.tar.gz](https://github.com/KangLin/FaceRecognizer/releases/download/v0.0.3/FaceRecognizer_v0.0.3.tar.gz)
5764
AppImage格式的执行程序,可直接运行在linux系统,详见:https://appimage.org/
5865
使用:
5966
1. 解压。复制FaceRecognizer_v0.0.3.tar.gz到安装目录,然后解压:
6067

61-
mkdir FaceRecognizer
62-
cd FaceRecognizer
63-
cp $DOWNLOAD/FaceRecognizer_v0.0.3.tar.gz .
64-
tar xvfz FaceRecognizer_v0.0.3.tar.gz
68+
mkdir FaceRecognizer
69+
cd FaceRecognizer
70+
cp $DOWNLOAD/FaceRecognizer_v0.0.3.tar.gz .
71+
tar xvfz FaceRecognizer_v0.0.3.tar.gz
6572

6673
2. 安装
6774

68-
./install1.sh install FaceRecognizer
75+
./install1.sh install FaceRecognizer
6976

7077
3. 如果需要,卸载
7178

72-
./install1.sh remove FaceRecognizer
79+
./install1.sh remove FaceRecognizer
7380

7481
- ubuntu
7582
- [facerecognizer_0.0.3_amd64.deb](https://github.com/KangLin/FaceRecognizer/releases/download/v0.0.3/facerecognizer_0.0.3_amd64.deb)
7683
deb 安装包,可用于 Ubuntu
77-
78-
- windows
79-
- [FaceRecognizer-Setup-v0.0.3.exe](https://github.com/KangLin/FaceRecognizer/releases/download/v0.0.3/FaceRecognizer-Setup-v0.0.3.exe)
80-
Windows安装包,支持 Windows xp 以上系统
81-
82-
- android
83-
+ [FaceRecognizer_armeabi-v7a_v0.0.3.apk](https://github.com/KangLin/FaceRecognizer/releases/download/v0.0.3/FaceRecognizer_armeabi-v7a_v0.0.3.apk)
8484

8585
**注意:**本项目安装包中暂时未打包模型文件,请到相关依赖项目中下载模型文件到一个目录中,然后在程序 菜单->选项->设置模型路径 中指定此目录。
8686

@@ -98,11 +98,12 @@
9898
+ [MSYS2/MinGW](http://sourceforge.net/projects/msys2/)
9999
+ [CMake](http://www.cmake.org/)
100100
+ 依赖库
101-
- [必选] Rabbit 公共库: https://github.com/KangLin/RabbitCommon
101+
- [必选] 玉兔公共库: https://github.com/KangLin/RabbitCommon
102102
- [可选] SeetaFace2: https://github.com/seetafaceengine/SeetaFace2
103103
- [可选] libyuv: https://github.com/KangLin/libyuv
104104
- [可选] ffmpeg: https://ffmpeg.org/
105105
- [可选] opencv: https://opencv.org/
106+
- [可选] dlib: https://github.com/davisking/dlib
106107

107108
### CMake 配置参数
108109
- [必选] Qt5_DIR: qt 安装位置(指向Qt5Config.cmake的目录,默认为 安装目录/lib/cmake/Qt5)。
@@ -113,9 +114,11 @@
113114
- [可选] SeetaFace_DIR: SeetaFace 库安装位置(指向安装的SeetaFaceConfig.cmake目录,默认为 安装目录/lib/cmake)
114115
- [可选] YUV_DIR: libyuv 库安装位置
115116
- [可选] OpenCV_DIR: OpenCV 库安装位置
117+
- [可选] dlib_DIR: dlib 库安装位置
116118

117119
### 各平台编译
118120
#### 下载源码
121+
119122
- 下载本项目源码
120123

121124
git clone --recursive https://github.com/KangLin/FaceRecognizer.git
@@ -132,49 +135,53 @@
132135
- 从源码编译或安装可选库
133136

134137
#### linux 平台编译说明
135-
- 编译
138+
- 编译
136139

137140
cd FaceRecognizer
138141
mkdir build
139142
cd build
140-
cmake .. -DCMAKE_INSTALL_PREFIX=`pwd`/install \
141-
-DCMAKE_BUILD_TYPE=Release \
142-
-DQt5_DIR= \
143-
-DRabbitCommon_DIR= \
144-
[其它可选 CMake 配置参数]
143+
cmake .. -G"Unix Makefiles" \
144+
-DCMAKE_INSTALL_PREFIX=`pwd`/install \
145+
-DCMAKE_BUILD_TYPE=Release \
146+
-DQt5_DIR= \
147+
-DRabbitCommon_DIR= \
148+
[其它可选 CMake 配置参数]
145149
cmake --build . --config Release
146150

147-
- 安装
148-
149-
cmake --build . --config Release --target install
151+
- 安装
152+
+ 安装库和程序
150153

151-
- 运行例子
152-
+ 把生成库的目录加入到变量 LD_LIBRARY_PATH 中
153-
154-
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/bin
154+
cmake --build . --config Release --target install/strip
155+
156+
+ 仅安装程序
155157

156-
+ 拷贝模型文件到程序安装目录下的 model 目录下,也可以在程序运行后指定。
157-
- SeetaFace 模型文件。模型文件位置详见:https://github.com/seetafaceengine/SeetaFace2
158+
cmake --build . --config Release --target install-runtime
158159

159-
cd FaceRecognizer
160-
cd build
161-
mkdir model
162-
cp fd_2_00.dat pd_2_00_pts5.dat pd_2_00_pts81.dat .
160+
- 运行例子
161+
+ 把生成库的目录加入到变量 LD_LIBRARY_PATH 中
162+
163+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/bin
163164

164-
+ 执行 bin 目录下的程序
165+
+ 拷贝模型文件到程序安装目录下的 model 目录下,也可以在程序运行后指定。
166+
- SeetaFace 模型文件。模型文件位置详见:https://github.com/seetafaceengine/SeetaFace2
165167

166168
cd FaceRecognizer
167169
cd build
168-
cd bin
169-
./FaceRecognizer
170+
mkdir model
171+
cp fd_2_00.dat pd_2_00_pts5.dat pd_2_00_pts81.dat .
170172

173+
+ 执行 bin 目录下的程序
174+
175+
cd FaceRecognizer
176+
cd build
177+
cd bin
178+
./FaceRecognizer
171179

172180
#### windows 平台编译说明
173181
- 使用 cmake-gui.exe 工具编译。打开 cmake-gui.exe 配置
174182
- 命令行编译
175183
+ 把 cmake 命令所在目录加入到环境变量 PATH 中
176184
+ 从开始菜单打开 “VS2015开发人员命令提示”,进入命令行
177-
178185
- 编译
179186

180187
cd FaceRecognizer
@@ -188,8 +195,13 @@
188195
cmake --build . --config Release
189196

190197
- 安装
191-
192-
cmake --build . --config Release --target install
198+
+ 安装库和程序
199+
200+
cmake --build . --config Release --target install
201+
202+
+ 仅安装程序
203+
204+
cmake --build . --config Release --target install-runtime
193205

194206
- 运行例子
195207
+ 拷贝模型文件到程序安装目录下的 model 目录下,也可以在程序运行后指定。
@@ -218,31 +230,45 @@
218230

219231
+ 编译
220232
- 主机是 linux
233+
+ 编译
234+
235+
cd FaceRecognizer
236+
mkdir build
237+
cd build
238+
cmake .. -G"Unix Makefiles" \
239+
-DCMAKE_INSTALL_PREFIX=`pwd`/android-build \
240+
-DCMAKE_BUILD_TYPE=MinSizeRel \
241+
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake \
242+
-DANDROID_ABI="armeabi-v7a with NEON" \
243+
-DANDROID_PLATFORM=android-24 \
244+
-DQt5_DIR= \
245+
-DRabbitCommon_DIR= \
246+
-DYUV_DIR= \
247+
[其它可选 CMake 配置参数]
248+
cmake --build . --config MinSizeRel
249+
250+
+ 安装
251+
- 安装库和程序
252+
253+
cmake --build . --config MinSizeRel --target install/strip
254+
255+
- 仅安装程序
256+
257+
cmake --build . --config MinSizeRel --target install-runtime
221258

222-
cd FaceRecognizer
223-
mkdir build
224-
cd build
225-
cmake .. -DCMAKE_INSTALL_PREFIX=`pwd`/android-build \
226-
-DCMAKE_BUILD_TYPE=Release \
227-
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake \
228-
-DANDROID_ABI="armeabi-v7a with NEON" \
229-
-DANDROID_PLATFORM=android-24 \
230-
-DQt5_DIR= \
231-
-DRabbitCommon_DIR= \
232-
-DYUV_DIR= \
233-
[其它可选 CMake 配置参数]
234-
cmake --build . --config Release
235-
cmake --build . --config Release --target install
236-
cmake --build . --config Release --target APK
259+
+ 生成 APK
260+
261+
cmake --build . --config MinSizeRel --target APK
237262

238263
- 主机是 windows
239-
- windows 控制台
240-
264+
+ windows 控制台
265+
- 编译
266+
241267
cd FaceRecognizer
242268
mkdir build
243269
cd build
244270
cmake .. -DCMAKE_INSTALL_PREFIX=%cd%\android-build ^
245-
-G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ^
271+
-G"Unix Makefiles" -DCMAKE_BUILD_TYPE=MinSizeRel ^
246272
-DCMAKE_TOOLCHAIN_FILE=%ANDROID_NDK%/build/cmake/android.toolchain.cmake ^
247273
-DCMAKE_MAKE_PROGRAM=%ANDROID_NDK%/prebuilt/windows-x86_64/bin/make.exe ^
248274
-DANDROID_ABI=arm64-v8a ^
@@ -252,29 +278,40 @@
252278
-DRabbitCommon_DIR= ^
253279
-DYUV_DIR= ^
254280
[其它可选 CMake 配置参数]
255-
cmake --build . --config Release
256-
cmake --build . --config Release --target install
257-
cmake --build . --config Release --target APK
281+
cmake --build . --config MinSizeRel
282+
283+
- 安装
284+
+ 安装库和程序
285+
286+
cmake --build . --config MinSizeRel --target install/strip
287+
288+
+ 仅安装程序
289+
290+
cmake --build . --config MinSizeRel --target install-runtime
258291

259-
- msys2 或 cygwin
292+
+ 生成 APK
293+
294+
cmake --build . --config MinSizeRel --target APK
295+
296+
+ msys2 或 cygwin
260297

261-
cd FaceRecognizer
262-
mkdir build
263-
cd build
264-
cmake .. -DCMAKE_INSTALL_PREFIX=`pwd`/android-build \
265-
-G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release \
266-
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake \
267-
-DCMAKE_MAKE_PROGRAM=${ANDROID_NDK}/prebuilt/windows-x86_64/bin/make.exe \
268-
-DANDROID_ABI=arm64-v8a \
269-
-DANDROID_ARM_NEON=ON \
270-
-DANDROID_PLATFORM=android-24 \
271-
-DQt5_DIR= \
272-
-DRabbitCommon_DIR= \
273-
-DYUV_DIR= \
274-
[其它可选 CMake 配置参数]
275-
cmake --build . --config Release
276-
cmake --build . --config Release --target install
277-
cmake --build . --config Release --target APK
298+
cd FaceRecognizer
299+
mkdir build
300+
cd build
301+
cmake .. -DCMAKE_INSTALL_PREFIX=`pwd`/android-build \
302+
-G"Unix Makefiles" -DCMAKE_BUILD_TYPE=MinSizeRel \
303+
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake \
304+
-DCMAKE_MAKE_PROGRAM=${ANDROID_NDK}/prebuilt/windows-x86_64/bin/make.exe \
305+
-DANDROID_ABI=arm64-v8a \
306+
-DANDROID_ARM_NEON=ON \
307+
-DANDROID_PLATFORM=android-24 \
308+
-DQt5_DIR= \
309+
-DRabbitCommon_DIR= \
310+
-DYUV_DIR= \
311+
[其它可选 CMake 配置参数]
312+
cmake --build . --config MinSizeRel
313+
cmake --build . --config MinSizeRel --target install/strip
314+
cmake --build . --config MinSizeRel --target APK
278315

279316
- CMake for android 参数说明:https://developer.android.google.cn/ndk/guides/cmake
280317
+ ANDROID_ABI: 可取下列值:

Src/ImageTool.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ CImageTool::CImageTool(QObject *parent) :
3232
{
3333
}
3434

35-
CImageTool::~CImageTool()
36-
{
37-
}
38-
3935
//设置日志的回调函数
4036
void Log(void*, int, const char* fmt, va_list vl)
4137
{

Src/ImageTool.h

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,18 @@ class FACERECOGNIZER_EXPORT CImageTool : public QObject
3030
{
3131
Q_OBJECT
3232
public:
33-
explicit CImageTool(QObject *parent = 0);
34-
~CImageTool();
33+
explicit CImageTool(QObject *parent = nullptr);
3534

3635
public:
36+
static void YUV420_2_RGB(unsigned char* pYUV, unsigned char* pRGB, int width, int height);
37+
static QImage ConverFormatToRGB888(const QVideoFrame &frame);
38+
39+
#if HAVE_LIBYUV
40+
static QImage LibyuvConverFormatToRGB888(const QVideoFrame &frame);
41+
#endif
42+
#if HAVE_OPENCV
43+
static QImage OpenCVConverFormatToRGB888(const QVideoFrame &frame);
44+
#endif
3745
#ifdef HAVE_FFMPEG
3846
//设置ffmpeg日志输出
3947
static int SetFFmpegLog();
@@ -73,17 +81,6 @@ class FACERECOGNIZER_EXPORT CImageTool : public QObject
7381
/*[in]*/ AVPixelFormat outPixelFormat);/** 转换后的帧的格式 */
7482
#endif
7583

76-
public:
77-
static void YUV420_2_RGB(unsigned char* pYUV, unsigned char* pRGB, int width, int height);
78-
static QImage ConverFormatToRGB888(const QVideoFrame &frame);
79-
80-
#if HAVE_LIBYUV
81-
static QImage LibyuvConverFormatToRGB888(const QVideoFrame &frame);
82-
#endif
83-
#if HAVE_OPENCV
84-
static QImage OpenCVConverFormatToRGB888(const QVideoFrame &frame);
85-
#endif
86-
8784
signals:
8885

8986
public slots:

0 commit comments

Comments
 (0)