Skip to content

Commit

Permalink
more details on the readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
alew3 committed Apr 11, 2020
1 parent 566681c commit 3d1e218
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ Other versions might work, but I haven't tested them.

# Install Anaconda Environment

* [Anaconda Environment](https://www.anaconda.com/distribution/)


# Setup Windows Version
* Dowload and install [Anaconda](https://www.anaconda.com/distribution/)

## Create an Anaconda environment and install requirements
```
Expand All @@ -51,6 +48,9 @@ $ conda install pytorch=1.4 torchvision=0.5 cudatoolkit=10.1 -c pytorch
$ pip install -r requirements.txt
```


# Setup Windows Version

## 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.
Expand All @@ -69,14 +69,6 @@ Open Firefox and joing Google Hangout to test it, don't forget to choose the OBS

# 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:

```
Expand Down Expand Up @@ -126,6 +118,7 @@ Put in the `/media` directory the images in jpg/png you want to play with. Squar
# Run the program

```
$ conda activate faceit_live3
$ python faceit_live.py
```

Expand All @@ -137,7 +130,7 @@ $ python faceit_live.py

## 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
Expand All @@ -151,11 +144,17 @@ Q - to quit and close all Windows
# 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.

## Troubleshooting
# Troubleshooting

### 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.

### 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

If you have more than one GPU, you might need to set some environment variables:
Expand Down
3 changes: 2 additions & 1 deletion faceit_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

system = args.system
if system=="linux":
print("Linux version, importing FakeWebCam")
import pyfakewebcam


Expand Down Expand Up @@ -157,9 +158,9 @@ def main():

# stream to fakewebcam
if system=="linux":
#print("output to fakecam")
camera.schedule_frame(stream_v)


k = cv2.waitKey(1)
# Hit 'q' on the keyboard to quit!
if k & 0xFF == ord('q'):
Expand Down

0 comments on commit 3d1e218

Please sign in to comment.