PersonaCipher
Your face recognizer in images and videos.
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
- Edit the names in
usernames.txt - Run:
create_dataset
The script will:
- Create folders
- Download 10 images per user
- 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.
Metadata
Release files for PersonaCipher 5.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| personacipher-5.1.1.tar.gz | 74.5 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| personacipher-5.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 74.5 MB
Release files / personacipher-5.1.1.tar.gz
| Download URL | personacipher-5.1.1.tar.gz |
|---|---|
| Size | 74.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5c5550b98c2bd975dad5c0fc4d2b2cc1aeb3afc2bb48f223a43ccb0bd138fc84
|
|
BLAKE2b-256 checksum How to use checksums |
e6889b6acc250fadc4a8d8acb2d16b2ae698afa1b10d28f4bfaff5c8cd2b6d40
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / personacipher-5.1.1-py3-none-any.whl
| Download URL | personacipher-5.1.1-py3-none-any.whl |
|---|---|
| Size | 18.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0096f11ae8d2993c10551ae2db924ee5832a276694cc15a9e845acffe3af70a8
|
|
BLAKE2b-256 checksum How to use checksums |
cfa2ed8bf00a968da5120aa54cff41e2393b974628f4039db38f80ec87f44717
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|