Skip to main content

Webcam Laughing Man face overlay (MediaPipe + OpenCV + Pillow)

Project description

laughing-man

Webcam Laughing Man face overlay (Ghost in the Shell style) using MediaPipe BlazeFace, OpenCV, and Pillow.

Install

From PyPI

Stable releases are published on PyPI:

pip install laughing-man

With uv you can use:

uv pip install laughing-man

After installing, run laughing-man or laughing-man --help (the laughing-man console script is on your PATH).

From source (development)

You need uv on your PATH. Clone the repository:

git clone https://github.com/rnorris7756/laughing-man.git
cd laughing-man

Using direnv (recommended)

direnv loads the repo’s .envrc automatically when you cd into the project (after you allow it once per machine). That keeps the development environment consistent without manually activating a venv each time:

  1. Install direnv and hook it into your shell (Bash, Zsh, Fish, etc.).
  2. In the repo root, run direnv allow so .envrc is trusted.
  3. The next time the environment loads, .envrc will:
    • create .venv and run uv sync --group dev if the venv does not exist yet (installs runtime + dev dependencies from uv.lock);
    • source that venv whenever you are inside the directory;
    • run uv run pre-commit install if the Git pre-commit hook is missing (so Ruff and ty match CI before each commit).

After that, use laughing-man or uv run laughing-man as usual; commands see the activated environment while you stay in the tree.

Without direnv

Install dependencies and the pre-commit hook yourself:

uv sync --group dev
uv run pre-commit install
uv run laughing-man

Run uv run pre-commit install once per clone so Ruff and ty run before each commit (same checks as CI). Git invokes hooks with uv on your PATH.

Virtual webcam (Discord, OBS, browsers)

Use --virtual-cam to expose the composited video as a camera other apps can select.

Linux: v4l2loopback

The virtual device is provided by the v4l2loopback kernel module. Load it before starting the app (often required once per boot):

sudo modprobe v4l2loopback

You can create a named device on a fixed number (example):

sudo modprobe v4l2loopback devices=1 video_nr=10 card_label="LaughingMan"

Then point the CLI at that device if needed:

laughing-man --virtual-cam --v4l2-device /dev/video10

Use --no-preview to stream only to the virtual camera (no OpenCV window); stop with Ctrl+C.

Package names vary by distro (e.g. v4l2loopback-dkms on Debian/Ubuntu).

Other platforms

On Windows and macOS, pyvirtualcam may use OBS Virtual Camera or other backends when available.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

laughing_man-1.2.2.tar.gz (462.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

laughing_man-1.2.2-py3-none-any.whl (325.4 kB view details)

Uploaded Python 3

File details

Details for the file laughing_man-1.2.2.tar.gz.

File metadata

  • Download URL: laughing_man-1.2.2.tar.gz
  • Upload date:
  • Size: 462.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for laughing_man-1.2.2.tar.gz
Algorithm Hash digest
SHA256 06e6b003bf122e918831ee7927691c529dc46e77c53175f4f50a6e51197897c3
MD5 403ffa8de4dd1bb34685fb06abc2159f
BLAKE2b-256 76e35781229b64fa42bca1a973dfdc9be64f001cfdec44ffb9f17e4e6ef229a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for laughing_man-1.2.2.tar.gz:

Publisher: release.yml on rnorris7756/laughing-man

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file laughing_man-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: laughing_man-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 325.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for laughing_man-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 75b9d82f835889d6adef3ad31467fa634f8eca340e2d9ae3bf51d360ec0de4bb
MD5 750077e1bc67cec67a545886fc7ac88d
BLAKE2b-256 29c5d32bffc29d6d4d7adcaf6f694c7c302b55fc6d4e542490e41ae10cfaed29

See more details on using hashes here.

Provenance

The following attestation bundles were made for laughing_man-1.2.2-py3-none-any.whl:

Publisher: release.yml on rnorris7756/laughing-man

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page