Coder Social home page Coder Social logo

marcoronline / openface Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gradosevic/openface

0.0 1.0 0.0 1.11 MB

Docker based face recognition solution that can be used as a REST web service

License: Apache License 2.0

Batchfile 1.11% Shell 12.65% Python 24.74% PHP 61.49%

openface's Introduction

OpenFace

Face recognition solution that can be used as a REST web service. Send requests to a web service to check images and receive a JSON response.

This is a wrapper for cmusatyalab/openface Docker solution. It contains scripts for automatic environment setup and startup. This project was created in order to start quickly using OpenFace - face recognition features and gives you the flexibility to integrate it with any existing project that can consume the REST service. The setup should hopefully be much easier and automated, comparing to the original project.

Requirements

  • Docker installed on Windows, Mac or Linux

Installation

Windows

  • Open start.bat script
  • Change "c:/face" to a folder where these files are unpacked
  • Run start.bat as administrator
  • Follow the instructions and resolve potential issues

Linux or Mac

  • Open "config.conf"
  • Change share folder to match share folder on your host machine where these files are unpacked
  • Run start.sh script
  • Follow the instructions and resolve potential issues

How it works

The "start" scripts downloads the Docker image and starts the new container if it's not already started. Once the Docker container has started, it mounts this folder on host machine to /app folder inside the container. Script should start the web server and you should be able to access it on http://localhost:8080. If needed, you can change the port in these scripts to something else.

How to use

Response

Response is returned in this format:

Array
(
    [<known_image>] => Array
        (
            [<testing_image>] => <probability>
        )
)

For example, if we send this request http://localhost:8080/?test=test/&ast;&with=known/*, a response like this will be returned:

{
  "clapton-1.jpg": {
    "clapton-2.jpg": 0.318
  },
  "lennon-1.jpg": {
    "lennon-2.jpg": 0.763
  }
}

This is the folders structure for the example:

images/
-- known/
---- clapton-1.jpg
---- lennon-1.jpg
-- test/
---- adams.jpg
---- carell.jpg
---- clapton-2.jpg
---- lennon-2.jpg
---- longoria-cooper.jpg

It is possible to use the same folder for both parameters. In that case it will test every image with another and return the matching results of comparison.

Parameters

Use these parameters in your URL

  • test - Folder with images that should be tested
  • Required (string). Examples: test/*, test/image1.jpg, test/ima*
  • with - Test images from previous folder with images in this folder (can be the same folder)
  • Required (string). Examples: folder2/*, folder2/image2.jpg, test/image.*
  • t - Threshold for matching the images. Can be between 0-4. Images with comparison < 1 are considered as matched
  • Optional (float). Default: 1
  • skip-matched - If set, when used multiple images in "with" folder, it will skip already matched images in the next iteration.
  • Optional (boolean). Default: false
  • debug - If set, results will be displayed in readable form, instead of JSON
  • Optional (boolean). Default: false
  • callback - When set, script will send a POST request to the provided callback URL. Can be useful to send a request and to get notified when it's done
  • Optional (URL). Default: not set (empty string)

Important notes

  • Every time "start" script runs, it creates new Docker container. Use "clear" script to clear all previously used Docker containers. You can add this code at the beginning of "start" script to clear up all containers before starting new one.

More information



Licensing

Unless otherwise stated, the source code and trained Torch and Python model files are copyright Carnegie Mellon University and licensed under the Apache 2.0 License. Portions from the following third party sources have been modified and are included in this repository. These portions are noted in the source files and are copyright their respective authors with the licenses listed.

Project Modified License
Atcold/torch-TripletEmbedding No MIT
facebook/fbnn Yes BSD

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.