Skip to content

Commit

Permalink
Merge pull request #1 from gauravgupta22/keras_support
Browse files Browse the repository at this point in the history
Keras support
  • Loading branch information
gauravgupta22 authored Dec 13, 2016
2 parents 44c745d + cc62c16 commit 285f6ed
Show file tree
Hide file tree
Showing 25 changed files with 4,508 additions and 3,222 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

This is a React+Django webapp with a simple drag and drop interface to build and configure deep neural networks with support for export of model configuration files to caffe and tensorflow. It also supports import from these frameworks to visualize different model architectures. Our motivation is to build an online IDE where researchers can share models and collaborate without having to deal with deep learning code.

![alt text](https://github.com/Cloud-CV/IDE/blob/master/example/snapshot.png "IDE Snapshot")
![alt text](https://github.com/gauravgupta22/IDE/blob/master/example/snapshot.png "IDE Snapshot")

This app is presently under active development and we welcome contributions. Please check out our [issues thread](https://github.com/Cloud-CV/IDE/issues) to find things to work on, or ping us on [Gitter](https://gitter.im/batra-mlp-lab/CloudCV).

### Requirements
1. install [caffe](http://caffe.berkeleyvision.org/installation.html)
2. install [tensorflow](https://www.tensorflow.org/versions/r0.10/get_started/os_setup.html#pip-installation)
3. install [keras](https://keras.io/#installation)

### Build instructions
1. `git clone https://github.com/Cloud-CV/IDE.git`
Expand All @@ -23,6 +24,7 @@ This app is presently under active development and we welcome contributions. Ple
### Example
* Use `example/GoogleNet.pbtxt` for tensorflow import
* Use `example/GoogleNet.prototxt` for caffe import
* Use `example/GoogleNet.json` for keras import

### License

Expand Down
13 changes: 9 additions & 4 deletions caffe_app/views/import_prototxt.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ def importPrototxt(request):
params['scale'] = layer.transform_param.scale

elif(layer.type == 'Convolution'):
if len(layer.convolution_param.kernel_size):
if len(layer.convolution_param.kernel_size) or (layer.convolution_param.kernel_h and layer.convolution_param.kernel_w):
params['kernel_h'] = layer.convolution_param.kernel_h or layer.convolution_param.kernel_size[0]
params['kernel_w'] = layer.convolution_param.kernel_w or layer.convolution_param.kernel_size[0]
if len(layer.convolution_param.pad):
if len(layer.convolution_param.pad) or (layer.convolution_param.pad_h and layer.convolution_param.pad_w):
params['pad_h'] = layer.convolution_param.pad_h or layer.convolution_param.pad[0]
params['pad_w'] = layer.convolution_param.pad_w or layer.convolution_param.pad[0]
if len(layer.convolution_param.stride):
if len(layer.convolution_param.stride) or (layer.convolution_param.stride_h and layer.convolution_param.stride_w):
params['stride_h'] = layer.convolution_param.stride_h or layer.convolution_param.stride[0]
params['stride_w'] = layer.convolution_param.stride_w or layer.convolution_param.stride[0]
params['weight_filler'] = layer.convolution_param.weight_filler.type
Expand All @@ -67,7 +67,11 @@ def importPrototxt(request):
params['stride_w'] = layer.pooling_param.stride_w or layer.pooling_param.stride
params['kernel_h'] = layer.pooling_param.kernel_h or layer.pooling_param.kernel_size
params['kernel_w'] = layer.pooling_param.kernel_w or layer.pooling_param.kernel_size
params['pool'] = layer.pooling_param.pool
pool = layer.pooling_param.pool
if(pool == 0):
params['pool'] = 'MAX'
elif(pool == 1):
params['pool'] = 'AVE'

elif(layer.type == 'InnerProduct'):
params['num_output'] = layer.inner_product_param.num_output
Expand All @@ -83,6 +87,7 @@ def importPrototxt(request):
# string '64,1,28,28'

jsonLayer = {
'name': layer.name,
'info': {
'type': layer.type,
'phase': phase
Expand Down
1 change: 1 addition & 0 deletions example/GoogleNet.json

Large diffs are not rendered by default.

Loading

0 comments on commit 285f6ed

Please sign in to comment.