fangfufu / Linux-Fake-Background-Webcam

Faking your webcam background under GNU/Linux, now supports background blurring, animated background, colour map effect, hologram effect and on-demand processing.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mediapipe error version during installation

edefranco opened this issue · comments

I follow your instructions for Ubuntu 18.04: all ok, but when i run install.sh I get this error:

ERROR: Could not find a version that satisfies the requirement mediapipe>=0.8.5

I have manually download the src of mediapipe 0.8.5 and I have executed:

pip3 install --user -r requirements.txt

but after this how can I install it so that it is seen by fake.py ?

Thanks in advance,

Emilio

Ok, I have simply install it with pip3 install mediapipe and this have installed for my python version 3.6.9 the mediapipe 0.8.5, but now running fake.py I get these errors:

Real camera original values are set as: 640x480 with 30 FPS and video codec 1448695129 Cannot set camera property 6 to 844715353. Defaulting to auto-detected property set by opencv Real camera new values are set as: 640x480 with 30 FPS and video codec 1448695129 Traceback (most recent call last): File "fake.py", line 374, in <module> main() File "fake.py", line 364, in main v4l2loopback_path=args.v4l2loopback_path) File "fake.py", line 130, in __init__ self.classifier = mp.solutions.selfie_segmentation.SelfieSegmentation(model_selection=1) AttributeError: module 'mediapipe.python.solutions' has no attribute 'selfie_segmentation'

Any help is very appreciated,

Emilio

I am not sure if you installed Mediapipe properly. Please uninstall Mediapipe, check if your pip is up-to-date. The README provides instruction on how to update pip. To install Mediapipe, you need to make sure your pip is up-to-date.

I have updated pip before install mediapipe ...
pip3 --version tell me:
pip 21.1.2 from /usr/local/lib/python3.6/dist-packages/pip (python 3.6)
In any case, tomorrow morning I will uninstall mediapipe and will try to install again with ./install.sh
I suspect that mybe the problem can be related to path.
Actualy I have installed all in my home in .local/bin and .local/lib (all packages mediapipe, cv2, etc are in /home/emilio/.local/lib/python3.6/site-packages/)... I dont'know if it is right ... /home/emilio/.local/bin is in the $PATH ...

Emilio

I suspect that mybe the problem can be related to path.

I agree, the error message seems to be related to Mediapipe, rather than my code.

If you run python3 -v fake.py, it generates really long debug messages, and it tells you where it is importing the Python packages from.

Firstly, the version of mediapipe that I had installed was 0.8.3 ! Now I have uninstalled it.
Secondly, the debug tell me that all packeages was loaded from the correct path into .local
Now, I have not installed mediapipe, and have pip version 21.1.2.
But when I execute your .install i get this:
ERROR: Could not find a version that satisfies the requirement mediapipe>=0.8.5 (from versions: 0.7.10, 0.8.0, 0.8.1, 0.8.2, 0.8.3)
ERROR: No matching distribution found for mediapipe>=0.8.5

How I can convince pip3 to get and install mediapipe 0.8.5 ? Why it don't see the version 0.8.5 ?
Maybe I need to upgrade python to 3.7 ?

Now on my system (xubuntu 18.04.05 64bit) I have python 2.7, python 3.6 and yesterday I have also installed python 3.7 minimal ...
What do you think?
Emilio

pip is not in .local/bin is installed in /usr/local/bin (which pip tell me /usr/local/bin and /usr/local/bin/pip --version tell me pip 21.1.2 from /usr/local/lib/python3.6/dist-packages/pip (python 3.6) )
I have also tried to download from https://pypi.org/project/mediapipe/0.8.5/ the file mediapipe-0.8.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl but pip don't install because it tell me that this file is not for my platform ...
Emilio

the mediapipe-0.8.6 is out !
I make a "trick": I downloaded the mediapipe-0.8.6 package from pypi.org, extract all, copied all into .local/lib/python3.6/site-packages and in mediapipe/python I have replaced the original xxx.x86_64-linux-gnu.so with the file _framework_bindings.cpython-36m-x86_64-linux-gnu.so copied from mediapipe 0.8.3 installed with pip.

Now the previous error (AttributeError: module 'mediapipe.python.solutions' has no attribute 'selfie_segmentation') is disappeared but I have a new error:

Traceback (most recent call last): File "/home/emilio/.local/bin/fake.py", line 15, in <module> import mediapipe as mp File "/home/emilio/.local/lib/python3.6/site-packages/mediapipe/__init__.py", line 16, in <module> from mediapipe.python import * File "/home/emilio/.local/lib/python3.6/site-packages/mediapipe/python/__init__.py", line 20, in <module> from mediapipe.python._framework_bindings.image import Image ModuleNotFoundError: No module named 'mediapipe.python._framework_bindings.image'; 'mediapipe.python._framework_bindings' is not a package

Maybe there are some things to adjust, but is a small step forward ...

Any help is welcomed, thanks in advance,

Emilio

Please put .local/bin in your $PATH, because when I installed Python module locally, it complained about it. You have some weird pathing issue. Also you might want to open up a ticket at Mediapipe repository rather than here.

.local/bin is in my path ... I have also copied fake.py in .local/bin ... Yes, I am thinkink to open a ticket on mediapipe ... but I don't know exactly how to do ... I have not seen nothing about on mediapipe site ... but maybe I didn't look good ... Why my path is weird ? I have installed all packages as you suggested with --user option on pip3 command ...
Emilio

My $PATH is:
/home/emilio/bin:/home/emilio/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

the mediapipe-0.8.6 is out !
I make a "trick": I downloaded the mediapipe-0.8.6 package from pypi.org, extract all, copied all into .local/lib/python3.6/site-packages and in mediapipe/python I have replaced the original xxx.x86_64-linux-gnu.so with the file _framework_bindings.cpython-36m-x86_64-linux-gnu.so copied from mediapipe 0.8.3 installed with pip.

Now the previous error (AttributeError: module 'mediapipe.python.solutions' has no attribute 'selfie_segmentation') is disappeared but I have a new error:

Traceback (most recent call last): File "/home/emilio/.local/bin/fake.py", line 15, in <module> import mediapipe as mp File "/home/emilio/.local/lib/python3.6/site-packages/mediapipe/__init__.py", line 16, in <module> from mediapipe.python import * File "/home/emilio/.local/lib/python3.6/site-packages/mediapipe/python/__init__.py", line 20, in <module> from mediapipe.python._framework_bindings.image import Image ModuleNotFoundError: No module named 'mediapipe.python._framework_bindings.image'; 'mediapipe.python._framework_bindings' is not a package

Maybe there are some things to adjust, but is a small step forward ...

Any help is welcomed, thanks in advance,

Emilio

This sounds like your mediapipe hasn't been installed properly.

The support of mediapipe tell me that 0.8.5 version is compatible only from python version 3.7 !
Maybe the solution is updating python 3.6 to 3.7.

Is not more simple because all the system is actually based on 3.6.

I installed 3.7, but all system continue to referrer to 3.6 ...

I seen 2 possible solution:

  1. try to make functionaly the version 0.8.6 that I have installed with the trick;
  2. deep upgrading to 3.7 version.

I'll try both ways

Emilio

Ok, with python 3.7 all working fine !
On ubuntu 18.04 before starting with any installation is need to upgrade python from 3.6 to 3.7.
After that, following your instructions, all working fine on the first try !

Thank for your patience and support.

Emilio