https://github.com/BernardZhao/lenssort
Making some cool pfps 👩🎤
https://github.com/BernardZhao/lenssort
face-recognition glitch-art lens pixelsort
Last synced: 5 months ago
JSON representation
Making some cool pfps 👩🎤
- Host: GitHub
- URL: https://github.com/BernardZhao/lenssort
- Owner: BernardZhao
- License: gpl-3.0
- Created: 2018-04-04T08:03:53.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-01-13T10:38:19.000Z (over 5 years ago)
- Last Synced: 2024-08-02T13:34:26.537Z (about 1 year ago)
- Topics: face-recognition, glitch-art, lens, pixelsort
- Language: Python
- Homepage:
- Size: 18.4 MB
- Stars: 193
- Watchers: 3
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lenssort
Using facial recognition and pixelsorting on images to create glitched, Snapchat-like lenses.
Utilizes [pixelsort](https://github.com/satyarth/pixelsort), another project I am involved in. Make sure to check it out!
## Usage
With Docker:
```bash
git clone https://github.com/BernardZhao/lenssort.git
cd lenssort
docker-compose up
# Make sure to include the -o flag, previews won't show up in the container.
docker-compose run lenssort python -m lenssort examples/example1.jpg -m face -o example_result.png
```Manually:
Requires Python 3.6 >=.
Make sure you have [dlib Python bindings](https://gist.github.com/ageitgey/629d75c1baac34dfa5ca2a1928a7aeaf) installed!```bash
git clone https://github.com/BernardZhao/lenssort.git
cd lenssort# Can skip virtual environment if desired
python -m venv venv
source venv/bin/activatepip install -r requirements.txt
python -m lenssort %PathToImage% [mask_type] [params]
```### Mask types:
Mask name | Description
----------|------------
`eyes` | Sort the eyes.
`face` | Sort the face, within the brows and chin.
`shuffle` | Sort a polygon randomly generated over facial features.
`censored`| Sort the eye area with a thick bar.
`facemask`| Sort the area of the face under the eyes.
`tears` | Sort tear-like lines below the eyes.### Parameters:
Parameter | Flag | Description
------------|-------|------------
Invert | `-i` | Inverts the mask. May produce cool results.
Angle | `-a` | Sorting angle. Overrides internal default for the mask.
Output path | `-o` | File output path. Previews image if not provided.## Examples
`python -m lenssort examples/example1.jpg -m face`

`python -m lenssort examples/example1.jpg -m face -i -a 90`

`python -m lenssort examples/example1.jpg -m eyes -i`

`python -m lenssort examples/example3.jpg -m facemask`

`python -m lenssort examples/example3.jpg -m shuffle`

`python -m lenssort examples/example2.jpg -m censored`

### Todo
- [ ] Expose pixelsort args: sorting function, interval function, etc.
- [ ] Validate mask: No out of bounds
- [ ] Mask compositions: Ex: (face - eyes + ...)And more masks ofc 😪