Giter Club home page Giter Club logo

webmorphr.dlib's Introduction

webmorphR.dlib

Codecov test coverage Lifecycle: experimental

This package provides dlib shape models and scripts for use with the package webmorphR. These files are used for different auto-delineations with python (although I may change this to use dlib in C++ directly). It also provides (very experimental) functions for training shape models.

Installation

You can install the development version of webmorphR.dlib from GitHub with:

# install.packages("remotes")
remotes::install_github("debruine/webmorphR.dlib")

Now load the webmorphR package (it’s installed with webmorphR.dlib) and check if you can use the auto-delineation function.

library(webmorphR)
#> 
#> ************
#> Welcome to webmorphR. For support and examples visit:
#> https://debruine.github.io/webmorphR/
#> ************
library(webmorphR.dlib)
#> 
#> Attaching package: 'webmorphR.dlib'
#> The following object is masked from 'package:webmorphR':
#> 
#>     auto_delin

# load demo images and delineate
stim_70_point <- demo_stim() |> 
  auto_delin(model = "dlib70",
             replace = TRUE)

# plot with template points
draw_tem(stim_70_point) |> plot()

If this doesn’t work, you probably need to sort out your python installation.

reticulate::install_python()

The auto_delin() function will load the required python modules. If you get errors about that, you may need to install cmake and dlib first. I found these instructions useful for dlib installation on a mac.

If you get an error about PIL, try running reticulate::py_install("Pillow").

Templates

dlib7

This is the 5-point template from Davis King’s shape_predictor_5_face_landmarks.dat trained on 7198 faces from the dlib 5-point face landmark dataset. I added two points for the eye centres (0 and 1) in order to aid alignment by eyes.

It’s a very fast auto-delineation and useful if you just need to align faces to the same position, orientation or general size.

dlib70

This is the 68-point template from Davis King’s shape_predictor_68_face_landmarks.dat trained on the iBUG 300-W dataset. I added two points for the eye centres (0 and 1) in order to aid alignment by eyes.

C. Sagonas, E. Antonakos, G, Tzimiropoulos, S. Zafeiriou, M. Pantic. 300 faces In-the-wild challenge: Database and results. Image and Vision Computing (IMAVIS), Special Issue on Facial Landmark Localisation “In-The-Wild”. 2016.

The license for this dataset excludes commercial use, so the trained model can not be used in a commercial product.

webmorphr.dlib's People

Contributors

debruine avatar

Stargazers

Kaska Miskolczi avatar  avatar

Watchers

James Cloos avatar  avatar

webmorphr.dlib's Issues

Add to xml

Make a function to merge XML or add new images to an existing folder

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.