Face Spotter
The Face Spotter application is a Python-based tool designed to detect, track, and manage users via facial recognition. It allows you to register users, track their activity in real-time using a camera, generate reports, and manage user details (e.g., rename or update images).
Table of Contents
Features
Installation
Usage
File Structure
Troubleshooting
Contributing
License
Features
User Registration : Register new users manually by providing a name and uploading an image.
Real-Time Tracking : Detect and track registered users in real-time using a webcam.
Automatic Unknown User Registration : Automatically registers unknown faces with random names.
Activity Reporting : Generate detailed reports of user activity, including start time, end time, and duration.
User Management :
Rename users.
Update user profile images.
Delete users.
Customizable Timeout : Configure the timeout period for closing user tracking intervals.
Filterable Reports : View reports filtered by specific users or all users.
Installation
Prerequisites
Python 3.8 or higher
A webcam or camera connected to your system
Supported operating systems: macOS, Windows, Linux
Dependencies
Install the required Python libraries using pip
:
pip install opencv-python face-recognition numpy pillow
For macOS users, you may need to install OpenCV with AVFoundation support:
pip install opencv-python-headless
Setup
Clone the repository or download the source code.
Ensure the following directories exist in the project folder:
encodings/
(for storing user encodings)
images/
(for storing user profile images)
Place a custom icon file (icon.png
) in the root directory if you want to use a custom application icon.
Usage
Running the Application
Run the application using the following command:
python app.py
Main Features
Register a New User :
Enter a name in the input field.
Click "Register User" and select an image file containing the user's face.
Start Tracking :
Click "Start Tracking" to begin detecting and tracking users in real-time.
Detected users will be displayed on the camera feed with their names and active durations.
Manage Users :
Click "Manage Users" to view, rename, update images, or delete users.
View Reports :
Click "View Report" to see a detailed report of user activity.
Use the dropdown menu to filter reports by a specific user or view all users.
File Structure
user-tracker/
āāā app.py # Main application script
āāā encodings/ # Directory for storing user encodings (.npy files)
āāā images/ # Directory for storing user profile images (.jpg files)
āāā users.csv # CSV file for storing user data (name, encoding path, image path)
āāā user_tracking_report.csv # Generated report file for user activity
āāā icon.png # Custom application icon (optional)
āāā README.md # Documentation file
Troubleshooting
Common Issues and Solutions
Camera Not Working :
Indentation Errors :
Ensure all code blocks are properly indented (Python uses 4 spaces per indentation level).
Missing Dependencies :
Install missing dependencies using pip install <package-name>
.
Face Not Detected :
Ensure the uploaded image has a clear, visible face.
Adjust lighting conditions when using the camera.
Old Reports Not Updated After Renaming a User :
Ensure the update_username
function is correctly implemented to update both the users.csv
and user_tracking_report.csv
files.
Contributing
We welcome contributions to improve this project! To contribute:
Fork the repository.
Create a new branch for your feature or bug fix.
Submit a pull request with a detailed description of your changes.