boltgolt / howdy

🛡️ Windows Hello™ style facial authentication for Linux
MIT License
5.84k stars 298 forks source link

[numpy 1.x.x - fix not working] RuntimeError: Unsupported image type, must be 8bit gray or RGB image. #946

Open derFelix244 opened 3 months ago

derFelix244 commented 3 months ago

Heyho, I am getting an Error when trying to set up Howdy on my Thinkpad T490: grafik

The Snapshot command is working but the output is not readable.

Let's trace it back: I set up Howdy with my camera working but a dark image. I fixed that using linux-enable-ir-emitter. Ever since then howdy is borged and producing the above error (Preview opened for about half a frame before).

Steps I took trying to fix it:

Also here is my output of v4l2-ctl --list-formats -d /dev/video2: grafik


I've searched for similar issues already, a similar issue has been reported but isn't fixing my problem.

Linux distribution: Endeavor OS

Howdy version: Same on 2.6.1 and 3.0 BETA

mathieujobin commented 2 months ago

my system is complaining I should downgrade numpy, but I don't know python, especially not on Fedora. I installed via dnf following the instructions on this website.

https://itsfoss.com/face-unlock-ubuntu/

and according to this issue, downgrading does not work, so I will wait...

this is the backtrace I am getting

sudo howdy -U mathieu add

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.1 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):  File "/usr/bin/howdy", line 95, in <module>
    import cli.add
  File "/usr/lib64/security/howdy/cli/add.py", line 10, in <module>
    import cv2
  File "/usr/lib64/python3.12/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/usr/lib64/python3.12/site-packages/cv2/__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
  File "/usr/lib64/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
Traceback (most recent call last):
  File "/usr/local/lib64/python3.12/site-packages/numpy/core/_multiarray_umath.py", line 44, in __getattr__
    raise ImportError(msg)
ImportError: 
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.1 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):
  File "/usr/bin/howdy", line 95, in <module>
    import cli.add
  File "/usr/lib64/security/howdy/cli/add.py", line 10, in <module>
    import cv2
  File "/usr/lib64/python3.12/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/usr/lib64/python3.12/site-packages/cv2/__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: numpy.core.multiarray failed to import
mathieu@fedora:~$ 
killi1812 commented 2 months ago

Is there any progress on this issue?

derFelix244 commented 2 months ago

Nope, sadly not. But I also didn't try to use Howdy again since reinstalling on a new SSD.

1111Windows commented 2 months ago

I'm also running into this issue and my workaround is: sudo pip install numpy==1.26.4

skjongithub commented 2 months ago

2024/9/4 update: In my Garuda linux machines x 2 numpy 2.0.1, howdy-beta-git 2.6.1.r245.gaa75c76-1, python-dlib 19.24.6-1 ffmpeg 2:7.0.2-1, libplacebo 7.349.0-1 are compatible, and now Howdy works fine

P.S. make sure the python environment where you try to debug is the one used by your Linux system. E.g. if you manipulate pip rather than sudo pip, you may only massing around with "user Python environment" rather than "system Python environment", which is probably the one used by Howdy.

sreu94 commented 2 weeks ago

I get the same error message on my Surface Laptop 4 (AMD). I dont quite get what you did to fix this error. Could you please explain?

derFelix244 commented 2 weeks ago

Hi, funnily enough, It solved itself. Which means that sadly, I don't have a solution. I bought a new SSD for my Thinkpad, so I had to reinstall the OS. today I got it to work without issues regarding Howdy.

Although... I did one single thing different: I entered the /dev/v4l/by-id of my device into the Howdy config instead of whatever I did the last time. I hope this might help - I should have followed the Arch wiki hehe