Closed kevinzezel closed 2 years ago
Assuming your in the 'main' directory.
.
├── bin
├── FaceRecognition.cbp
├── FaceRecognition.depend
├── FaceRecognition.layout
├── Graham Norton.jpg
├── img
├── include
├── LICENSE
├── models
├── Norton_2.mp4
├── Norton_A.mp4
├── obj
├── README.md
└── src
Give the following commands
g++ -O3 -Wall -fexceptions -Wno-unknown-pragmas -O2 -I/usr/local/include/opencv4 -I/usr/local/include/ncnn -Iinclude -c /home/pi/software/Face-Recognition/src/main.cpp -o main.o
g++ -O3 -Wall -fexceptions -Wno-unknown-pragmas -O2 -I/usr/local/include/opencv4 -I/usr/local/include/ncnn -Iinclude -c /home/pi/software/Face-Recognition/src/TArcface.cpp -o TArcface.o
g++ -O3 -Wall -fexceptions -Wno-unknown-pragmas -O2 -I/usr/local/include/opencv4 -I/usr/local/include/ncnn -Iinclude -c /home/pi/software/Face-Recognition/src/TBlur.cpp -o TBlur.o
g++ -O3 -Wall -fexceptions -Wno-unknown-pragmas -O2 -I/usr/local/include/opencv4 -I/usr/local/include/ncnn -Iinclude -c /home/pi/software/Face-Recognition/src/TLive.cpp -o TLive.o
g++ -O3 -Wall -fexceptions -Wno-unknown-pragmas -O2 -I/usr/local/include/opencv4 -I/usr/local/include/ncnn -Iinclude -c /home/pi/software/Face-Recognition/src/TMtCNN.cpp -o TMtCNN.o
g++ -O3 -Wall -fexceptions -Wno-unknown-pragmas -O2 -I/usr/local/include/opencv4 -I/usr/local/include/ncnn -Iinclude -c /home/pi/software/Face-Recognition/src/TRetina.cpp -o TRetina.o
g++ -o FaceRecognition main.o TArcface.o TBlur.o TMtCNN.o TLive.o TRetina.o TWarp.o -fopenmp -I/usr/local/include/opencv4 -L/usr/local/lib `pkg-config --cflags --libs opencv4` -ldl -lpthread -s /usr/local/lib/ncnn/libncnn.a
You get the executable FaceRecognition.
.
├── bin
├── FaceRecognition
├── FaceRecognition.cbp
├── FaceRecognition.depend
├── FaceRecognition.layout
├── Graham Norton.jpg
├── img
├── include
├── LICENSE
├── main.o
├── models
├── Norton_2.mp4
├── Norton_A.mp4
├── obj
├── README.md
├── src
├── TArcface.o
├── TBlur.o
├── TLive.o
├── TRetina.o
└── TWarp.o
Thank you very much!! It worked
Hello guys,
tried following your steps. But got bunch off errors. Are my path's wrong? Thanks
You are running the g++ commands is the wrong folder, as can be seen by the error
No such file or directory
In the command you have at the end the /home/pi/software/Face-Recognition/src/main.cpp
part
The mentioned location must match your directory structure.
Better to use cmake as explained here #12
Hi,
First of all, nice work. Thanks for sharing.
I don't have much experience with c++, so sorry for the dumb question.
How can i compile and run the script outside of codeblocks using g++?
I moved all .hpp and .cpp files to the same folder and i run this command on raspberry PI console:
g++ main.cpp -o run -I/usr/local/include/opencv4 -I/usr/local/include/ncnn `pkg-config --cflags --libs opencv4`
I got this error:
Obs: I'm testing only the retinaface. The following code runs perfectly in codeblocks with the project that you provide.
Files in folder:
main.cpp