Giter VIP home page Giter VIP logo

blooface's Introduction

Blooface

This is a simple wrapper around the popular DeepFace framework. https://viso.ai/computer-vision/deepface/

It's main objective is to provide a flexible and lightweight face recognition module for a number of projects.

In the interest of AI and data safety, we have open sourced this module.

To identify faces in a given frame (Numpy array representation):

faces, region = blooFace.query_image(frame)

To verify that two faces are the same:

blooFace.verify(img_path_1, img_path_2)

An example of a simple webcam feed implementation:

import cv2
import BlooFace

blooFace = BlooFace.Blooface()

# Get webcam feed
cap = cv2.VideoCapture(0)

resize = .5
font = cv2.FONT_HERSHEY_SIMPLEX

while True:

    # Get frame
    ret, frame = cap.read()

    # Resize
    frame = cv2.resize(frame, None, fx=resize, fy=resize, interpolation=cv2.INTER_AREA)

    # Detect faces
    faces, region = blooFace.query_image(frame)

    if len(faces) > 0:
        # For each face
        x = region[0]
        y = region[1]
        w = region[2]
        h = region[3]
        cv2.rectangle(frame, (x, y), (x + w, y + h), (0, 255, 0), 2)
        cv2.putText(frame, faces[0], (7, 70), font, .5, (100, 255, 0), 1, cv2.LINE_AA)
   
    # Display frame
    cv2.imshow('Blooface', frame)

    # Quit if q is pressed
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

FPS Credit: https://www.geeksforgeeks.org/python-displaying-real-time-fps-at-which-webcam-video-file-is-processed-using-opencv/

blooface's People

Contributors

blooware avatar huwprosser avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.