Skip to main content

happy_face

Terminal install:

pip install happy_face

Import:

from happy_face.happy_face import HappyFace

Introduction:

happy_face was built on many different amazing libraries, mainly face_recognition from Adam Geitgey, dlib and many more. I do not take any accomplishment in doing this, it is just an easy way of implementing face_recognition for people that are starting.

The main purpose of happy_face is to show the magic of deep learning to people that are just starting with programming.

It has few functions, but it is extremely easy to use, this motivates people that are just starting because in python you do not see visual results until later in the journey, this can sometimes kill the creative energy.

Brief Explanation:

You just need to create a variable, instantiate it with HappyFace and fill three params:

  • known_person_path_file: is the path to the SINGLE image of the face that you want to be recognized.
  • unknown_images_path_file: here is the path to the FOLDER where you have all the other images that you want to recognize.
  • known_name : The name of the known_person_path_file, this will display Found U! If left empty.

IMPORTANT!!! Make sure your files (folders or pictures) DO NOT START WITH A DOT --> . <---, if they do, the application will have troubles to execute, this is because sometimes there are hidden files and they start with a dot. This was taken into consideration so the application runs smoothly, just make sure that your folders and files (images) do NOT start with a dot ---> . <---

Sample Code:

tiger_woods = HappyFace(known_person_path_file= '/Users/Desktop/tiger.png', 
                    unknown_images_path_file = '/Users/Desktop/unknown_pictures', 
                        known_name= 'Tiger Woods')

Functions:

  • display_known_im() -- will display the known_person_path_file image
  • detects_known_face() -- will detect the face of the known person
  • detects_unknown_faces() -- will detect all the faces of the images provided in the unknown_images_path_file folder
  • recognize_faces() -- Will recognize either the person is you (or whoever you provided) or a stranger

Sample Code:

tiger_woods.display_known_im() #Will display the image

tiger_woods.detects_known_face() #Will detect the face of (in this case) Tiger Woods

tiger_woods.detects_unknown_faces() #Will detect all the faces provided of the unknown people

tiger_woods.recognize_faces() -- # Will recognize either the person is tiger woods or a stranger

EXAMPLE:

from happy_face.happy_face import HappyFace

# Instantiate a variable to HappyFace and provide YOUR path file to the image and folder
tiger_woods = HappyFace(known_person_path_file='/Users/Desktop/tiger.png', 
                        unknown_images_path_file='/Users/Desktop/unknown_pictures', 
                        known_name='Tiger Woods')

# Execute
tiger_woods.recognize_faces()

OUTPUT:

Release files for happy-face 0.0.1

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

Source distribution (sdist)

Source distribution for happy-face 0.0.1
File Size Uploaded
happy_face-0.0.1.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for happy-face 0.0.1
File Interpreter ABI Platform
happy_face-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.2 kB

Release files / happy_face-0.0.1.tar.gz

Download URL happy_face-0.0.1.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2d437951258031a9bf95895bb2f82f2f8735da9327a810a250a1fbef8e9d216c
BLAKE2b-256 checksum
How to use checksums
af581ebc098d36715a59bc71ab4482805d6052b7f4d2136492a3c195595e963f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

Release files / happy_face-0.0.1-py3-none-any.whl

Download URL happy_face-0.0.1-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
072b1ab944a1eecd9395f0a9d7ab9530e15598acd88e6cf6f0c99c03d59ea98c
BLAKE2b-256 checksum
How to use checksums
4a82a5bea9c24d7ab3f1dfd611fd2523cbd34749673dc0c33b9d6d7e3f6ee512
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

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