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).
- 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.
- Python 3.8 or higher
- A webcam or camera connected to your system
- Supported operating systems: macOS, Windows, Linux
Install the required Python libraries using pip:
pip install opencv-python face-recognition numpy pillowFor macOS users, you may need to install OpenCV with AVFoundation support:
pip install opencv-python-headless- 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.
Run the application using the following command:
python app.py-
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.
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
-
Camera Not Working:
- Ensure your camera is connected and working properly.
- On macOS, try installing OpenCV with AVFoundation support:
pip install opencv-python-headless
-
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>.
- Install missing dependencies using
-
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_usernamefunction is correctly implemented to update both theusers.csvanduser_tracking_report.csvfiles.
- Ensure the
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.