cftang0827 / face_alignment

Simple face alignment library by using face_recognition and opencv
16 stars 5 forks source link

matplotlib issue #2

Open muhk01 opened 4 years ago

muhk01 commented 4 years ago

hi thanks for sharing the source, but unfortunately I am unable to run the program and give this following error: Traceback (most recent call last): File "test.py", line 8, in <module> plt.imshow(img1_a) File "/usr/local/lib/python3.7/site-packages/matplotlib/pyplot.py", line 2683, in imshow None else {}), **kwargs) File "/usr/local/lib/python3.7/site-packages/matplotlib/__init__.py", line 1601, in inner return func(ax, *map(sanitize_sequence, args), **kwargs) File "/usr/local/lib/python3.7/site-packages/matplotlib/cbook/deprecation.py", line 369, in wrapper return func(*args, **kwargs) File "/usr/local/lib/python3.7/site-packages/matplotlib/cbook/deprecation.py", line 369, in wrapper return func(*args, **kwargs) File "/usr/local/lib/python3.7/site-packages/matplotlib/axes/_axes.py", line 5671, in imshow im.set_data(X) File "/usr/local/lib/python3.7/site-packages/matplotlib/image.py", line 690, in set_data .format(self._A.shape)) TypeError: Invalid shape (1, 224, 224, 3) for image data

muhk01 commented 4 years ago

neither code nor images was replaced, just clone install newest libraries and then give the following error

Coderx7 commented 4 years ago

the resulting image has a batch dimension(note 1 in the shape : (1, 224, 224, 3) ). simply doing plt.imshow(img1_a[0]) should do the trick!