GithubHelp home page GithubHelp logo

jagadish-kumaran / c3d-keras Goto Github PK

View Code? Open in Web Editor NEW

This project forked from axon-research/c3d-keras

0.0 1.0 0.0 3.01 MB

C3D for Keras + TensorFlow

License: Other

Dockerfile 4.60% Python 83.88% Shell 11.53%

c3d-keras's Introduction

C3D Model for Keras + TensorFlow

The scripts here are inspired by C3D Model for Keras gist, but specifically for Keras + TensorFlow (not Theano-backend).

To reproduce results:

  • Run a script that does everything: bash do_everything.sh

OR, build a docker image, which will do all the steps of replication during the build:

docker build -t c3d-keras .

OR, run each of these steps:

  1. Download pretrained model: bash models/get_weights_and_mean.sh
  2. Download sport1mil labels: bash sports1m/get_labels.sh
  3. Download facebook/C3D caffe.proto file for conversion from caffe to Keras: wget https://raw.githubusercontent.com/facebook/C3D/master/C3D-v1.0/src/caffe/proto/caffe.proto
  4. Install protobuf per instruction in https://github.com/google/protobuf. In Ubuntu, sudo apt-get install protobuf-compiler will do.
  5. Compile the caffe.proto file for python: protoc --python_out=. caffe.proto
  6. Make sure the default keras config (in ~/.keras/keras.json) has: tf image_dim_ordering, and tensorflow backend.
  7. Convert the pre-trained model from Caffe format to Keras: python convert_caffe_model.py
  8. Download test video: bash download_test_video.sh
  9. Run test: python test_model.py

Prerequisites

Known to work with the following python packages:

  • Keras==2.0.0
  • tensorflow==0.12.1
  • h5py==2.6.0
  • numpy==1.12.0
  • cv2==3.1.0
  • pydot==1.1.0
  • graphviz

Some basic command-line tools:

Results

A following classification probability plot is expected (saved as probabilities.png). A peak at 367th class (probability = 71%) corresponds to basketball label.

Classification Probability Plot

The top 5 labels will also be reported, and should look something like:

Position of maximum probability: 367
Maximum probability: 0.57953
Corresponding label: basketball

Top 5 probabilities and labels:
basketball: 0.57953
volleyball: 0.14435
streetball: 0.06718
freestyle wrestling: 0.03323
greco-roman wrestling: 0.03293

References

  1. C3D Model for Keras
  2. Original C3D implementation in Caffe
  3. C3D paper

Comment / Feedback

Feel free to contact Chuck Cho (cycho at axon.com) for any comment or feedback.

License

  • Source code: 2-clause BSD.
  • Data: various Creative Commons licenses. See LICENSE.md for details.

c3d-keras's People

Contributors

paulfitz 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.