Skip to main content

Your face recognizer in images & videos.

Project description

PersonaCipher

Your face recognizer in images and videos.

Python Platform License Version


Overview

PersonaCipher is a Python-based face recognition project using the face_recognition and OpenCV libraries. The application allows users to recognize faces in images and videos using a preloaded dataset of known faces.

Features

✔️ Recognize faces in images

✔️ Recognize faces in videos (MP4)

✔️ Auto-scale frames for fast performance

✔️ Auto-create datasets from usernames

✔️ Automatic image fetching (10 per user)

✔️ MP4 downloader for online videos

✔️ CLI interface with ASCII art banner

✔️ Windows & Linux compatible

Note: If you are using linux then go read the TODO to set everything automatically.

Project tree:

├── assets
│   ├── images
│   │   └── image.png
│   ├── known_faces
│   │   ├── Elon_Musk
│   │   │   ├── img10.jpg
│   │   │   ├── img1.jpg
│   │   │   ├── img2.jpg
│   │   │   ├── img3.jpg
│   │   │   ├── img4.jpg
│   │   │   ├── img5.jpg
│   │   │   ├── img6.jpg
│   │   │   ├── img7.jpg
│   │   │   ├── img8.jpg
│   │   │   └── img9.jpg
│   │   ├── John_Doe
│   │   │   ├── img10.jpg
│   │   │   ├── img1.jpg
│   │   │   ├── img2.jpg
│   │   │   ├── img3.jpg
│   │   │   ├── img4.jpg
│   │   │   ├── img5.jpg
│   │   │   ├── img6.jpg
│   │   │   ├── img7.jpg
│   │   │   ├── img8.jpg
│   │   │   └── img9.jpg
│   │   ├── Messi
│   │   │   ├── img10.jpg
│   │   │   ├── img1.jpg
│   │   │   ├── img2.jpg
│   │   │   ├── img3.jpg
│   │   │   ├── img4.jpg
│   │   │   ├── img5.jpg
│   │   │   ├── img6.jpg
│   │   │   ├── img7.jpg
│   │   │   ├── img8.jpg
│   │   │   └── img9.jpg
│   └── videos
│       └── video.mp4
├── datasets
│   └── usernames.txt
├── face_recognition
│   ├── api.py
│   ├── face_detection_cli.py
│   ├── face_recognition_cli.py
│   └── __init__.py
├── LICENSE
├── README.md
├── requirements.txt
├── linux_setup.sh
└── persona_cipher
    ├── create_dataset.py
    ├── mp4_downloader.py
    └── persona_cipher.py
    └── fetch_info.py

Installation

python3 -m venv myvenv
source myvenv/bin/activate
pip install personacipher

Usage

Run PersonaCipher

persona_cipher

1. Prepare the Dataset

Place images of known people inside a dataset directory (default: known_faces). Each person's images should be inside a folder named after them. Example structure:

 assets├── 
    known_faces/
      ├── John_Doe/
      │   ├── img1.jpg
      │   ├── img2.jpg
      ├── Jane_Smith/
      │   ├── img1.jpg
      │   ├── img2.jpg

But you do not need to create it manually.

Auto-Generate Dataset

  1. Edit the names in usernames.txt
  2. Run:
create_dataset

The script will:

  1. Create folders
  2. Download 10 images per user
  3. Build a complete dataset automatically

Menu Options

  • Recognize faces in an image: Provide the image path when prompted.
  • Recognize faces in a video: Provide the video file path when prompted.
  • Exit: Close the application.

Functionality Overview

MP4 Downloader

Download any video URL:

mp4_downloader

load_known_faces()

Loads face encodings from the dataset directory and stores them for recognition.

recognize_faces_in_image()

  • Detects and recognizes faces in a provided image.
  • Draws a rectangle around recognized faces and labels them.

recognize_faces_in_video()

  • Processes frames from a video file.
  • Detects and recognizes known faces in real-time.
  • Draws bounding boxes and labels recognized faces.

Screenshots

View - Screenshots

Notes

  • Uses HOG-based face detection
  • Threshold for matching: 0.6
  • Works on both Linux and Windows
  • Avoid noisy datasets for best recognition
  • Press q to exit video mode

License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer

The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software or the use or other dealings in the software.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

personacipher-5.1.1.tar.gz (74.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

personacipher-5.1.1-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file personacipher-5.1.1.tar.gz.

File metadata

  • Download URL: personacipher-5.1.1.tar.gz
  • Upload date:
  • Size: 74.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for personacipher-5.1.1.tar.gz
Algorithm Hash digest
SHA256 5c5550b98c2bd975dad5c0fc4d2b2cc1aeb3afc2bb48f223a43ccb0bd138fc84
MD5 2c76e46716340ea3696973d28feeb5cd
BLAKE2b-256 e6889b6acc250fadc4a8d8acb2d16b2ae698afa1b10d28f4bfaff5c8cd2b6d40

See more details on using hashes here.

File details

Details for the file personacipher-5.1.1-py3-none-any.whl.

File metadata

  • Download URL: personacipher-5.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for personacipher-5.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0096f11ae8d2993c10551ae2db924ee5832a276694cc15a9e845acffe3af70a8
MD5 c44a6016e2f79ca0de4a5ae158d0c5b5
BLAKE2b-256 cfa2ed8bf00a968da5120aa54cff41e2393b974628f4039db38f80ec87f44717

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page