Python code of Face data collection is not running

well i was writing the code for collecting the data of my faces and after editing i have written almost the same code as prateek bhaiya but when i run that python file in my terminal for collecting face data the video frame doesnt appear only the green light on my camera turns on which suggest that camera is turning on but the video frame is not displaying and i have also checked the cv2.imshow(frame) and that was written correctly so whats the matter ??

and after this. i try to run the exact same code from Prateek bhaiya and the problem is still there

hey @amankharb , can you please provide me with link to your code.

hey @amankharb ,
I tried the same code provided on my own system , it working perfectly fine just make the below change in your code :

for face in faces[0] - > for face in faces

If still the same problem persist, there might be some problem in your system , you can try one of these options:

  1. Restart your system.
  2. Uninstall OpenCV and Re-Install it again.
  3. Try some debugging techniques like , print something if any face is detected , just to check whether any face is being detected or not.

I hope this would resolve your doubt .
Happy Learning :slight_smile:.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.