nevilparmar11 / Attendance-Management-System-Using-Face-Recognition

Attendance Management system using face recognition.
https://youtu.be/6qQZr9h8qL0
276 stars 132 forks source link

TypeError at /add_photos/ #4

Open amberpande opened 3 years ago

amberpande commented 3 years ago

While adding photos to train this error occurred.

TypeError at /add_photos/ Can't parse 'center'. Sequence item with index 0 has a wrong type Request Method: POST Request URL: http://127.0.0.1:8000/add_photos/ Django Version: 3.1.2 Exception Type: TypeError Exception Value:
Can't parse 'center'. Sequence item with index 0 has a wrong type Exception Location: C:\Users\amber\anaconda3\envs\dj2\lib\site-packages\imutils\face_utils\facealigner.py, line 68, in align Python Executable: C:\Users\amber\anaconda3\envs\dj2\python.exe Python Version: 3.8.5 Python Path:
['C:\Users\amber\Documents\Attendance-Management-System-Using-Face-Recognition\Attendance-System-Using-Face-Recognition', 'C:\Users\amber\anaconda3\envs\dj2\python38.zip', 'C:\Users\amber\anaconda3\envs\dj2\DLLs', 'C:\Users\amber\anaconda3\envs\dj2\lib', 'C:\Users\amber\anaconda3\envs\dj2', 'C:\Users\amber\anaconda3\envs\dj2\lib\site-packages'] Server time: Wed, 01 Sep 2021 12:03:09 +0530

Traceback (most recent call last): File "C:\Users\amber\anaconda3\envs\dj2\lib\site-packages\django\core\handlers\exception.py", line 47, in inner response = get_response(request) File "C:\Users\amber\anaconda3\envs\dj2\lib\site-packages\django\core\handlers\base.py", line 179, in _get_response response = wrapped_callback(request, *callback_args, *callback_kwargs) File "C:\Users\amber\anaconda3\envs\dj2\lib\site-packages\django\contrib\auth\decorators.py", line 21, in _wrapped_view return view_func(request, args, **kwargs) File "C:\Users\amber\Documents\Attendance-Management-System-Using-Face-Recognition\Attendance-System-Using-Face-Recognition\recognition\views.py", line 561, in add_photos create_dataset(username) File "C:\Users\amber\Documents\Attendance-Management-System-Using-Face-Recognition\Attendance-System-Using-Face-Recognition\recognition\views.py", line 96, in create_dataset face_aligned = fa.align(frame,gray_frame,face) File "C:\Users\amber\anaconda3\envs\dj2\lib\site-packages\imutils\face_utils\facealigner.py", line 68, in align M = cv2.getRotationMatrix2D(eyesCenter, angle, scale)

Exception Type: TypeError at /add_photos/ Exception Value: Can't parse 'center'. Sequence item with index 0 has a wrong type

mohitsingh538 commented 2 years ago

While adding photos to train this error occurred.

TypeError at /add_photos/ Can't parse 'center'. Sequence item with index 0 has a wrong type Request Method: POST Request URL: http://127.0.0.1:8000/add_photos/ Django Version: 3.1.2 Exception Type: TypeError Exception Value: Can't parse 'center'. Sequence item with index 0 has a wrong type Exception Location: C:\Users\amber\anaconda3\envs\dj2\lib\site-packages\imutils\face_utils\facealigner.py, line 68, in align Python Executable: C:\Users\amber\anaconda3\envs\dj2\python.exe Python Version: 3.8.5 Python Path: ['C:\Users\amber\Documents\Attendance-Management-System-Using-Face-Recognition\Attendance-System-Using-Face-Recognition', 'C:\Users\amber\anaconda3\envs\dj2\python38.zip', 'C:\Users\amber\anaconda3\envs\dj2\DLLs', 'C:\Users\amber\anaconda3\envs\dj2\lib', 'C:\Users\amber\anaconda3\envs\dj2', 'C:\Users\amber\anaconda3\envs\dj2\lib\site-packages'] Server time: Wed, 01 Sep 2021 12:03:09 +0530

Traceback (most recent call last): File "C:\Users\amber\anaconda3\envs\dj2\lib\site-packages\django\core\handlers\exception.py", line 47, in inner response = get_response(request) File "C:\Users\amber\anaconda3\envs\dj2\lib\site-packages\django\core\handlers\base.py", line 179, in _get_response response = wrapped_callback(request, *callback_args, *callback_kwargs) File "C:\Users\amber\anaconda3\envs\dj2\lib\site-packages\django\contrib\auth\decorators.py", line 21, in _wrapped_view return view_func(request, args, **kwargs) File "C:\Users\amber\Documents\Attendance-Management-System-Using-Face-Recognition\Attendance-System-Using-Face-Recognition\recognition\views.py", line 561, in add_photos create_dataset(username) File "C:\Users\amber\Documents\Attendance-Management-System-Using-Face-Recognition\Attendance-System-Using-Face-Recognition\recognition\views.py", line 96, in create_dataset face_aligned = fa.align(frame,gray_frame,face) File "C:\Users\amber\anaconda3\envs\dj2\lib\site-packages\imutils\face_utils\facealigner.py", line 68, in align M = cv2.getRotationMatrix2D(eyesCenter, angle, scale)

Exception Type: TypeError at /add_photos/ Exception Value: Can't parse 'center'. Sequence item with index 0 has a wrong type

I might be later to answer, so probably this could help someone in the future...if you are getting this error "Exception Value: Can't parse 'center'. Sequence item with index 0 has a wrong type", downgrade your OpenCV-python to the version mentioned in requirements.txt. The newer version throws the error. Tried on Python 3.9.

GurvGupta commented 1 year ago

The version of OpenCV-python mentioned in requirements file is also throwing the same error.