Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3 opencv 3.4.1 #32

Closed
hiteshn97 opened this issue Jun 18, 2018 · 6 comments
Closed

python3 opencv 3.4.1 #32

hiteshn97 opened this issue Jun 18, 2018 · 6 comments

Comments

@hiteshn97
Copy link

I have read your issue #25 , but my problem still persists.

OpenCV(3.4.1) Error: Unspecified error (The node is neither a map nor an empty collection) in cvGetFileNodeByName, file /io/opencv/modules/core/src/persistence_c.cpp, line 753
Traceback (most recent call last):
  File "main.py", line 137, in <module>
    recognizer.read("model.yaml")
cv2.error: OpenCV(3.4.1) /io/opencv/modules/core/src/persistence_c.cpp:753: error: (-2) The node is neither a map nor an empty collection in function cvGetFileNodeByName

This is the error, you mentioned to change line 62,
recognizer.save("cont.yaml") to
recognizer.save("model.yaml")
but this is my line 62
predict_tuple = recognizer.predict(frame_orginal_grayscale)

I am not able to figure out, what's wrong?

@prsntmaurya
Copy link
Member

It's the same issue that's handled in issue #25, Please read it carefully.
It is mentioned to change line number 62 in the file "create_models.py" not "main.py".
Please run create_model.py first after making the changes to generate the weight(feature) file("model.yaml") which will be used by "main.py".

@prsntmaurya
Copy link
Member

I hope the problem is resolved.

@hiteshn97
Copy link
Author

Yes, the problem is solved. Thank you.
I'd like to ask is how can I increase the confidence level before classifying one as a person, the confidence level it shows is 216, how is it calculated. And to increase the frames processed per second and reduce ram used, will it help to convert it to grayscale as I am doing project using cctv footage for tracking people and not much of ram is available. . ?

@hiteshn97
Copy link
Author

I am running your code on Big Bang Theory episode, it's working really well. Will it be possible to detect a sitting human by making alterations to your code?

@prsntmaurya
Copy link
Member

I would highly recommend you to go through the report of this project prepared by us. This will give you the clear and in-depth understanding of the algorithms and features used. The report can be found here.

I am trying to answer your questions breifly:

  1. The confidence value play here a major role in face recognition. Lower confidence value indicate the it is same person and vice versa.
  2. To increase fps you can resize your video to lower resolution but there is always a tradeoff between accuracy and fps. It means if you resize image the smaller persons will be missed.
  3. Converting to grayscale will not help much instead resize the frame to lower resolution using openCV will help you to reduce RAM usage.
  4. Yes, it is possible to detect sitting humans, is detect sitting humans in the current state but it is not very accurate at it. If you want to make it more accurate and robust please retrain it giving those kind of images.

@hiteshn97
Copy link
Author

Thanx for your reply. I will keep them in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants