GithubHelp home page GithubHelp logo

00itamarts00 / facial-landmark-dataset Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yinguobing/facial-landmark-dataset

0.0 0.0 0.0 80 KB

A collection of facial landmark datasets and Python code to make use of them.

License: MIT License

Python 100.00%

facial-landmark-dataset's Introduction

facial-landmark-dataset

A collection of public facial landmark datasets and the Python code to make use of them.

Watch this 1 minute introduction video.

Supported Datasets

Name Author Published #Marks #Samples
300-W Imperial College London 2013 68 600
300-VW Imperial College London 2015 68 218597
AFW Imperial College London 2013 68 337
AFLW Graz University of Technology 2011 21
AFLW2000-3D Chinese Academy of Sciences 2015 68 2000
HELEN Imperial College London 2013 68 2330
IBUG Imperial College London 2013 68 135
LFPW Imperial College London 2013 68 1035
WFLW Tsinghua National Laboratory 2018 98 10000

Face images and mark coordinates are required. Some dataset used existing images from other dataset, in which case the dataset was named after the image dataset.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

OpenCV 4.x

Installing

Just git clone this repo and you are good to go.

# From your favorite development directory
git clone https://github.com/yinguobing/facial-landmark-dataset

How to run

First, initialize the dataset. Take 300W as an example.

from fmd.ds300w import DS300W

# Set the path to the dataset directory.
DS300W_DIR = "/home/robin/data/facial-marks/300W"

# Construct a dataset.
ds = DS300W("300w")

# Populate the dataset with essential data
ds.populate_dataset(DS300W_DIR)

# See what we have got.
print(ds)

Possible output:

name: 300w
authors: Imperial College London
year: 2013
num_marks: 68
num_samples: 600

Pick one sample, randomly

Once the dataset is constructed:

sample = ds.pick_one()

Enumerate the dataset

This could be useful when you are trying to transform or export the dataset.

for sample in ds:
    # do whatever you want, like
    print(sample.marks)

Read image file

Read in the image file as a numpy array, and show the image.

image = sample.read_image()

import cv2
cv2.imshow("Preview", image)
cv2.waitKey()

Get the full marks

facial_marks = sample.marks

Get the key marks

The key marks are: left eye left corner, left eye right corner, right eye left corner, right eye right corner, mouse left corner, mouse right corner.

key_marks = sample.get_key_marks()

Draw the marks

draw_marks(image, facial_marks)

Authors

Yin Guobing (尹国冰) - yinguobing

wechat

License

GitHub

Acknowledgments

All the dataset authors who made their data public.

facial-landmark-dataset's People

Contributors

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