nischi / MMM-Face-Reco-DNN

Face recognition with opencv and deep neural network
MIT License
91 stars 46 forks source link

USB camera support #28

Closed ankesh27 closed 4 years ago

ankesh27 commented 4 years ago

Does your code Supports USB camera.

I am using Logitech USB camera and below is the error I am getting on running python3 facerecognition.py

{"status": "loading encodings + face detector..."}
{"status": "starting video stream..."}
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/picamera/camera.py", line 456, in _init_camera
    self._camera = mo.MMALCamera()
  File "/usr/lib/python3/dist-packages/picamera/mmalobj.py", line 2279, in __init__
    super(MMALCamera, self).__init__()
  File "/usr/lib/python3/dist-packages/picamera/mmalobj.py", line 633, in __init__
    prefix="Failed to create MMAL component %s" % self.component_type)
  File "/usr/lib/python3/dist-packages/picamera/exc.py", line 184, in mmal_check
    raise PiCameraMMALError(status, prefix)
picamera.exc.PiCameraMMALError: Failed to create MMAL component b'vc.ril.camera': Out of memory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "facerecognition.py", line 73, in <module>
    vs = VideoStream(usePiCamera=True).start()
  File "/home/pi/.local/lib/python3.7/site-packages/imutils/video/videostream.py", line 18, in __init__
    framerate=framerate, **kwargs)
  File "/home/pi/.local/lib/python3.7/site-packages/imutils/video/pivideostream.py", line 10, in __init__
    self.camera = PiCamera()
  File "/usr/lib/python3/dist-packages/picamera/camera.py", line 431, in __init__
    self._init_camera(camera_num, stereo_mode, stereo_decimate)
  File "/usr/lib/python3/dist-packages/picamera/camera.py", line 460, in _init_camera
    "Camera is not enabled. Try running 'sudo raspi-config' "
picamera.exc.PiCameraError: Camera is not enabled. Try running 'sudo raspi-config' and ensure that the camera has been enabled.
nischi commented 4 years ago

Hi @ankesh27

It seems that you set the parameter usePiCamera to 1, which is default. Is that possible?

Regards

ankesh27 commented 4 years ago

Ah! yes, it worked, I changed it to usePiCamera: 0,

I can see module alerting my name(which is great! :))

However, when i add this module, my other modules doesnot display(i see blank black screen) and if I disable this module, other modules are working/visible.

Any idea why this could be happening?

ankesh27 commented 4 years ago

Solved it, thanks for the help.