Closed valenotary closed 2 months ago
Thanks for reporting this.
1) That is odd that mediapipe is not installed. Will look into this. 2) I will check why Face.landmarks are not defined.
Could you share your code sample?
It is extremely weird. @valenotary did you change anything in source code, I cannot find line causing issue, there seem to be no such print statements.
Which version of the library are you using?
If you can test it with 2.5.4
. Let me know if it works.
@PeterWaIIace I was testing with 2.4.2
when I logged the issue, which was the latest release according to the GitHub repo.
Just retested the same project with eyeGestures==2.5.4
as you recommended...
The code sample I'm using is just the one that is one the README of the repository.
So now I'm not having the same issue as originally stated with this newer version, but there is another AttributeError
(not sure if it's an issue with the example or the library):
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1722989930.886810 5113341 gl_context.cc:357] GL version: 2.1 (2.1 Metal - 89.3), renderer: Apple M3 Max
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
W0000 00:00:1722989930.888410 5113400 inference_feedback_manager.cc:114] Feedback manager requires a model with a single signature inference. Disabling support for feedback tensors.
W0000 00:00:1722989930.892134 5113397 inference_feedback_manager.cc:114] Feedback manager requires a model with a single signature inference. Disabling support for feedback tensors.
Traceback (most recent call last):
File "/Users/valenotary/PycharmProjects/math-olympiad-solver/src/eye-tracking.py", line 20, in <module>
cursor_x, cursor_y = event.point[0], event.point[1]
^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'point'
Exception ignored in: <module 'threading' from '/opt/anaconda3/envs/pytorch-env/lib/python3.11/threading.py'>
Traceback (most recent call last):
File "/opt/anaconda3/envs/pytorch-env/lib/python3.11/threading.py", line 1583, in _shutdown
lock.acquire()
The first set of warnings are the same as before but the latest Traceback log points to the Event
returned by gestures.step
being None
...
@valenotary
Oh yes, warnings are produced by dependencies. However, it seems that previous errors have gone away with recent fixes, so that is good. Output works fine: no detection of face, so it produces None
.
I will think about changing to variant value/error type in the future, but for now, the correct approach is to check against if event
and cevent
are None
.
Also updated readme code with same check.
I would recommend you to first try using examples as well as they should be much more functional. Readme is more of sample/overview, but it does not cover every edge case. If examples do not work for you then it will be weird.
@valenotary
If there is no more issues I will close this thread in about week. You can reach me via discord too: https://discord.gg/BFE5rTNY
Trying the "V2 Machine Learning Approach" on the main README of the repository on an M3 Max. Even after sorting out the runtime dependencies manually (e.g.
opencv
andmediapipe
needed to be installed manually for some reason instead of being included as a part of the pip install), I get the following error logs.I see that
Face.landmarks
does not even get defined untilFace.process
is called, but I can't find whereFace.process
is called first... Also maybe it's just some Mac limitation but I'm pretty sure I've given the right permission for my process to access the camera (running this through Pycharm).Also, at the point that we get the
AttributeError
, the app is still running, although it just hangs until I use a KeyboardInterrupt to get out of it and back to my terminal.