Skip to main content

No project description provided

Project description

facetrackr 🕵️‍♂️🎥

A Face Recognition and Timestamp Extraction Tool for Videos

Overview

facetrackr is a Python package that allows users to detect and recognize faces in videos using AWS Rekognition. It provides a seamless way to upload face images to a collection, process videos, and retrieve timestamps where the face is detected.

Features

✅ Add a face image to an AWS Rekognition collection
✅ Process a video to detect the given face
✅ Retrieve timestamps of face appearances
✅ Easy-to-use command-line interface


Installation

Ensure you have Python 3.7+ installed. Then install facetrackr using:

pip install facetrackr

Usage

After installing, run the following command in your terminal:

python -m facetrackr

You will be prompted to enter:

  1. The path of the face image you want to recognize.
  2. The path of the video in which you want to detect the face.

Example

Enter the path of the face image: ./images/person.jpg
Enter the path of the video: ./videos/sample.mp4

If the face is found in the video, the output will be:

Starting face detection in video...

Final Detection Report:
Face detected at 12.5 seconds with ID: person_123
Face detected at 28.7 seconds with ID: person_123

Demo Code

You can also integrate facetrackr into your own Python script. Below is an example demonstrating how to use the package:

from facetrackr.face_collection import FaceCollection
from facetrackr.video_processing import VideoProcessor

def main():
    face_image_path = input("Enter the path of the face image: ").strip()
    video_path = input("Enter the path of the video: ").strip()

    # Initialize face collection handler
    face_collection = FaceCollection()
    
    # Add face to AWS Rekognition collection
    face_id, external_image_id = face_collection.add_face(face_image_path)

    if face_id:
        print("\nStarting face detection in video...\n")

        # Initialize video processor
        video_processor = VideoProcessor()
        detection_results = video_processor.process_video(video_path, external_image_id)

        print("\nFinal Detection Report:")
        for detection in detection_results:
            print(f"Face detected at {detection['timestamp']} seconds with ID: {detection['external_image_id']}")
    else:
        print("Face was not added to collection. Exiting.")

if __name__ == "__main__":
    main()

Requirements

Before running the package, install dependencies:

pip install -r requirements.txt

AWS Configuration

Since this package relies on AWS Rekognition, ensure you have:

  1. An AWS account with Rekognition enabled.
  2. AWS credentials configured using:
    aws configure
    
  3. The necessary permissions in IAM for Rekognition.

License

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


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

facetrackr-0.2.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

facetrackr-0.2-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file facetrackr-0.2.tar.gz.

File metadata

  • Download URL: facetrackr-0.2.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for facetrackr-0.2.tar.gz
Algorithm Hash digest
SHA256 cc90bae869cb293fb2e61c98a208ab73c1f961a5875e94422f78a4df234eaae9
MD5 405dad90ed8f93b2c339f15e86d10e2f
BLAKE2b-256 937ca02078b1165408c599d170a354111dad4d6d2f2a3797cdd898072e761a5c

See more details on using hashes here.

File details

Details for the file facetrackr-0.2-py3-none-any.whl.

File metadata

  • Download URL: facetrackr-0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for facetrackr-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 40c8443631ee79bd1389bec3d09bfd60649afce940510e9f0e936fee72f6f8c0
MD5 c926c234f874a834bce1cdbe2c1e0061
BLAKE2b-256 399f63495a4b198b68285110d09e4a68cc698eccc2360a0ca62fe6c9deeb9d65

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