Git Product home page Git Product logo

snnapy2's Introduction

Snappy 2

Introduction

Detect faces in photos and draw overlay images on it, the overlay drawn using neural network that detect face keypoints.

  • draw glasses
  • draw mustache
  • draw hat
  • draw ears
  • draw any overlay
  • draw text

[ Cover Image ]

This version 2 beta built on previous version snappy v1 beta

Classes

  1. Snappy2: main class object and one place for all snappy library control.
  2. Detector: if you want to use the library in more advanced way by getting key points dictionary.
  3. FacePainter: helper to draw on top of images based on received key points dictionary.

[ Snappy2 Structure ]

Requirements

Download the required libraries for code using following terminal command:

  • Option 1: install requirements directly
cd requirements
pip install -r requirements.txt
  • Option 2: Import anaconda environment
cd requirements
conda env create -f snappy2.yml
soruce activate snappy2

if you don't have anaconda download from here

Code Examples (How to)

  • Draw Mustache on face (3 lines)
human_image = Image.open('<file_path>')

snappy2 = Snappy2()
snappy2.set_mustache(human_image, mus_index=0)

[ Mustache Image ]

  • Draw glasses on face (3 lines)
human_image = Image.open('<file_path>')

snappy2 = Snappy2()
snappy2.set_glasses(human_image, gls_index=0)

[ Glass Image ]

  • Draw ears on face (3 lines)
human_image = Image.open('<file_path>')

snappy2 = Snappy2()
snappy2.set_ears(human_image, gls_index=0)

[ Ears Image ]

For more examples and code details use check (Demo.py)

Imports

import Snappy2 as snappy2

Contributors

1- Ahmad Barqawi (ahmadai.com)
2- Contribute and add your name here

Disclaimer

This library use photos available free in the internet, if any of example photos have license please contact the library owner directly to add the license or delete the content. Expected response on requests within 3 days.

  • Overlays provided from freepik
  • Faces provided from unsplash free data set

License

The MIT License (MIT)

Copyright (c) 2017 Ahmad Barqawi (github.com/Barqawiz)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

snnapy2's People

Contributors

barqawiz avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.