nwesem / mtcnn_facenet_cpp_tensorRT

Face Recognition on NVIDIA Jetson (Nano) using TensorRT
GNU General Public License v3.0
200 stars 72 forks source link

No opencv window comes up after all the steps #3

Closed zerocool95 closed 3 years ago

zerocool95 commented 4 years ago

I am trying to run the code on jetson nano and everything works like a charm but in the end i dont see any screen , only some continuous logs on the screen . What could be the possible reason for this? I have also changed the camera to usb camera and tested it on jetson via a python code and the camera seems to work perfectly fine. Any help would be appreciated !

Thanks !

nwesem commented 4 years ago

hi zerocool95, usually in OpenCV the combination of cv::imshow("VideoSource", frame); and char keyboard = cv::waitKey(1); should create and update the OpenCV GUI. As this is what happens in the main.cpp, it should show the GUI or as you call it the window. You can find it in the main.cpp here: https://github.com/nwesem/mtcnn_facenet_cpp_tensorRT/blob/master/src/main.cpp#L88-L93

i am guessing that you have changed one of these lines in the code? let me know if that helps, if not can you fork the repository and push your current code?

zerocool95 commented 4 years ago

I haven't changed any of the code in the current repository. Is it possible for it to a memory issue because i dont have much memory available on my jetson?

lucasBruge commented 4 years ago

I think I may have the same kind of problem... It runs, but only writes INFOs to the console, like

INFO: tatic 0 time0.213432648

...I added some debug outputs to main.cpp, and it seems trapped on FaceNetClassifier() initialization on line 41.

But I just realized that I don't have any "facenet.engine" file (line 28)... Of course it's my bad, but I'm lost...

I'll appreciate some help... thanks!!! Great work!!!

lucasBruge commented 4 years ago

...It woked!!! It was creating the files!!! It needed some patience... great!!!

lucasBruge commented 4 years ago

...but It didn't a second time :(

do-van-long commented 4 years ago

@lucasBruge me too. Have you found a solution yet? @nwesem Could you please help me with the second execution? The error looks like this:

Empty frame! Exiting ... Counted 0 frames in 0 seconds! This equals nanfps. Segmentation fault (core dumped)

lucasBruge commented 4 years ago

Ey, @do-van-long. It was kind of strange thing I couldn't figure it out. It started to work ok just wright after the boot. But, it keeps failing sometimes then... I mean, sometimes works, the second, ther or forth time... but sometimes it didn't.... don't know why

do-van-long commented 4 years ago

@lucasBruge Thank for your answer. I think it's the camera problem. After resetting my Jetson Nano and check for camera, the program works quite well.

sivak95 commented 4 years ago

Has anyone got this to work using OpenCV 4.2?

lucasBruge commented 4 years ago

Check this comment (and the thread), it may help...

https://github.com/nwesem/mtcnn_facenet_cpp_tensorRT/issues/4#issuecomment-585973312

nwesem commented 4 years ago

Thanks again @lucasBruge. It seems like multiple people have had this issue. Does it make sense to change this on the master branch? What do you think @lucasBruge ?

git-yu-inoue commented 4 years ago

@lucasBruge, do-van-long second time problem's Cause is not release VideoStreamer.

src/videoStreamer.cpp add file end

void VideoStreamer::release() { m_capture->release(); }

src/videoStreamer.h add this

... public std::string gstreamer_pipeline (int capture_width, int capture_height, int display_width, int display_height, int frameRate, int flip_method=0); void release(); // <- this line add };

src/main.cpp add this

auto globalTimeEnd = chrono::steady_clock::now();
videoStreamer.release(); // <- this line add
cv::destroyAllWindows();

I worked.

and opencv problem is there CV_RGB2BGR -> cv::COLOR_RGB2BGR

   //cv::cvtColor(m_croppedFaces[i].faceMat, m_croppedFaces[i].faceMat, CV_RGB2BGR);
    cv::cvtColor(m_croppedFaces[i].faceMat, m_croppedFaces[i].faceMat, cv::COLOR_RGB2BGR);

nwesem commented 3 years ago

Thanks a lot! All of this was fixed and released on master branch, also there are tags now so you can jump back if you are using an older version of Jetpack