0

I have sucessfully mounted the drive :

from google.colab import drive
drive.mount('/content/drive')
IM_PATH = '/content/drive/MyDrive/Test_Images/' #image path

Then tried to load image for face recognition using following command :

imgAks = face_recognition.load_image_file('lena.png')

But its giving this error.. please help me rectify the issue

FileNotFoundError                         Traceback (most recent call last)
<ipython-input-13-127946dfeca9> in <module>
----> 1 imgAks = face_recognition.load_image_file('lena.png')
2 imgAks = cv2.cvtColor(imgAks, cv2.COLOR_BGR2RGB)

1 frames
/usr/local/lib/python3.7/dist-packages/PIL/Image.py in open(fp, mode)
2841 
2842     if filename:
-> 2843         fp = builtins.open(filename, "rb")
2844         exclusive_fp = True
2845 

FileNotFoundError: [Errno 2] No such file or directory: 'lena.png'
  • After you load the drive, do you see your file in the explorer in the left pane? https://stackoverflow.com/a/53282688/4168707 – kgkmeekg Oct 08 '22 at 08:55
  • Why do you set IM_PATH and then you don't use it? – Markus Oct 08 '22 at 09:43
  • Thanks a lot for your response. Actually it is working well with pycharm or spyder but the working environment with Colab is slightly different. – Himexplore Oct 09 '22 at 13:03

0 Answers0