Giter Site home page Giter Site logo

Comments (12)

fangfufu avatar fangfufu commented on August 16, 2024

Please clone a fresh repository, run the following:

cd bodypix
npm install

Please post the output in a code block. It is hard to figure out what's going out during the installation process.

from linux-fake-background-webcam.

CarlFink avatar CarlFink commented on August 16, 2024

Please clone a fresh repository, run the following:

cd bodypix
npm install

Please post the output in a code block. It is hard to figure out what's going out during the installation process.

Thanks for getting back so fast (on a weekend!).

Again, I captured the result using script. Here you go:

carlf@debian-NUCi5:~/Linux-Fake-Background-Webcam/bodypix$ npm install

> @tensorflow/[email protected] install /home/carlf/Linux-Fake-Background-Webcam/bodypix/node_modules/@tensorflow/tfjs-node
> node scripts/install.js

CPU-linux-1.7.4.tar.gz
* Downloading libtensorflow
[==============================] 7201561/bps 100% 0.0s
* Building TensorFlow Node.js bindings

> @tensorflow/[email protected] install /home/carlf/Linux-Fake-Background-Webcam/bodypix/node_modules/@tensorflow/tfjs-node-gpu
> node scripts/install.js gpu download

GPU-linux-1.7.4.tar.gz
* Downloading libtensorflow
[==============================] 5548712/bps 100% 0.0s
* Building TensorFlow Node.js bindings
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.

added 95 packages from 100 contributors and audited 95 packages in 40.876s
1 package is looking for funding
  run `npm fund` for details

found 0 vulnerabilities

carlf@debian-NUCi5:~/Linux-Fake-Background-Webcam/bodypix$

from linux-fake-background-webcam.

fangfufu avatar fangfufu commented on August 16, 2024

Erm, did it work?

from linux-fake-background-webcam.

CarlFink avatar CarlFink commented on August 16, 2024

Erm, did it work?

I was just coming back to say that yes, now I can start the app!

But starting fake.py fails, with this message:

carlf@debian-NUCi5:~/Linux-Fake-Background-Webcam/fakecam$ python3 fake.py 
Cannot set camera property 3 to 1280, used value: 0.0
Cannot set camera property 4 to 720, used value: 0.0
Cannot set camera property 5 to 30, used value: 0.0
Traceback (most recent call last):
  File "fake.py", line 379, in <module>
    main()
  File "fake.py", line 367, in main
    use_akvcam=args.akvcam)
  File "fake.py", line 114, in __init__
    self.fake_cam = pyfakewebcam.FakeWebcam(v4l2loopback_path, self.width, self.height)
  File "/home/carlf/.local/lib/python3.7/site-packages/pyfakewebcam/pyfakewebcam.py", line 54, in __init__
    fcntl.ioctl(self._video_device, _v4l2.VIDIOC_S_FMT, self._settings)
OSError: [Errno 22] Invalid argument

from linux-fake-background-webcam.

fangfufu avatar fangfufu commented on August 16, 2024

You have to set your webcams properly using:

-w WEBCAM_PATH, --webcam-path WEBCAM_PATH
                    Set real webcam path
-v V4L2LOOPBACK_PATH, --v4l2loopback-path V4L2LOOPBACK_PATH
                    V4l2loopback device path

from linux-fake-background-webcam.

CarlFink avatar CarlFink commented on August 16, 2024

Thanks for the tip. I know that the video stream is /dev/video1. I have no idea what the V4L2LOOPBACK_PATH should be set to. There is nothing under /dev/v4l except the two empty directories, by-id and by-path.

from linux-fake-background-webcam.

fangfufu avatar fangfufu commented on August 16, 2024

You probably haven't even installed v4l2loopback properly. You should have multiple devices in /dev/video*.

from linux-fake-background-webcam.

CarlFink avatar CarlFink commented on August 16, 2024

I have 3. The raw video is /dev/video0. I am using webcamoid to preprocess it, and that stream is /dev/video1. Ideally, I'd be able to then hook fake.py after webcamoid to do the background.

If /dev/video1 is the V4L2LOOPBACK_PATH, then what would be the WEBCAM_PATH? Or is V4L2LOOPBACK_PATH the output or target device, not an input? I'm afraid the syntax is opaque to me. Is one of those a device that fake.py creates, as opposed to one it looks for?

from linux-fake-background-webcam.

fangfufu avatar fangfufu commented on August 16, 2024

V4L2LOOPBACK_PATH should be /dev/video2. I have no idea. The real webcam tends to tie up 2 devices.

from linux-fake-background-webcam.

CarlFink avatar CarlFink commented on August 16, 2024

OK, I tried a bunch of combinations. This loaded without error:

python3 fake.py -w /dev/video0 -v /dev/video0

That works! The /dev/video0 stream, as read by VLC, has the White House image in the background. And a terrible, terrible flicker.

Weirdly, Webcamoid now sees video0 as just the White House press room scene. VLC sees that same device as me superimposed on the horribly flickering bckground. I would intuitively have expected all software to see video0 as the same stream, but I guess not.

Hmm ... dropping both the fps setting of fake.py and Webcamoid makes the flickering far worse. That's also unintuitive.

Looks as if my i5-based Intel system just doesn't have the power to do non-chromakey virtual background, maybe?

Thanks again for helping.

from linux-fake-background-webcam.

fangfufu avatar fangfufu commented on August 16, 2024

Your -w and -v should be different devices. You are clearly doing something wrong.

Also, I have a quad-core i7, and I am only getting about 10fps.

from linux-fake-background-webcam.

CarlFink avatar CarlFink commented on August 16, 2024

It might be more generous to say that something is configured wrong, instead of, y'know, making an accusation. I followed the documentation as much as possible, but I've never used node.js or Python-controlled video. Debugging it myself would take more than the hour I've spent on this project.

Thank you for the info about CPU-bounding of the program. Looks like I'll just do without background removal for the time being.

from linux-fake-background-webcam.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.