Skeletal Animation Multithread Face
main.cpp
Go to the documentation of this file.
1#include <iostream>
2#include <stdio.h>
3#include <string.h>
4#include <stdlib.h>
5#include <unistd.h>
6#include <boost/process.hpp>
7#include <filesystem>
8
10
11int main()
12{
13 // Process cmd
14 auto process_cmd = boost::process::search_path("python3").string();
15
16 // Process name
17 std::string process_name = (std::filesystem::current_path() /
18 "face_mesh_server.py").string();
19
20 // Begin forking
21 int fork_id = fork();
22
23 // Initialize child errors
24 int err;
25
26 if (fork_id == 0)
27 {
28 // Execute child process
29 err = execlp(process_cmd.c_str(), process_cmd.c_str(), process_name.data(), NULL);
30 if (err == -1)
31 {
32 std::cout << "Could not execute python server" << std::endl;
33 }
34 }
35 else
36 {
37 // Sleep for a bit to make sure that the server has woken up
38 sleep(1);
39
40 // Initialize cpp client and render in the parent process
41 Rendering rendering;
42
43 wait(NULL);
44 }
45}
This class performs the rendering of the scene. This has been included inside a class for better orga...
Definition: rendering.h:22
int main()
Definition: main.cpp:11