Coder Social home page Coder Social logo

hodm's Introduction

Resource data

Download resource data(models and demo data) from google drive.

    sh download_resources.sh

Data preparation

To train the CNN models, you need three kinds of data: raw images, hand masks and object/hand heatmaps. See examples in $root/raw_data.

  1. Raw images: capture about 1000 images while performing different actions. For better hand segmentation, capture data from different subjects.

  2. Hand masks: you can manually annoate hand regions or use background subtraction to generate hand masks for the raw images.

  3. Heatmaps: the object/hand heatmap contains probability map for object/hand locations encoded in three channels: blue for object of interest, green for left hand, red for right hand. $root/annotation contains a few tools to label object and hands locations and generate heatmaps.

Hand segmentation training

To train the hand segmentation network, go to $root/segmentation_training.

  1. Get Caffe from here and modify the caffe_root in config.py.

  2. If the Caffe is built successfully and the Caffe root path is correct, you can run the demo and see results like the following:

     python demo.py
    

    Alt text

  3. Run the following command to resize raw training data and generate training data source text file: training_data.txt.

     python prepare_training_data.py
    
  4. Train the hand segmentation CNN. The trained model files are saved in $root/segmentation_training/model.

     sh train.sh
    

Hands/Object detection training

  1. Set caffe_root in config.py to the same Caffe version. Set hand_model to the path of the trained hand segmentation model.

  2. If the configuration is correct, you can run the demo for hand and object detection:

     python demo.py
    

    Alt text

  3. Run the following command to resize raw training data and generate training data source text file: training_data.txt.

     python prepare_training_data.py
    
  4. Train the hand/object detection CNN. The trained model files are saved in $root/detection_training/model.

     sh train.sh
    

hodm's People

Contributors

minghuam avatar

Stargazers

 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.