Giter VIP home page Giter VIP logo

face-alignment-api's Introduction

Face Alignment API

The Face Alignment API is a web service that detects and aligns faces in images using dlib's face detection and facial landmark detection models. It can be used to process images from URLs, align detected faces, and return the aligned face as a base64-encoded string.

This tool can be particularly useful for scraping data when creating datasets.

Table of Contents

Getting Started

Prerequisites

Before you begin, ensure you have the following dependencies installed:

  • Python 3.x
  • Flask (for the web application)
  • dlib (for face detection and facial landmark detection)
  • OpenCV (for image processing)
  • Requests (for making HTTP requests)

You can install these dependencies using pip. For example:

pip install flask dlib opencv-python-headless requests

Installation

To get started with the Face Alignment API, follow these steps:

  1. Clone the repository:

    git clone https://github.com/yourusername/face-alignment-api.git
  2. Start the application

    python face-alignment-api/app.py

The API will be accessible at http://localhost:5000.

Usage

Endpoint

The API provides a single endpoint:

/detect_face (POST): Accepts a JSON request with an image URL and returns the aligned face as a base64-encoded string.

Request

Send a POST request to the /detect_face endpoint with the following JSON payload:

{
  "image_url": "https://example.com/your_image.jpg"
}

Replace "https://example.com/your_image.jpg" with the URL of the image you want to process.

Response

The API will respond with a JSON object containing the aligned face as a base64-encoded string:

{
  "aligned_face_base64": "base64_encoded_string_here"
}

License

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

face-alignment-api's People

Contributors

botoxparty avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  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.