Facial Recognition Error

Ask questions about projects relating to: computer science or pure mathematics (such as probability, statistics, geometry, etc...).

Moderators: kgudger, bfinio, Moderators

Post Reply
bluerazzy
Posts: 3
Joined: Wed Jan 22, 2025 7:38 pm
Occupation: Student

Facial Recognition Error

Post by bluerazzy »

I am having a hard time with the last part of the code. I am getting an error after capturing a picture on my webcam. In the Zip files, there are no pictures or files in the "verification_images" folder. Should files be here?

Moderator Note: Project: https://www.sciencebuddies.org/science- ... ecognition
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-48-cd9a2c1b5feb> in <cell line: 0>()
6
7 # Call the real_time_verification function with the specified detection and verification thresholds
----> 8 real_time_verification(siamese_model, detection_threshold, verification_threshold)

1 frames
<ipython-input-43-d11e2371f158> in verify(model, detection_threshold, verification_threshold)
9
10 # Iterate through each image in the verification directory
---> 11 for image in os.listdir(verification_image_path):
12 # Preprocess input and validation images
13 input_img = preprocess(os.path.join(input_image_path, 'input_image.jpg'))

FileNotFoundError: [Errno 2] No such file or directory: '/content/drive/MyDrive/facial_recognition_with_dataset/application_data/verification_images'
amyCC
Site Admin
Posts: 405
Joined: Wed Apr 01, 2020 4:02 pm
Occupation: Moderator
Project Question: *
Project Due Date: *
Project Status: Not applicable

Re: Facial Recognition Error

Post by amyCC »

Hi - I am sorry to hear you are having trouble with your notebook. To confirm, you are using the facial_recognition.zip file that does not include anchor and positive data. You then used step 2 and successfully took images with your webcam? You ran into no problems with step 2.2?

Please make sure that if you are returning to the project, you re-run all prior blocks, including mounting the google drive.

Update: We are evaluating a problem with the code. I will update this thread tomorrow.

Amy
Science Buddies
amyCC
Site Admin
Posts: 405
Joined: Wed Apr 01, 2020 4:02 pm
Occupation: Moderator
Project Question: *
Project Due Date: *
Project Status: Not applicable

Re: Facial Recognition Error

Post by amyCC »

Hi - We have posted an updated file for facial_recognition.zip (This assumes that you were doing the version that does not have a data set and using the webcam to take your photos.

You will need to download the zip file from step 2.a under "Setting Up the Google Colab Environment" in the project. (https://www.sciencebuddies.org/science- ... ecognition)

Please rename your Google Drive folder from your original testing so that you can create a new one. Upload the new folder that contains the notebook file. (You can copy or move your webcam images over from the prior anchor and positive folders so that you don't have to redo those).

Then open the notebook again (doubleclick it from the drive folder) in colab. Go through the steps again to run all blocks, including mounting the Google drive. When you get to step 2.2., if you've copied over your webcam images and don't want to take any others, you can just do "q" to quit that process.

Then continue through the notebook.

If you run into a problem, please let us know.

Amy
Science Buddies
bluerazzy
Posts: 3
Joined: Wed Jan 22, 2025 7:38 pm
Occupation: Student

Re: Facial Recognition Error

Post by bluerazzy »

I am using the file with the data set and NOT taking my own pictures. I run into the error at step 8.
Thanks!
amyCC
Site Admin
Posts: 405
Joined: Wed Apr 01, 2020 4:02 pm
Occupation: Moderator
Project Question: *
Project Due Date: *
Project Status: Not applicable

Re: Facial Recognition Error

Post by amyCC »

Hi. Okay. Thank you for confirming. From your mention of the webcam that wasn’t clear.

The other zip file will be checked and updated tomorrow. I will post here when an update is posted.

Amy
amyCC
Site Admin
Posts: 405
Joined: Wed Apr 01, 2020 4:02 pm
Occupation: Moderator
Project Question: *
Project Due Date: *
Project Status: Not applicable

Re: Facial Recognition Error

Post by amyCC »

The zip in the project that contains the notebook has been updated. You can now download that zip for use. Since you didn't add any of your own photos, you may just want to rename your old folder and set up the new download as a new folder and run it from scratch.

If you run into any problems, let us know.

Amy
Science Buddies
bluerazzy
Posts: 3
Joined: Wed Jan 22, 2025 7:38 pm
Occupation: Student

Re: Facial Recognition Error

Post by bluerazzy »

We are still running into an error with the very last step. We are getting an error: Device not found.
amyCC
Site Admin
Posts: 405
Joined: Wed Apr 01, 2020 4:02 pm
Occupation: Moderator
Project Question: *
Project Due Date: *
Project Status: Not applicable

Re: Facial Recognition Error

Post by amyCC »

Can you please show a full screen shot of your error, including the cell number. Make sure you have rerun all blocks (they take quite a bit of time in this one) and that the drive is mounted.

Amy
Post Reply

Return to “Grades 9-12: Math and Computer Science”