Skip to main content

A Machine Learning Python library for face recognition.

Project description

pyfacerecall

ForTheBadge built-with-love

Installation

pip install pyfacerecall

Generate own face dataset using camera

You can use cli built-in cli tool to generate dataset of your own face using your camera.

python -m pyfacerecall --output person --source 0

How to use?

from pyfacerecall import FaceRecognition


if __name__ == '__main__':
    model_path = "model"
    image_path = 'test.jpeg'
    # if you already have model trained then no need to provide dataset path while initializing class like below
    # face_recognition = FaceRecognition(number_of_classes=2)
    face_recognition = FaceRecognition("./dataset/training", "./dataset/testing")
    face_recognition.training()
    face_recognition.save_model(model_path)
    # get the model and do something with that
    model = face_recognition.load_saved_model(model_path)
    # get the model prediction
    k, result = face_recognition.model_prediction(image_path, model_path, need_cropping=False)
    print(f"detected class is {k} and prediction percentage is {result}")

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

pyfacerecall-1.0.0.tar.gz (6.5 kB view hashes)

Uploaded Source

Built Distribution

pyfacerecall-1.0.0-py3-none-any.whl (7.5 kB view hashes)

Uploaded Python 3

Supported by

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