more details on the readme file

pull/4/head
Alessandro Cauduro 4 years ago
parent 566681cc1a
commit 3d1e2185a8

@ -38,10 +38,7 @@ Other versions might work, but I haven't tested them.
# Install Anaconda Environment # Install Anaconda Environment
* [Anaconda Environment](https://www.anaconda.com/distribution/) * Dowload and install [Anaconda](https://www.anaconda.com/distribution/)
# Setup Windows Version
## Create an Anaconda environment and install requirements ## Create an Anaconda environment and install requirements
``` ```
@ -51,6 +48,9 @@ $ conda install pytorch=1.4 torchvision=0.5 cudatoolkit=10.1 -c pytorch
$ pip install -r requirements.txt $ pip install -r requirements.txt
``` ```
# Setup Windows Version
## Setup Virtual Camera for streaming ## Setup Virtual Camera for streaming
Download [OBS Studio for Win](https://obsproject.com/download) and install it, afterwards install the [OBS Virtual CAM plugin](https://github.com/CatxFish/obs-virtual-cam/releases) by following instructions on the page. Download [OBS Studio for Win](https://obsproject.com/download) and install it, afterwards install the [OBS Virtual CAM plugin](https://github.com/CatxFish/obs-virtual-cam/releases) by following instructions on the page.
@ -69,14 +69,6 @@ Open Firefox and joing Google Hangout to test it, don't forget to choose the OBS
# Setup Linux Version # Setup Linux Version
## Create an Anaconda environment and install requirements
```
$ conda create -n "faceit_live3" python=3.8
$ source activate faceit_live3
$ conda install pytorch=1.4 torchvision=0.5 cudatoolkit=10.1 -c pytorch
$ pip install -r requirements.txt
```
To use the fake webcam feature to enter conferences with our stream we need to insert the **v4l2loopback** kernel module in order to create */dev/video1*. Follow the install instructions at (https://github.com/umlaeute/v4l2loopback), then let's setup our fake webcam: To use the fake webcam feature to enter conferences with our stream we need to insert the **v4l2loopback** kernel module in order to create */dev/video1*. Follow the install instructions at (https://github.com/umlaeute/v4l2loopback), then let's setup our fake webcam:
``` ```
@ -126,6 +118,7 @@ Put in the `/media` directory the images in jpg/png you want to play with. Squar
# Run the program # Run the program
``` ```
$ conda activate faceit_live3
$ python faceit_live.py $ python faceit_live.py
``` ```
@ -137,7 +130,7 @@ $ python faceit_live.py
## Example ## Example
``` ```
$ python faceit_live.py --webcam_id 0 --stream_id 1 $ python faceit_live.py --webcam_id 0 --stream_id 1 --gpu_id 0 --system linux
``` ```
## Key Shortcuts when running ## Key Shortcuts when running
@ -151,11 +144,17 @@ Q - to quit and close all Windows
# Tip # Tip
For better results, look into the webcam when starting the program or when pressing C, as this will create a base image from your face that is used for the transformation. Move away and closer to the webcam to find the ideal distance for better results. For better results, look into the webcam when starting the program or when pressing C, as this will create a base image from your face that is used for the transformation. Move away and closer to the webcam to find the ideal distance for better results.
## Troubleshooting # Troubleshooting
### Slow ### Slow
If it is running slow, check that it is running on the GPU by looking at the TASK MANAGER under Windows and NVidia Control Panel for Linux. If it is running slow, check that it is running on the GPU by looking at the TASK MANAGER under Windows and NVidia Control Panel for Linux.
### Error
If you get the error below under LINUX, it means you haven't started your v4l2loopback.
```
cv2.error: OpenCV(4.2.0) /io/opencv/modules/imgproc/src/resize.cpp:4045: error: (-215:Assertion failed) !ssize.empty() in function 'resize'
```
### Multiple GPU ### Multiple GPU
If you have more than one GPU, you might need to set some environment variables: If you have more than one GPU, you might need to set some environment variables:

@ -40,6 +40,7 @@ screen_width, screen_height = pyautogui.size()
system = args.system system = args.system
if system=="linux": if system=="linux":
print("Linux version, importing FakeWebCam")
import pyfakewebcam import pyfakewebcam
@ -157,9 +158,9 @@ def main():
# stream to fakewebcam # stream to fakewebcam
if system=="linux": if system=="linux":
#print("output to fakecam")
camera.schedule_frame(stream_v) camera.schedule_frame(stream_v)
k = cv2.waitKey(1) k = cv2.waitKey(1)
# Hit 'q' on the keyboard to quit! # Hit 'q' on the keyboard to quit!
if k & 0xFF == ord('q'): if k & 0xFF == ord('q'):

Loading…
Cancel
Save