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

Option 3: Train Image - Path Error //Help! #45

Open
PhantomCoder2 opened this issue May 22, 2022 · 1 comment
Open

Option 3: Train Image - Path Error //Help! #45

PhantomCoder2 opened this issue May 22, 2022 · 1 comment

Comments

@PhantomCoder2
Copy link

Traceback (most recent call last):
File "C:\Users\Guddu\Face-Recognition-Attendance-System\FRAS\main.py", line 101, in
mainMenu()
File "C:\Users\Guddu\Face-Recognition-Attendance-System\FRAS\main.py", line 41, in mainMenu
CaptureFaces()
File "C:\Users\Guddu\Face-Recognition-Attendance-System\FRAS\main.py", line 79, in CaptureFaces
mainMenu()
File "C:\Users\Guddu\Face-Recognition-Attendance-System\FRAS\main.py", line 44, in mainMenu
Trainimages()
File "C:\Users\Guddu\Face-Recognition-Attendance-System\FRAS\main.py", line 86, in Trainimages
Train_Image.TrainImages()
File "C:\Users\Guddu\Face-Recognition-Attendance-System\FRAS\Train_Image.py", line 40, in TrainImages
faces, Id = getImagesAndLabels("TrainingImage")
File "C:\Users\Guddu\Face-Recognition-Attendance-System\FRAS\Train_Image.py", line 14, in getImagesAndLabels
imagePaths = [os.path.join(path, f) for f in os.listdir(path)]
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'TrainingImage'

@ayush9198gupta
Copy link

Traceback (most recent call last): File "C:\Users\Guddu\Face-Recognition-Attendance-System\FRAS\main.py", line 101, in mainMenu() File "C:\Users\Guddu\Face-Recognition-Attendance-System\FRAS\main.py", line 41, in mainMenu CaptureFaces() File "C:\Users\Guddu\Face-Recognition-Attendance-System\FRAS\main.py", line 79, in CaptureFaces mainMenu() File "C:\Users\Guddu\Face-Recognition-Attendance-System\FRAS\main.py", line 44, in mainMenu Trainimages() File "C:\Users\Guddu\Face-Recognition-Attendance-System\FRAS\main.py", line 86, in Trainimages Train_Image.TrainImages() File "C:\Users\Guddu\Face-Recognition-Attendance-System\FRAS\Train_Image.py", line 40, in TrainImages faces, Id = getImagesAndLabels("TrainingImage") File "C:\Users\Guddu\Face-Recognition-Attendance-System\FRAS\Train_Image.py", line 14, in getImagesAndLabels imagePaths = [os.path.join(path, f) for f in os.listdir(path)] FileNotFoundError: [WinError 3] The system cannot find the path specified: 'TrainingImage'

@PhantomCoder2 As a solution you can do following things in a row :

Install opencv contrib package and if yes and upgrade it to the latest version
Use this and edit your code
recognizer = cv2.face.LBPHFaceRecognizer_create()
Also make sure you will rename the folder name as TrainingImageLabel to TrainingImage completely
Also make sure when you start to train the images you will need to delete the previous yml file from the folder TrainingImage
rest you can create conda/virtual env. in your local directory and the code will run.

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

No branches or pull requests

2 participants