Permalink
Browse files

Merge pull request Cloud-CV#11 from Cloud-CV/cleanup

Cleanup
  • Loading branch information...
virajprabhu committed Sep 9, 2016
2 parents a2f7fee + e8249d1 commit 8746bb9a5504d94615d8204a3bc36f536494ccfe
Showing with 63,402 additions and 13,295 deletions.
  1. +4 −0 .gitignore
  2. +3 −0 .gitmodules
  3. +21 −5 README.md
  4. 0 {cloudcv → caffe_app}/__init__.py
  5. +3 −0 caffe_app/admin.py
  6. +2 −2 {cloudcvIde → caffe_app}/apps.py
  7. +5 −0 caffe_app/models.py
  8. +3 −0 caffe_app/tests.py
  9. +8 −0 caffe_app/urls.py
  10. +2 −0 caffe_app/views/__init__.py
  11. +28 −0 caffe_app/views/export_prototxt.py
  12. +16 −2 cloudcvIde/views/importPrototxt.py → caffe_app/views/import_prototxt.py
  13. +0 −10 cloudcvIde/caffe-tensorflow-master/.gitignore
  14. +0 −30 cloudcvIde/caffe-tensorflow-master/.pylintrc
  15. +0 −4 cloudcvIde/caffe-tensorflow-master/.style.yapf
  16. +0 −31 cloudcvIde/caffe-tensorflow-master/LICENSE.md
  17. +0 −54 cloudcvIde/caffe-tensorflow-master/README.md
  18. +0 −60 cloudcvIde/caffe-tensorflow-master/convert.py
  19. +0 −41 cloudcvIde/caffe-tensorflow-master/examples/imagenet/README.md
  20. +0 −78 cloudcvIde/caffe-tensorflow-master/examples/imagenet/classify.py
  21. +0 −178 cloudcvIde/caffe-tensorflow-master/examples/imagenet/dataset.py
  22. +0 −1,000 cloudcvIde/caffe-tensorflow-master/examples/imagenet/imagenet-classes.txt
  23. +0 −1 cloudcvIde/caffe-tensorflow-master/examples/imagenet/models/__init__.py
  24. +0 −19 cloudcvIde/caffe-tensorflow-master/examples/imagenet/models/alexnet.py
  25. +0 −19 cloudcvIde/caffe-tensorflow-master/examples/imagenet/models/caffenet.py
  26. +0 −188 cloudcvIde/caffe-tensorflow-master/examples/imagenet/models/googlenet.py
  27. +0 −81 cloudcvIde/caffe-tensorflow-master/examples/imagenet/models/helper.py
  28. +0 −22 cloudcvIde/caffe-tensorflow-master/examples/imagenet/models/nin.py
  29. +0 −1,170 cloudcvIde/caffe-tensorflow-master/examples/imagenet/models/resnet.py
  30. +0 −27 cloudcvIde/caffe-tensorflow-master/examples/imagenet/models/vgg.py
  31. +0 −102 cloudcvIde/caffe-tensorflow-master/examples/imagenet/validate.py
  32. +0 −36 cloudcvIde/caffe-tensorflow-master/examples/mnist/README.md
  33. +0 −56 cloudcvIde/caffe-tensorflow-master/examples/mnist/finetune_mnist.py
  34. +0 −129 cloudcvIde/caffe-tensorflow-master/examples/mnist/lenet.prototxt
  35. BIN cloudcvIde/caffe-tensorflow-master/examples/mnist/lenet_iter_10000.caffemodel
  36. +0 −4 cloudcvIde/caffe-tensorflow-master/kaffe/__init__.py
  37. +0 −1 cloudcvIde/caffe-tensorflow-master/kaffe/caffe/__init__.py
  38. +0 −5,479 cloudcvIde/caffe-tensorflow-master/kaffe/caffe/caffepb.py
  39. +0 −48 cloudcvIde/caffe-tensorflow-master/kaffe/caffe/resolver.py
  40. +0 −7 cloudcvIde/caffe-tensorflow-master/kaffe/errors.py
  41. +0 −302 cloudcvIde/caffe-tensorflow-master/kaffe/graph.py
  42. +0 −147 cloudcvIde/caffe-tensorflow-master/kaffe/layers.py
  43. +0 −83 cloudcvIde/caffe-tensorflow-master/kaffe/shapes.py
  44. +0 −2 cloudcvIde/caffe-tensorflow-master/kaffe/tensorflow/__init__.py
  45. +0 −239 cloudcvIde/caffe-tensorflow-master/kaffe/tensorflow/network.py
  46. +0 −285 cloudcvIde/caffe-tensorflow-master/kaffe/tensorflow/transformer.py
  47. +0 −290 cloudcvIde/caffe-tensorflow-master/kaffe/transformers.py
  48. +0 −4 cloudcvIde/media/tensorflow/.gitignore
  49. +0 −17 cloudcvIde/templates/cloudcvIde/index.html
  50. +0 −12 cloudcvIde/urls.py
  51. +0 −3 cloudcvIde/views/__init__.py
  52. +57,287 −0 example/GoogleNet.pbtxt
  53. +2,157 −0 example/GoogleNet.prototxt
  54. 0 {cloudcvIde → ide}/__init__.py
  55. +27 −19 {cloudcv → ide}/settings.py
  56. +3,535 −3,002 {cloudcvIde/static/cloudcvIde → ide/static}/bundle/bundle.js
  57. 0 {cloudcvIde/static/cloudcvIde → ide/static}/css/style.css
  58. 0 {cloudcvIde/static/cloudcvIde → ide/static}/js/app.js
  59. 0 {cloudcvIde/static/cloudcvIde → ide/static}/js/canvas.js
  60. +8 −0 {cloudcvIde/static/cloudcvIde → ide/static}/js/content.js
  61. 0 {cloudcvIde/static/cloudcvIde → ide/static}/js/data.js
  62. 0 {cloudcvIde/static/cloudcvIde → ide/static}/js/error.js
  63. 0 {cloudcvIde/static/cloudcvIde → ide/static}/js/field.js
  64. 0 {cloudcvIde/static/cloudcvIde → ide/static}/js/index.js
  65. 0 {cloudcvIde/static/cloudcvIde → ide/static}/js/jsplumb.js
  66. 0 {cloudcvIde/static/cloudcvIde → ide/static}/js/layer.js
  67. 0 {cloudcvIde/static/cloudcvIde → ide/static}/js/netLayout.js
  68. 0 {cloudcvIde/static/cloudcvIde → ide/static}/js/panZoom.js
  69. 0 {cloudcvIde/static/cloudcvIde → ide/static}/js/pane.js
  70. 0 {cloudcvIde/static/cloudcvIde → ide/static}/js/paneElement.js
  71. 0 {cloudcvIde/static/cloudcvIde → ide/static}/js/setParams.js
  72. 0 {cloudcvIde/static/cloudcvIde → ide/static}/js/tabs.js
  73. 0 {cloudcvIde/static/cloudcvIde → ide/static}/js/topBar.js
  74. 0 {cloudcvIde/static/cloudcvIde → ide/static}/lib/bootstrap-3.3.6-dist/css/bootstrap-theme.css
  75. 0 {cloudcvIde/static/cloudcvIde → ide/static}/lib/bootstrap-3.3.6-dist/css/bootstrap-theme.css.map
  76. 0 {cloudcvIde/static/cloudcvIde → ide/static}/lib/bootstrap-3.3.6-dist/css/bootstrap-theme.min.css
  77. 0 {cloudcvIde/static/cloudcvIde → ide/static}/lib/bootstrap-3.3.6-dist/css/bootstrap-theme.min.css.map
  78. 0 {cloudcvIde/static/cloudcvIde → ide/static}/lib/bootstrap-3.3.6-dist/css/bootstrap.css
  79. 0 {cloudcvIde/static/cloudcvIde → ide/static}/lib/bootstrap-3.3.6-dist/css/bootstrap.css.map
  80. 0 {cloudcvIde/static/cloudcvIde → ide/static}/lib/bootstrap-3.3.6-dist/css/bootstrap.min.css
  81. 0 {cloudcvIde/static/cloudcvIde → ide/static}/lib/bootstrap-3.3.6-dist/css/bootstrap.min.css.map
  82. BIN ...e/static/cloudcvIde → ide/static}/lib/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.eot
  83. 0 ...e/static/cloudcvIde → ide/static}/lib/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.svg
  84. BIN ...e/static/cloudcvIde → ide/static}/lib/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.ttf
  85. BIN .../static/cloudcvIde → ide/static}/lib/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.woff
  86. BIN ...static/cloudcvIde → ide/static}/lib/bootstrap-3.3.6-dist/fonts/glyphicons-halflings-regular.woff2
  87. 0 {cloudcvIde/static/cloudcvIde → ide/static}/lib/bootstrap-3.3.6-dist/js/bootstrap.js
  88. 0 {cloudcvIde/static/cloudcvIde → ide/static}/lib/bootstrap-3.3.6-dist/js/bootstrap.min.js
  89. 0 {cloudcvIde/static/cloudcvIde → ide/static}/lib/bootstrap-3.3.6-dist/js/npm.js
  90. 0 {cloudcvIde/static/cloudcvIde → ide/static}/lib/jquery.min.js
  91. 0 {cloudcvIde/static/cloudcvIde → ide/static}/lib/jsPlumb-2.1.2-min.js
  92. +17 −0 ide/templates/index.html
  93. +4 −1 {cloudcv → ide}/urls.py
  94. 0 {cloudcvIde/migrations → ide/utils}/__init__.py
  95. 0 {cloudcvIde/views → ide/utils}/jsonToPrototxt.py
  96. +4 −0 ide/views.py
  97. +2 −2 {cloudcv → ide}/wsgi.py
  98. +1 −1 manage.py
  99. 0 {cloudcvIde/media/prototxt → media}/.gitignore
  100. 0 tensorflow_app/__init__.py
  101. +3 −0 tensorflow_app/admin.py
  102. +7 −0 tensorflow_app/apps.py
  103. +1 −0 tensorflow_app/caffe-tensorflow
  104. +5 −0 tensorflow_app/models.py
  105. +3 −0 tensorflow_app/tests.py
  106. +8 −0 tensorflow_app/urls.py
  107. +2 −0 tensorflow_app/views/__init__.py
  108. +52 −0 tensorflow_app/views/export_graphdef.py
  109. +182 −0 tensorflow_app/views/import_graphdef.py
  110. +2 −2 webpack.config.js
@@ -62,3 +62,7 @@ target/
.ipynb_checkpoints
node_modules/
*.pyc
*/migrations/
@@ -0,0 +1,3 @@
[submodule "tensorflow_app/caffe-tensorflow"]
path = tensorflow_app/caffe-tensorflow
url = https://github.com/ethereon/caffe-tensorflow.git
@@ -1,5 +1,21 @@
# CloudCV-IDE
###Build Instructions
1. pip install -r requirements.txt
2. npm install
3. python manage.py runserver
# IDE
This is a user interface to draw and configure deep neural networks and supports import/export of model configuration
file from/to caffe/tensorflow deep learning frameworks
### Requirements
1. install [caffe](http://installing-caffe-the-right-way.wikidot.com/start)
2. install [tensorflow](https://www.tensorflow.org/versions/r0.10/get_started/os_setup.html#pip-installation)
### Build instructions
1. `git clone https://github.com/Cloud-CV/IDE.git`
2. `git submodule init`
3. `git submodule update`
4. `pip install -r requirements.txt`
5. `npm install`
### Usage
`python manage.py runserver`
### Example
* Use `example/GoogleNet.pbtxt` for tensorflow import
* Use `example/GoogleNet.prototxt` for caffe import
File renamed without changes.
@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.
@@ -3,5 +3,5 @@
from django.apps import AppConfig
class CloudcvideConfig(AppConfig):
name = 'cloudcvIde'
class CaffeAppConfig(AppConfig):
name = 'caffe_app'
@@ -0,0 +1,5 @@
from __future__ import unicode_literals
from django.db import models
# Create your models here.
@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.
@@ -0,0 +1,8 @@
from django.conf.urls import url
from views.import_prototxt import *
from views.export_prototxt import *
urlpatterns = [
url(r'^export$', exportToCaffe),
url(r'^import$', importPrototxt),
]
@@ -0,0 +1,2 @@
import import_prototxt
import export_prototxt
@@ -0,0 +1,28 @@
from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
from django.http import JsonResponse
import yaml
from datetime import datetime
import random, string
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from ide.utils.jsonToPrototxt import jsonToPrototxt
def randomword(length):
return ''.join(random.choice(string.lowercase) for i in range(length))
def index(request):
return render(request, 'cloudcvIde/index.html')
@csrf_exempt
def exportToCaffe(request):
if request.method == 'POST':
net = yaml.safe_load(request.POST.get('net'))
net_name = request.POST.get('net_name')
if net_name == '':
net_name = 'Net'
prototxt,input_dim = jsonToPrototxt(net,net_name)
randomId=datetime.now().strftime('%Y%m%d%H%M%S')+randomword(5)
with open(BASE_DIR+'/media/'+randomId+'.prototxt', 'w') as f:
f.write(prototxt)
return JsonResponse({'result': 'success','id': randomId, 'name': randomId+'.prototxt', 'url': '/media/'+randomId+'.prototxt'})
@@ -8,10 +8,18 @@
@csrf_exempt
def importPrototxt(request):
if request.method == 'POST':
prototxt = request.FILES['file']
try:
prototxt = request.FILES['file']
except Exception:
return JsonResponse({'result': 'error', 'error': 'No Prototxt model file found'})
caffe_net = caffe_pb2.NetParameter()
text_format.Merge(prototxt.read(), caffe_net)
try:
text_format.Merge(prototxt.read(), caffe_net)
except Exception:
return JsonResponse({'result': 'error', 'error': 'Invalid Prototxt'})
net = {}
i = 0
@@ -85,6 +93,12 @@ def importPrototxt(request):
},
'params': params
}
# this logic was written for a general scenerio(where train and test layers are mixed up)
# But as we know, the only differences between the train and test phase are:
# 1) input layer with different source in test
# 2) some accuracy layers in test
# If we consider these constraint, the below logic can be vastly reduced
for bottom_blob in layer.bottom:
if (bottom_blob != 'label'):
# if the current layer has a phase

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 8746bb9

Please sign in to comment.