Qengineering / Face-Recognition-Jetson-Nano

Recognize 2000+ faces on your Jetson Nano with database auto-fill and anti-spoofing
https://qengineering.eu/deep-learning-examples-on-raspberry-32-64-os.html
BSD 3-Clause "New" or "Revised" License
108 stars 31 forks source link

Live detection is always giving output as zero #2

Closed rsingh2083 closed 3 years ago

rsingh2083 commented 3 years ago

Theres some problem with anti spoofing part. The code compiled and ran properly on both Webcam as well as Norton.mp4 movie file and everything works fine except for the Anti_Spoofing. Its output is always zero for both webcam as well as movie file.

Qengineering commented 3 years ago

Just run Norton_2.mp4 and most of the faces give a anti-spoofing reading between 1.000 and 0.998. Clint Eastwood (a picture) gives 0.88 and is considered to be fake.

The only readings with zero are those with Graham Norton and some fragments with George Clooney. It happens only when a face is too small (the background of the label becomes light blue), or when the face is not recognizable, as is the case with Tom Hanks when he looks to the other guests (the label is now yellow).

rsingh2083 commented 3 years ago

Ran it again on Norton_2.mp4 but again Anti Spoofing showed 0 for the entire video. Is there anyway I can debug the Anti Spoofing code ? As there is no error or warnings but still the Anti Spoofing row is always stuck at zero value.


-------------- Build: Release in FaceRecognition (compiler: GNU GCC Compiler)---------------
Scanned 0 files for #includes, cache used 159, cache updated 0
g++ -O3 -Wall -fexceptions -Wno-unknown-pragmas -O2 -I/usr/include/opencv4 -I/usr/local/include/ncnn -Iinclude -c /home/ns/Face-Recognition-Jetson-Nano/src/main.cpp -o obj/Release/src/main.o
g++ -L/usr/local/lib/ -L/usr/lib/ -o bin/Release/FaceRecognition obj/Release/src/main.o obj/Release/src/TArcface.o obj/Release/src/TBlur.o obj/Release/src/TLive.o obj/Release/src/TMtCNN.o obj/Release/src/TRetina.o obj/Release/src/TWarp.o  -fopenmp -I/usr/include/opencv4/opencv -I/usr/include/opencv4 -lopencv_gapi -lopencv_stitching -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_cudabgsegm -lopencv_cudafeatures2d -lopencv_cudaobjdetect -lopencv_cudastereo -lopencv_dnn_objdetect -lopencv_dnn_superres -lopencv_dpm -lopencv_highgui -lopencv_face -lopencv_freetype -lopencv_fuzzy -lopencv_hdf -lopencv_hfs -lopencv_img_hash -lopencv_line_descriptor -lopencv_quality -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_sfm -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_cudacodec -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_dnn -lopencv_plot -lopencv_videostab -lopencv_cudaoptflow -lopencv_optflow -lopencv_cudalegacy -lopencv_video -lopencv_videoio -lopencv_cudawarping -lopencv_xfeatures2d -lopencv_shape -lopencv_ml -lopencv_ximgproc -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_flann -lopencv_xphoto -lopencv_photo -lopencv_cudaimgproc -lopencv_cudafilters -lopencv_imgproc -lopencv_cudaarithm -lopencv_core -lopencv_cudev -ldl -lpthread -s  /usr/local/lib/ncnn/libncnn.a /usr/lib/aarch64-linux-gnu/libvulkan.so /usr/local/lib/ncnn/libglslang.a /usr/local/lib/ncnn/libOGLCompiler.a /usr/local/lib/ncnn/libOSDependent.a /usr/local/lib/ncnn/libSPIRV.a
Output file is bin/Release/FaceRecognition with size 7.35 MB
CWD for depslib was: /home/ns/Face-Recognition-Jetson-Nano.
CWD for depslib is: /home/ns/Face-Recognition-Jetson-Nano.
Scanned 0 files for #includes, cache used 0, cache updated 0
CWD for depslib was: /home/ns/Face-Recognition-Jetson-Nano.
CWD for depslib is: /home/ns/Face-Recognition-Jetson-Nano.
Scanned 0 files for #includes, cache used 0, cache updated 0
CWD for depslib was: /home/ns/Face-Recognition-Jetson-Nano.
CWD for depslib is: /home/ns/Face-Recognition-Jetson-Nano.
Scanned 0 files for #includes, cache used 0, cache updated 0
CWD for depslib was: /home/ns/Face-Recognition-Jetson-Nano.
CWD for depslib is: /home/ns/Face-Recognition-Jetson-Nano.
Scanned 0 files for #includes, cache used 0, cache updated 0
CWD for depslib was: /home/ns/Face-Recognition-Jetson-Nano.
CWD for depslib is: /home/ns/Face-Recognition-Jetson-Nano.
Scanned 0 files for #includes, cache used 0, cache updated 0
Process terminated with status 0 (0 minute(s), 12 second(s))
0 error(s), 0 warning(s) (0 minute(s), 12 second(s))
-------------- Run: Release in FaceRecognition (compiler: GNU GCC Compiler)---------------
Process terminated with status 0 (2 minute(s), 38 second(s))
Qengineering commented 3 years ago

Before going into the deep, did you enable anti-spoofing in main.cpp with #define TEST_LIVING? I had it default disabled to get some extra speed. However, thinking it might get confusing, I've now turned it default on in the code.