Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bundling #19

Merged
merged 6 commits into from Mar 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions .gitignore
@@ -1,10 +1,23 @@
# Virtual environments
venv
.venv

# Cache
__pycache__

# IDEs
.idea

# Test output
video_output
audio.wav
/keyboard_output.txt
/mouse_output.txt
/vpt-audio.wav
/vpt-keyboard.txt
/vpt-mouse.txt

# PyInstaller
*.spec
build
dist
3 changes: 3 additions & 0 deletions Pipfile
Expand Up @@ -19,9 +19,12 @@ matplotlib = "*"
[dev-packages]
python-language-server = {extras = ["all"], version = "*"}
pylint = "*"
pyinstaller = "*"

[requires]
python_version = "3.8"

[scripts]
vpt = "python -m vpt"
bundle-win = "pyinstaller ./vpt/__main__.py --name vpt --distpath ./dist --add-data 'models;models'"
bundle-unix = "pyinstaller ./vpt/__main__.py --name vpt --distpath ./dist --add-data \"models:models\""
11 changes: 10 additions & 1 deletion README.md
Expand Up @@ -23,8 +23,17 @@ On Arch Linux, use:

## Usage

Run `pipenv run vpt <subcommand>`. For detailed usage information, run `pipenv run vpt -h`.
Run `pipenv run vpt <subcommand>`. For detailed usage information, run `pipenv run vpt -h`.

If you are using Linux, you might need to run some commands as root (or with `sudo`)
as [mouse recording](https://github.com/boppreh/mouse#:~:text=requires%20sudo)
and [keyboard recording](https://github.com/boppreh/keyboard#:~:text=requires%20sudo) require it.

## Bundling

To bundle the application as a distributable executable, run `pipenv run bundle-win` on Windows, or `pipenv run bundle-unix` on most unix-based systems.
The resulting program can be found in the "_dist/vpt_" folder, with the exeuctable file itself called `vpt`.

Note: The Windows version requires that the ["Microsoft C++ Redistributable
for Visual Studio 2015, 2017 and 2019"](https://support.microsoft.com/help/2977003/the-latest-supported-visual-c-downloads) be installed on the system before running.
They are **not** bundled with the program.
1 change: 1 addition & 0 deletions vpt/__main__.py
Expand Up @@ -13,5 +13,6 @@
elif args['cmd'] == 'check':
check()
elif args['cmd'] is None:
# If no argument, fall back to recording
# record(args['audio'], args['video'])
pass
2 changes: 2 additions & 0 deletions vpt/cli/record.py
@@ -0,0 +1,2 @@
def record():
pass
4 changes: 4 additions & 0 deletions vpt/processors/gaze_detector/__init__.py
@@ -1,5 +1,7 @@
"""Human facial landmark detector based on Convolutional Neural Network."""
import math
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # To disable TF's warnings

import cv2
import numpy as np
Expand All @@ -12,6 +14,8 @@
from vpt.processors.base import ProcessorBase
from vpt.sources.base import SourceBase

tf.get_logger().setLevel('ERROR')


class FaceDetector:
"""Detect human face from image"""
Expand Down