axon-research/c3d-keras

Name: c3d-keras

Owner: axon-research

Description: C3D for Keras + TensorFlow

Created: 2016-12-01 19:21:28.0

Updated: 2018-01-31 11:03:08.0

Pushed: 2017-07-19 22:00:45.0

Homepage: null

Size: 3079

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

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:

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

er 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:

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:

tion of maximum probability: 367
mum probability: 0.57953
esponding label: basketball

5 probabilities and labels:
etball: 0.57953
eyball: 0.14435
etball: 0.06718
style wrestling: 0.03323
o-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


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.