MCPcopy Create free account
hub / github.com/HyperInspire/InspireFace / main

Function main

cpp/sample/source/tracker_sample.cpp:8–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6using namespace inspire;
7
8int main() {
9 std::string expansion_path = "";
10 INSPIREFACE_CONTEXT->Load("test_res/pack/Pikachu");
11 auto archive = INSPIREFACE_CONTEXT->getMArchive();
12 auto mode = inspire::DetectModuleMode::DETECT_MODE_ALWAYS_DETECT;
13 FaceTrackModule tracker(mode, 10, 20, 320, -1);
14 tracker.Configuration(archive, expansion_path);
15
16 auto image = inspirecv::Image::Create("test_res/data/bulk/r0.jpg");
17 inspirecv::FrameProcess processor;
18 processor.SetDataBuffer(image.Data(), image.Height(), image.Width());
19 processor.SetDataFormat(inspirecv::DATA_FORMAT::BGR);
20 processor.SetRotationMode(inspirecv::ROTATION_MODE::ROTATION_0);
21 for (int i = 0; i < 100; i++) {
22 auto show = image.Clone();
23 tracker.UpdateStream(processor);
24 auto faces = tracker.trackingFace;
25 int index = 0;
26 if (faces.size() > 0) {
27 auto &face = faces[index];
28 for (auto &p : face.high_result.lmk) {
29 show.DrawCircle(p.As<int>(), 5, {0, 255, 0});
30 }
31 for (auto &p : face.landmark_) {
32 show.DrawCircle(p.As<int>(), 5, {0, 0, 255});
33 }
34 }
35 show.Show("faces", 0);
36 }
37
38 return 0;
39}

Callers

nothing calls this directly

Calls 7

LoadMethod · 0.80
SetDataBufferMethod · 0.80
SetRotationModeMethod · 0.80
UpdateStreamMethod · 0.80
sizeMethod · 0.80
ConfigurationMethod · 0.45
SetDataFormatMethod · 0.45

Tested by

no test coverage detected