Code Monkey home page Code Monkey logo

tdesc's Introduction

tdesc

Image processing tools

Setup

python setup.py install

Dependencies

Different workers depend on different external modules -- installs can be a little complicated, so I'm not including them in requirements.txt.

vgg16_worker.py: keras w/ tensorflow(-gpu)
dlib_worker.py: dlib (https://github.com/davisking/dlib/)
yolo_worker.py: darknet fork (https://github.com/bkj/darknet/)

Models

VGG16

Takes list of filenames, writes filename + descriptor to TSV.


    # FC2 features
    cat filenames | python -m tdesc --model vgg16 > vgg16-fc2.descriptors
    
    # CROW features (sum pooled conv5 features)
    cat filenames | python -m tdesc --model vgg16 --crow > vgg16-crow.descriptors

dlib face descriptors

Takes list of filenames, writes filename + descriptor to TSV.


    cat filenames | python -m tdesc --model dlib_face --outpath faces.h5

It seems like the AVX_INSTRUCTIONS option in dlib makes a big difference (8x on my box?).

Details

Threaded IO

The threaded IO can give a pretty big speedup.

These are benchmarks on my system, reading images over the network. The boost you get from this depends on lots of factors.


    # Naive IO
    cat urls | ./naive-runner.py --crow > /dev/null

        Using Theano backend.
        Using cuDNN version 5110 on context None
        Mapped name None to device cuda0: TITAN X (Pascal) (0000:04:00.0)
        VGG16Worker: ready
        0 images | 0.055656 seconds 
        100 images | 4.867988 seconds 
        200 images | 10.684320 seconds 
        300 images | 14.986690 seconds 
        400 images | 19.420027 seconds 
        500 images | 25.329047 seconds 
        600 images | 30.432902 seconds 
        700 images | 35.608703 seconds 
        800 images | 40.109027 seconds 
        900 images | 44.767013 seconds 
        999 images | 53.446249 seconds 

    
    # One thread
    cat urls | python -m tdesc --crow --io-threads 1 > /dev/null
    
        Using Theano backend.
        Using cuDNN version 5110 on context None
        Mapped name None to device cuda0: TITAN X (Pascal) (0000:04:00.0)
        VGG16Worker: ready
        100 images | 4.254059 seconds
        200 images | 7.766741 seconds
        300 images | 10.954665 seconds
        400 images | 14.537050 seconds
        500 images | 18.294582 seconds
        600 images | 23.202393 seconds
        700 images | 28.520624 seconds
        800 images | 32.765243 seconds
        900 images | 36.555996 seconds
        1000 images | 41.932386 seconds
    
    
    # Two threads
    cat urls | python -m tdesc --crow --io-threads 2 > /dev/null
    
        ...
        900 images | 15.679864 seconds
        1000 images | 17.494891 seconds
    
    # Four threads
    cat urls | python -m tdesc --crow --io-threads 4 > /dev/null
        
        ...    
        900 images | 7.591560 seconds
        1000 images | 8.437886 seconds

Batching images

Might be able to get a (modest) speedup by predicting on batches of images, instead of predicting one-by-one.

tdesc's People

Contributors

bkj avatar chilland avatar

Watchers

James Cloos avatar Graham Mueller 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.