All Projects → justusschock → Shapenet

justusschock / Shapenet

Licence: agpl-3.0
PyTorch implementation of "Super-Realtime Facial Landmark Detection and Shape Fitting by Deep Regression of Shape Model Parameters" predicting facial landmarks with up to 400 FPS

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Shapenet

SwiftUI-bez
Utilities for working with bezier curves in SwiftUI
Stars: ✭ 80 (-73.15%)
Mutual labels:  shape
visioStencils
My 2,700 visio 🎨 shapes, stencils, symbols, and icons collection to visually represent IT infrastructure
Stars: ✭ 43 (-85.57%)
Mutual labels:  shape
pikaso
Seamless and headless HTML5 Canvas library
Stars: ✭ 23 (-92.28%)
Mutual labels:  shape
SupperShape
🏡替代Shape和Selector和Layer-list的xml,减小apk体积
Stars: ✭ 57 (-80.87%)
Mutual labels:  shape
bpmn-layout-generators
Tools for generating missing BPMNDiagram elements in BPMN files
Stars: ✭ 27 (-90.94%)
Mutual labels:  shape
brutal
A code-first approach to automate the writing of unit tests.
Stars: ✭ 54 (-81.88%)
Mutual labels:  shape
Shape-Your-Music
A web application for drawing music.
Stars: ✭ 106 (-64.43%)
Mutual labels:  shape
Backgroundlibrary
A framework for directly generating shape through Tags, no need to write shape.xml again(通过标签直接生成shape,无需再写shape.xml)
Stars: ✭ 3,179 (+966.78%)
Mutual labels:  shape
ShapeTextureDebiasedTraining
Code and models for the paper Shape-Texture Debiased Neural Network Training (ICLR 2021)
Stars: ✭ 95 (-68.12%)
Mutual labels:  shape
cidrawing
A vector graphics library for Android
Stars: ✭ 35 (-88.26%)
Mutual labels:  shape
SkeletonMatching
This repository implements skeleton matching algorithm.
Stars: ✭ 30 (-89.93%)
Mutual labels:  shape
euclid
Vector math, geometry, reference frame, and shapes 2D & 3D
Stars: ✭ 22 (-92.62%)
Mutual labels:  shape
rdf-validate-shacl
Validate RDF data purely in JavaScript. An implementation of the W3C SHACL specification on top of the RDFJS stack.
Stars: ✭ 61 (-79.53%)
Mutual labels:  shape
ParallelQSlim
Shape Aware Parallel Mesh Simplification Algorithm
Stars: ✭ 84 (-71.81%)
Mutual labels:  shape
Uilibrary
平时项目开发中写的自定义Drawable、View和Shape
Stars: ✭ 260 (-12.75%)
Mutual labels:  shape
SquareImageView
SquareImageView is a simple wrapper library for Android ImageView
Stars: ✭ 28 (-90.6%)
Mutual labels:  shape
Procedural-Shape-Generation
An Unity package, enabling user to generate shapes by scripting.
Stars: ✭ 19 (-93.62%)
Mutual labels:  shape
Mojs
The motion graphics toolbelt for the web
Stars: ✭ 17,189 (+5668.12%)
Mutual labels:  shape
Shapeofview
Give a custom shape to any android view, Material Design 2 ready
Stars: ✭ 2,977 (+898.99%)
Mutual labels:  shape
object-shape
Get a description of a JS object's shape.
Stars: ✭ 24 (-91.95%)
Mutual labels:  shape

shapenet

Build Status Documentation Status PyPI version codecov LICENSE

This repository contains the PyTorch implementation of our Paper "SUPER-REALTIME FACIAL LANDMARK DETECTION AND SHAPE FITTING BY DEEP REGRESSION OF SHAPE MODEL PARAMETERS".

Contents

Installation

From Binary:

pip install shapenet

From Source:

pip install git+https://github.com/justusschock/shapenet

Demo

Demonstration Videos comparing our method to dlib can be found here as overlay and here as side-by-side view

Usage

By Scripts

For simplicity we provide several scripts to preprocess the data, train networks, predict from networks and export the network via torch.jit. To get a list of the necessary and accepted arguments, run the script with the -h flag.

Data Preprocessing

  • prepare_all_data: prepares multiple datasets (you can select the datasets to preprocess via arguments passed to this script)
  • prepare_cat_dset: Download and preprocesses the Cat-Dataset
  • prepare_helen_dset: Preprocesses an already downloaded ZIP file of the HELEN Dataset (Download is recommended from here since this already contains the landmarks)
  • prepare_lfpw_dset: Preprocesses an already downloaded ZIP file of the LFPW Dataset (Download is recommended from here since this already contains the landmarks)

Training

  • train_shapenet: Trains the shapenet with the configuration specified in an extra configuration file (exemplaric configuration for all available datasets are provided in the example_configs folder)

Prediction

  • predict_from_net: Predicts all images in a given directory (assumes existing groundtruths for cropping, otherwise the cropping to groundtruth could be replaced by a detector)

JIT-Export

  • export_to_jit: Traces the given model and saves it as jit-ScriptModule, which can be accessed via Python and C++

From Python

This implementation uses the delira-Framework for training and validation handling. It supports mixed precision training and inference via NVIDIA/APEX (must be installed separately). The data-handling is outsourced to shapedata.

The following gives a short overview about the packages and classes.

shapenet.networks

The networks subpackage contains the actual implementation of the shapenet with bindings to integrate the ShapeLayer and other feature extractors (currently the ones registered in torchvision.models).

shapenet.layer

The layer subpackage contains the Python and C++ Implementations of the ShapeLayer and the Affine Transformations. It is supposed to use these Layers as layers in shapenet.networks

shapenet.jit

The jit subpackage is a less flexible reimplementation of the subpackages shapenet.networks and shapenet.layer to export trained weights as jit-ScriptModule

shapenet.utils

The utils subpackage contains everything that did not suit into the scope of any other package. Currently it is mainly responsible for parsing of configuration files.

shapenet.scripts

The scripts subpackage contains all scipts described in Scripts and their helper functions.

Pretrained Weights

Currently Pretrained Weights are available for grayscale faces and cats.

For these Networks the image size is fixed to 224 and the pretrained weights can be loaded via torch.jit.load("PATH/TO/NETWORK/FILE.ptj"). The inputs have to be of type torch.Tensor with dtype torch.float in shape (BATCH_SIZE, 1, 224, 224) and normalized in a range between (0, 1).

Our Paper

If you use our Code for your own research, please cite our paper:

@article{Kopaczka2019,
title = {Super-Realtime Facial Landmark Detection and Shape Fitting by Deep Regression of Shape Model Parameters},
author = {Marcin Kopaczka and Justus Schock and Dorit Merhof},
year = {2019},
journal = {arXiV preprint}
}

The Paper is available as PDF on arXiv.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].