Snapchat_filter

Hey @monika, please explain issue you are facing. And please share your ipynb notebooks so that we can see the error there itself. To share the ipynb notebook, upload it on google drive and than share the link here.

showing error in xml files

https://drive.google.com/file/d/1vl-q8RTMgzesooiXDIQzjU6vfIo6TOTq/view?usp=sharing

Hey @monika, this is due to opencv version. Later versions didn’t supported the xml files. Use this command
pip install opencv-python==4.0.1.23

Hope this cleared your doubt. :blush:

1 Like

its not working
showing some error in code
please check the code once

Please share the screenshot of the error, code seems fine.

C:\Users\sanja\Desktop\Monika\coding block\ML\OpenCV\snapchat_filter>python snap_filter.py
Traceback (most recent call last):
File “snap_filter.py”, line 14, in
ret,frame=cap.read()
AttributeError: ‘numpy.ndarray’ object has no attribute ‘read’

Replace
ret,frame = cap.read()
to
frame = cap

1 Like

Also your code is for video stream, you need to modify it for a single image, do you code in jupyter notebook and use plt.imshow() instead of cv2.imsho() for your convenience.

1 Like

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.