GithubHelp home page GithubHelp logo

peterzhousz / hairnets Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gaelkt/hairnets

0.0 1.0 0.0 8.88 MB

Hair Segmentation and Classification with Unet and GoogleNet

License: MIT License

Python 100.00%

hairnets's Introduction

Hair segmentation and classification with Unet and GoogleNet

Example This repository contains the implementation of a deep learning algorithm to classify hair types from images. It consists of two separate CNNs:

  • One CNN is used to segment hair in face images. This is a binary classification task: the neural network predicts if each pixel in the image is either hair or non-hair. This neural network structure is derived from the U-Net architecture, described in this paper. The performance of this segmentation network is tested on the LFW | Part Labels Database and achieve an accuracy of 92%, that is the best score from papers we have read so far.

  • One other CNN is used to classify hair segment into type a, b or c. This is a GoogleNet architecture.

The folder ./weights contains the pre-trained weights for segmentation and classification. The folder ./libs contains the functions used by main files.

Requirements:

  • Tensorflow >= 1.12
  • Keras
  • Skimage
  • Opencv
  • PIL >= 1.1.7

Part I: Segmentation

-You need to create a folder datasets and insert three folders for the 'funneled images', 'Ground Truth Images' and 'Ground Truth Labels' that you will download from this link.

  • Then run the file create_dataset.py to create and process the training data.
  • Run train.segmentation.py to train the network for segmentation
  • Run test_segmentation.py to test the segmentation on test images. The test images should be 224x224x3 and you need to store hair segment in a folder for data augmentation and hair classification

Part II: Data Augmentation

Use data_augmentation.py and the hair segment obtained from Part I to apply random transformations and increase the volume of hair segments. Store the files in a folder

Part II: Classification

Use train_classification.py to train the network for classifying hair type. You need to specify the location of each hair type folder.

hairnets's People

Contributors

gaelkt avatar

Watchers

 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.