Skip to content

Commit

Permalink
Correct readme and read command line parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
alew3 committed Apr 9, 2020
1 parent 2bb7f61 commit 16ccf75
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ $ sudo modprobe v4l2loopback exclusive_caps=1 card_label="faceit_live" video_nr=
$ v4l2-ctl -d /dev/video1 -c timeout=1000
```

# v4l2loopback-ctl set-timeout-image caio.png /dev/video1


Change the video_nr above in case you already have a webcam running on /dev/video1

Expand Down Expand Up @@ -100,13 +98,18 @@ Put in the `./media/` directory the images in jpg/png you want to play with.
$ python faceit_live.py
```

## Parameters
## Shortcuts
--webcam # the videoid of the Webcam e.g. 0 if /dev/video0 (default is 0)
--image # the face to use for transformations, put the files inside media (by default it loads the first image in the folder)
--streamto # the /dev/video number to stream to (default is 1)

## Example
```
$ python faceit_live.py --webcam 0 --stream 1 --image oliver.jpg
$ python faceit_live.py --webcam_id 0 --stream_id 1
```

## Shortcuts when running
```
N - cycle next image in media folder
C - recenter webcam
```
13 changes: 11 additions & 2 deletions faceit_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,27 @@
import pyautogui
import os
import glob
from argparse import Namespace
import argparse
warnings.filterwarnings("ignore")

############## setup ####
stream = True
media_path = './media/'
model_path = 'model/'
webcam_id = 2

parser = argparse.ArgumentParser()
parser.add_argument('--webcam_id', type = int, default = 2)
parser.add_argument('--stream_id', type = int, default = 1)
args = parser.parse_args()


webcam_id = args.webcam_id
webcam_height = 480
webcam_width = 640
screen_width, screen_height = pyautogui.size()

stream_id = 1
stream_id = args.stream_id
first_order_path = 'first-order-model/'
sys.path.insert(0,first_order_path)
reset = True
Expand Down

0 comments on commit 16ccf75

Please sign in to comment.