forked from Rock-100/FaceKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
picture.cpp
35 lines (31 loc) · 959 Bytes
/
picture.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "PCN.h"
int main()
{
PCN detector("model/PCN.caffemodel",
"model/PCN-1.prototxt", "model/PCN-2.prototxt", "model/PCN-3.prototxt");
detector.SetMinFaceSize(20);
detector.SetScoreThresh(0.37, 0.43, 0.97);
detector.SetImagePyramidScaleFactor(1.414);
detector.SetVideoSmooth(false);
for (int i = 0; i <= 26; i++)
{
cv::Mat img =
cv::imread("../imgs/" + std::to_string(i) + ".jpg");
cv::TickMeter tm;
tm.reset();
tm.start();
std::vector<Window> faces = detector.DetectFace(img);
tm.stop();
std::cout << "Image: " << i << std::endl;
std::cout << "Time Cost: "<<
tm.getTimeMilli() << " ms" << std::endl;
for (int j = 0; j < faces.size(); j++)
{
DrawFace(img, faces[j]);
}
cv::imshow("PCN", img);
cv::waitKey();
}
cv::destroyAllWindows();
return 0;
}