RazZziel / fakecam

Open Source Virtual Background, stolen from https://elder.dev/posts/open-source-virtual-background/
8 stars 2 forks source link

unable to run #1

Open damnms opened 3 years ago

damnms commented 3 years ago

just searching for a way to replace the background for my webcam on fedora 33 beta, i tried your solution. but got some errors.

[root@localhost fakecam]# ./run_docker.sh 
Error: No such network: fakecam
951420d72984bfa2743a0e6be8e1646dbf1099575860a3bad0ebb8ce3a2913fa
Sending build context to Docker daemon  111.7MB
Step 1/8 : FROM tensorflow/tensorflow
latest: Pulling from tensorflow/tensorflow
171857c49d0f: Pull complete 
419640447d26: Pull complete 
61e52f862619: Pull complete 
40085aa86d3c: Pull complete 
b827fdfa00c7: Pull complete 
134f84527676: Pull complete 
e1f30e7788ed: Pull complete 
a13925316d82: Pull complete 
5decca4d86ff: Pull complete 
70c56a3cd1fa: Pull complete 
Digest: sha256:c57fb9628d80872ece8640a22bd0153b2cc8d62d21d79f4d99c3b237a728b62e
Status: Downloaded newer image for tensorflow/tensorflow:latest
 ---> 623195db36df
Step 2/8 : RUN apt update && apt install -y curl make build-essential     && curl -sL https://deb.nodesource.com/setup_12.x | bash -     && apt-get -y install nodejs     && mkdir /.npm     && chmod 777 /.npm
 ---> Running in 97c1ea7cdb51
OCI runtime create failed: this version of runc doesn't work on cgroups v2: unknown
Error: No such container: bodypix
Unable to find image 'bodypix:latest' locally
docker: Error response from daemon: pull access denied for bodypix, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
Sending build context to Docker daemon  23.15MB
Step 1/9 : FROM python:3-buster
3-buster: Pulling from library/python
57df1a1f1ad8: Pull complete 
71e126169501: Pull complete 
1af28a55c3f3: Pull complete 
03f1c9932170: Pull complete 
65b3db15f518: Pull complete 
3e3b8947ed83: Pull complete 
f156949921a1: Pull complete 
1c1931013093: Pull complete 
51fff639b6bf: Pull complete 
Digest: sha256:97acbabcb7ab00f6aedbcb0888621600d3a8a0e1124d0f436d2e63686c34b414
Status: Downloaded newer image for python:3-buster
 ---> bbf31371d67d
Step 2/9 : RUN pip install --upgrade pip
 ---> Running in 81024afbc9c5
OCI runtime create failed: this version of runc doesn't work on cgroups v2: unknown
Error: No such container: fakecam
Unable to find image 'fakecam:latest' locally
docker: Error response from daemon: pull access denied for fakecam, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
Error response from daemon: Cannot kill container: bodypix: No such container: bodypix

the ./run.sh unfortunately also did not run

oli @ ~/fakecam - [master] $ ./run.sh                         
make: Verzeichnis „/home/oli/fakecam/fakecam“ wird betreten
.venv/bin/python fake.py $ARGS
make: Verzeichnis „/home/oli/fakecam/bodypix“ wird betreten
npm install
Traceback (most recent call last):
  File "/home/oli/fakecam/fakecam/fake.py", line 2, in <module>
    import cv2
ModuleNotFoundError: No module named 'cv2'
make: *** [Makefile:2: all] Fehler 1
make: Verzeichnis „/home/oli/fakecam/fakecam“ wird verlassen
make: *** [Makefile:5: package-lock.json] Beendet
oli @ ~/fakecam - [master] $ ./run

any idea?
damnms commented 3 years ago

with podman i got a bit further

but at the end it also crashes

STEP 10: COMMIT fakecam
--> 6e7c5dc8bc0
6e7c5dc8bc0bcfc6d301fb3c93262044bab0b450074c1650932651be04b125b2
b1aa1314a503e08a137de91c187442cea24341ca1a32c60108fc189e5926e697
Traceback (most recent call last):
  File "fake.py", line 7, in <module>
    from videocaptureasync import VideoCaptureAsync
ModuleNotFoundError: No module named 'videocaptureasync'
07ea430c7baaea83ca1f3db425eafd86660a73154dd8ec9b4405f288af1866f6

somehow the podman build does not create the image with the name, so instead i copied the id's of the images into the run_docker.sh

damnms commented 3 years ago

i added:

COPY videocaptureasync.py /src/

to the Dockerfile and now i get:

oli @ ~/fakecam - [master] $ podman run fakecam
2020-10-05 21:52:34.886890: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcudart.so.10.1'; dlerror: libcudart.so.10.1: cannot open shared object file: No such file or directory
2020-10-05 21:52:34.886983: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
  File "fake.py", line 137, in <module>
    interpreter = tf.lite.Interpreter(model_path=args.model)
  File "/usr/local/lib/python3.8/site-packages/tensorflow/lite/python/interpreter.py", line 197, in __init__
    _interpreter_wrapper.CreateWrapperFromFile(
ValueError: Could not open 'deeplabv3_257_mv_gpu.tflite'.
RazZziel commented 3 years ago

Hi @damnms, thanks for the report, and sorry about the late reply!

run_docker.sh is admittedly a bit neglected, usually I only use run.sh. It worked on the initial code, but it's likely that some of my latest modifications have broken it, sorry about that! I'll see if I can fix it one of these days.

Regarding the error you get with run.sh, looks like fakecam/fake.py is throwing a "ModuleNotFoundError: No module named 'cv2'". That's weird because fakecam/requirements.txt installs opencv-python==4.2.0.32, which should provide cv2. Maybe the VirtualEnv in fakecam/.venv/ is corrupted? Can you try removing it, so it gets created again when running run.sh?

damnms commented 3 years ago

i cloned your repo and modified some things, its working more or less on fedora 33 beta with podman, because docker is dead (at least for fedora/redhat). https://gitlab.com/olze/fakecam