Skip to main content

Face Lensing

License Python supported versions PyPI

Look at yourself through a gravitational lens

Face Lensing screenshot example

This program was developed for outreach purposes.

It deforms the input feed of a webcam as if the light had gone through a gravitational lens.
While the shape of the lens was precomputed and cannot be changed, one can play with the intensity of the deformation (using + / - keys) to make interesting effects appear.

The effect is best seen from a certain distance, when the head is well centered with respect to the webcam, but appears on the screen in multiple places around the image center.

Feel free to install and play with it, it has been tested on Windows, Linux and macOS.

Installation

  1. Install the Python program with pip
    pip install face-lensing
    
  2. Launch the app from a terminal
    face-lensing-app
    
  3. A program should appear with the distorted webcam image

App controls

The program can be controlled with a keyboard using the following keys

Key Action
h show/hide command helper
q quit the program
c change camera (in case of multiple webcams)
+/- increase/decrease the lensing effect
i, j, k, l move the lens respectively in the ↑, ←, ↓, → directions
r reset the lens position and strength
Space save a screenshot locally

Acknowledgements

The original idea and precomputation of the lens deformation is attributed to Johan Richard (CRAL, CNRS/INSU)

License

This program is licensed under the MIT license.

Metadata

Release files for face-lensing 0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for face-lensing 0.5
File Size Uploaded Provenance
face_lensing-0.5.tar.gz 10.5 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for face-lensing 0.5
File Interpreter ABI Platform
face_lensing-0.5-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 20.6 MB

Release files / face_lensing-0.5.tar.gz

Download URL face_lensing-0.5.tar.gz
Size 10.5 MB
Tags Source
SHA-256 checksum
How to use checksums
d735fed791c4f728a97dcc35086fb6efef7b44a7747d75378409f61219352841
BLAKE2b-256 checksum
How to use checksums
859779f6570ac2b3ee0299e0b636f85e1c5f9a4d475883ffa11ecebe5cb5000b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.4

Release files / face_lensing-0.5-py2.py3-none-any.whl

Download URL face_lensing-0.5-py2.py3-none-any.whl
Size 10.1 MB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
2766885baad0dfc04a099abcc1812844a7af689bf41ca4a309d1b58ecd6d4357
BLAKE2b-256 checksum
How to use checksums
ae95b1e60764dc42c5d922dcd5924ad4047524cfabcb2ca0c33061570619529b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.4

Security for face-lensing 0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page