ITCoders / Human-detection-and-Tracking

Human-detection-and-Tracking
Apache License 2.0
856 stars 307 forks source link

python3 opencv 3.4.1 #32

Closed hiteshn97 closed 6 years ago

hiteshn97 commented 6 years ago

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 commented 6 years ago

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 "_createmodels.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 commented 6 years ago

I hope the problem is resolved.

hiteshn97 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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