ageitgey / ageitgey/face_recognition

TypeError: 'NoneType' object is not subscriptable

Open
#663 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
56.8k
Forks
13.7k
PR merge metrics
No merged PRs in 30d

Description

  • face_recognition version:
    face_recognition/examples/facerec_from_webcam.py
  • Python version:
    3.6.5
  • Operating System:
    Linux Centos7
Description

Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.
IMPORTANT: If your issue is related to a specific picture, include it so others can reproduce the issue.

What I Did

copied to jupyter notebook python page " face_recognition/examples/facerec_from_webcam.py"
and executed. For the first time always work fine but after closing and reoping, getting this error.

TypeError Traceback (most recent call last)
in ()
61
62 # Convert the image from BGR color (which OpenCV uses) to RGB color (which face_recognition uses)
---> 63 rgb_frame = frame[:, :, ::-1]
64
65

TypeError: 'NoneType' object is not subscriptable

Thanks and best regards

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The failure is reported at line 63 of face_recognition/examples/facerec_from_webcam.py when run in a Jupyter notebook. Start by running the example after reopening the webcam and inspect the frame value before that line. Done means explaining why the reopened webcam produces a None frame and ensuring the reported TypeError no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
opencv, python
Domain
computer-vision
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.