Skip to content

Mahmoud-Italy/face-recognition-login

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Face Recognition Login in Go

Go Reference License Go Report Card Version Go Version

This is a face recognition login package using Go and OpenCV (gocv).

🚀 Features

  • Face detection using Haar cascades
  • Face recognition using OpenCV's FaceRecognizer
  • Model training and updating
  • Easy API for face registration and recognition

📦 Installation

go get -u github.com/mahmoud-italy/face-recognition-login

🏗️ Setup

Install pkg-config and OpenCV
Depending on your OS using the appropriate command:

Ubuntu/Debian

sudo apt update
sudo apt install -y pkg-config
sudo apt install -y libopencv-dev

Mac (Homebrew)

brew install pkg-config
brew install opencv

Windows (Using MSYS2) If you're on Windows, install MSYS2 and then run

pacman -S mingw-w64-x86_64-pkg-config

Download and install OpenCV from the official website: https://opencv.org/releases Set the OpenCV_DIR environment variable to the installation path.

Verify Installation Run the following command to check if pkg-config is properly installed:

pkg-config --version

If it prints a version number, pkg-config is working. Also, check if OpenCV is found by running:

pkg-config --modversion opencv4

If it returns an OpenCV version number (e.g., 4.5.2), everything is good.

🔧 Example Usage

import (
    "fmt"
	facerecognition "github.com/mahmoud-italy/face-recognition-login"
)

func main() {
    faceRec, _ := facerecognition.NewFaceRecognizer("assets/haarcascade_frontalface_default.xml", "models/face_model.yml")
    faceRec.RegisterFace("data/test_faces/face1.jpg", 1)
    label, confidence, _ := faceRec.RecognizeFace("data/test_faces/face1.jpg")
    fmt.Printf("Recognized label: %d, Confidence: %f\n", label, confidence)
}

🛠️ Running Tests

go test

🔖 License

The MIT License (MIT). Please see License File for more information.

🤝 Contributing

Feel free to contribute by submitting issues or pull requests.

About

This is a face recognition login package using Go and OpenCV (gocv).

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors

Languages