1adrianb / face-alignment

:fire: 2D and 3D Face alignment library build using pytorch
https://www.adrianbulat.com
BSD 3-Clause "New" or "Revised" License
7.12k stars 1.35k forks source link

AttributeError: 'NoneType' object has no attribute 'ReadAsArray' #357

Open sugizo opened 9 months ago

sugizo commented 9 months ago

environment google colab

steps

!wget -c https://github.com/1adrianb/face-alignment/blob/master/test/assets/aflw-test.jpg
pip install -U face-alignment

code

import face_alignment
from skimage import io

#fa = face_alignment.FaceAlignment(face_alignment.LandmarksType.TWO_D, flip_input=False)
fa = face_alignment.FaceAlignment(face_alignment.LandmarksType.THREE_D, flip_input=False)

input = io.imread('aflw-test.jpg')
preds = fa.get_landmarks(input)

result

AttributeError                            Traceback (most recent call last)
[<ipython-input-8-98467b9f95a1>](https://localhost:8080/#) in <cell line: 6>()
      4 fa = face_alignment.FaceAlignment(face_alignment.LandmarksType.TWO_D, flip_input=False)
      5 
----> 6 input = io.imread('aflw-test.jpg')
      7 preds = fa.get_landmarks(input)

6 frames
[/usr/local/lib/python3.10/dist-packages/imageio/plugins/gdal.py](https://localhost:8080/#) in _get_data(self, index)
     66             if index != 0:
     67                 raise IndexError("Gdal file contains only one dataset")
---> 68             return self._ds.ReadAsArray(), self._get_meta_data(index)
     69 
     70         def _get_meta_data(self, index):

AttributeError: 'NoneType' object has no attribute 'ReadAsArray'

best regards