https://github.com/BernardZhao/lenssort Skip to content Toggle navigation Sign in * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Resources + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} BernardZhao / lenssort Public * Notifications * Fork 5 * Star 89 * Making some cool pfps License GPL-3.0 license 89 stars 5 forks Branches Tags Activity Star Notifications * Code * Issues 1 * Pull requests 0 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights BernardZhao/lenssort This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master BranchesTags Go to file Code Folders and files Name Name Last commit Last commit message date Latest commit History 6 Commits examples examples lenssort lenssort .dockerignore .dockerignore .gitignore .gitignore Dockerfile Dockerfile LICENSE LICENSE README.md README.md docker-compose.yml docker-compose.yml requirements.txt requirements.txt View all files Repository files navigation * README * GPL-3.0 license Lenssort Using facial recognition and pixelsorting on images to create glitched, Snapchat-like lenses. Utilizes pixelsort, another project I am involved in. Make sure to check it out! Usage With Docker: 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 installed! git clone https://github.com/BernardZhao/lenssort.git cd lenssort # Can skip virtual environment if desired python -m venv venv source venv/bin/activate pip 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 -o File output path. Previews image if not provided. path Examples python -m lenssort examples/example1.jpg -m face example1_face_i_a90 python -m lenssort examples/example1.jpg -m face -i -a 90 example1_face_i_a90 python -m lenssort examples/example1.jpg -m eyes -i example1_eyes_i python -m lenssort examples/example3.jpg -m facemask example1_eyes_i python -m lenssort examples/example3.jpg -m shuffle example1_eyes_i python -m lenssort examples/example2.jpg -m censored example1_eyes_i Todo * [ ] Expose pixelsort args: sorting function, interval function, etc. * [ ] Validate mask: No out of bounds * [ ] Mask compositions: Ex: (face - eyes + ...) And more masks ofc About Making some cool pfps Topics glitch-art lens face-recognition pixelsort Resources Readme License GPL-3.0 license Activity Stars 89 stars Watchers 2 watching Forks 5 forks Report repository Releases No releases published Packages 0 No packages published Languages * Python 89.2% * Dockerfile 10.8% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.