Skip to content
🏭 Collaboratively build, visualize, and design neural nets in browser
Python JavaScript CSS Other
Branch: master
Clone or download
abhigyan-bhusal and Ram81 Refactor tensorflow import backend (#499)
* Refactor tensorflow import code

* Remove unnecessary newlines and make code concise

* Update documentation for adding new layers to tensorflow import

* Minor changes
Latest commit 0bb88a5 Dec 12, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Added contribution guidelines (#68) May 17, 2017
backendAPI Add Login Panel (#424) Nov 6, 2018
caffe_app Refactor backend codebase of real time collaboration feature (#441) Nov 8, 2018
docker Support for real time collaboration and model export using celery(#390) Oct 23, 2018
docs Add internal model representation documentation (#483) Dec 12, 2018
example Add internal model representation documentation (#483) Dec 12, 2018
ide Add Colornet to Fabrik Zoo (#494) Dec 9, 2018
keras_app Added linear activation support for Keras (#426) Nov 5, 2018
media Updated Readme (#99) Aug 20, 2017
requirements Requirements: Update asgi_redis version(#456) Nov 17, 2018
scripts/tools Tools: Make fetch-pull-request script executable (#289) Jan 18, 2018
settings Support for real time collaboration and model export using celery(#390) Oct 23, 2018
tensorflow_app Refactor tensorflow import backend (#499) Dec 12, 2018
tests Added linear activation support for Keras (#426) Nov 5, 2018
tutorials Refactor tensorflow import backend (#499) Dec 12, 2018
.babelrc minor changes in views Aug 1, 2016
.coveralls.yml Integrate coveralls for test coverage (#81) Jun 16, 2017
.editorconfig added eslint config Jun 19, 2016
.eslintrc Add SearchBar for layers selection (#400) Oct 29, 2018
.flake8 Support for real time collaboration and model export using celery(#390) Oct 23, 2018
.gitignore Add Login Panel (#424) Nov 6, 2018
.gitmodules Changed caffe-tensorflow submodule url Jan 1, 2018
.travis.yml Support for real time collaboration and model export using celery(#390) Oct 23, 2018
CODE_OF_CONDUCT.md Created Code of Conduct (#301) Feb 18, 2018
LICENSE modular code Aug 22, 2016
README.md Added badge for documentation (#487) Dec 4, 2018
docker-compose-prod.yml Support for real time collaboration and model export using celery(#390) Oct 23, 2018
docker-compose.yml Support for real time collaboration and model export using celery(#390) Oct 23, 2018
ide_nginx.conf Support for real time collaboration and model export using celery(#390) Oct 23, 2018
ide_uwsgi.ini Support for real time collaboration and model export using celery(#390) Oct 23, 2018
manage.py Fix #130: Add docker based setup for Fabrik (#344) May 2, 2018
package.json Support for real time collaboration and model export using celery(#390) Oct 23, 2018
tensorflow_upgrade.md Tensorflow upgrade documentation (#437) Nov 8, 2018
uwsgi_params uwsgi and Nginx configuration added along with minor change in settin… Sep 11, 2016
webpack.config.js Fix: Issue in docker setup for reactjs (#385) Oct 5, 2018

README.md

Join the chat at https://gitter.im/Cloud-CV/Fabrik Build Status Coverage Status Documentation Status

Fabrik is an online collaborative platform to build, visualize and train deep learning models via a simple drag-and-drop interface. It allows researchers to collectively develop and debug models using a web GUI that supports importing, editing and exporting networks to popular frameworks like Caffe, Keras, and TensorFlow.

This app is presently under active development and we welcome contributions. Please check out our issues thread to find things to work on, or ping us on Gitter.

Installation Instructions

Setting up Fabrik on your local machine is very easy. You can setup Fabrik using two methods:

Using Docker

Docker Installation

If you haven't installed Docker already:

To install Docker for Windows click here.

To install Docker for Mac click here.

Fabrik Installation

  1. Get the source code on to your machine via git.

    git clone https://github.com/Cloud-CV/Fabrik.git && cd Fabrik
    
  2. Rename settings/dev.sample.py as dev.py.

    cp settings/dev.sample.py settings/dev.py
    
  3. Build and run the Docker containers. This might take a while. You should now be able to access Fabrik at http://0.0.0.0:8000.

    docker-compose up --build
    

Setup Authentication for Docker Environment

  1. Go to Github Developer Applications and create a new application. here

  2. For local deployments,the following should be used in the options:

  3. Github will provide you with a Client ID and a Secret Key. Save these.

  4. Create a superuser in django service of docker container

    docker-compose run django python manage.py createsuperuser
    

    Note: Before creating the superuser, make sure that django service of docker image is running. This can be done by executing docker-compose up followed by Ctrl + C to save docker configuration.

  5. Open http://0.0.0.0:8000/admin and login with the credentials from step 4.

  6. Setting up Social Accounts in django admin

    • Under Social Accounts, open Social applications and click on Add Social Application.

    • Choose the Provider of social application as Github and name it Github.

    • Add the sites available to the right side, so github is allowed for the current site.

    • Copy and paste your Client ID and Secret Key into the apppropriate fields and Save.

  7. Go to Sites tab and update the Domain name to 0.0.0.0:8000.

Using Virtual Environment

  1. First set up a virtualenv. Fabrik runs on Python2.7.

    sudo apt-get install python-pip python-dev python-virtualenv
    virtualenv --system-site-packages ~/Fabrik --python=python2.7
    source ~/Fabrik/bin/activate
    
  2. Clone the repository via git

    git clone --recursive https://github.com/Cloud-CV/Fabrik.git && cd Fabrik
    
  3. Rename settings/dev.sample.py as settings/dev.py and change credentials in settings/dev.py

    cp settings/dev.sample.py settings/dev.py
    
    • Change the hostname to localhost in settings/dev.py line 15. It should now look like this:
    'HOST': os.environ.get("POSTGRES_HOST", 'localhost'), 
    
  4. Install redis server

    sudo apt-get install redis-server
    
    • Change the hostname to localhost in settings/common.py line 115.

      "CONFIG": {
          # replace redis hostname to localhost if running on local system
          "hosts": [("localhost", 6379)],
          "prefix": u'fabrik:',
          },
      
    • Replace celery result backend in settings/common.py line 122 with localhost.

      CELERY_RESULT_BACKEND = 'redis://localhost:6379/0'
      
    • Change celery broker URL and result backend hostname to localhost in ide/celery_app.py, line 8.

      app = Celery('app', broker='redis://localhost:6379/0', backend='redis://localhost:6379/0', include=['ide.tasks'])
      
  5. If you already have Caffe, Keras and TensorFlow installed on your computer, skip this step.

  • For Linux users

    • Install Caffe, Keras and Tensorflow

      cd Fabrik/requirements
      yes Y | sh caffe_tensorflow_keras_install.sh
      
    • Open your ~/.bashrc file and append this line to the end

      export PYTHONPATH=~/caffe/caffe/python:$PYTHONPATH
      
    • Save, exit and then run

      source ~/.bash_profile
      cd ..
      
  • For Mac users

  1. Install dependencies
  • For developers:

    pip install -r requirements/dev.txt
    
  • For others:

    pip install -r requirements/common.txt
    
  1. Install postgres >= 9.5
  • Setup postgres database

    • Start postgresql by typing sudo service postgresql start

    • Now login as user postgres by running sudo -u postgres psql and type the commands below:

      CREATE DATABASE fabrik;
      CREATE USER admin WITH PASSWORD 'fabrik';
      ALTER ROLE admin SET client_encoding TO 'utf8';
      ALTER ROLE admin SET default_transaction_isolation TO 'read committed';
      ALTER ROLE admin SET timezone TO 'UTC';
      ALTER USER admin CREATEDB;
      
    • Exit psql by typing in \q and hitting enter.

  • Migrate

    python manage.py makemigrations caffe_app
    python manage.py migrate
    
  1. Install node modules

    npm install
    npm install --save-dev json-loader
    sudo npm install -g webpack@1.15.0
    
    • Run the command below in a separate terminal for hot-reloading, i.e. see the changes made to the UI in real time.
    webpack --progress --watch --colors
    
  2. Start celery worker

    celery -A ide worker --app=ide.celery_app  --loglevel=info
    

    The celery worker needs to be run in parallel to the django server in a separate terminal.

  3. Start django application

    python manage.py runserver
    

    You should now be able to access Fabrik at http://localhost:8000.

Setup Authentication for Virtual Environment

  1. Go to Github Developer Applications and create a new application. here

  2. For local deployments, the following should be used in the options:

  3. Github will provide you with a client ID and secret Key, save these.

  4. Create a superuser in django

    python manage.py createsuperuser
    
  5. Start the application

    python manage.py runserver
    
  6. Open http://localhost:8000/admin

  7. Login with the credentials from step 4.

  8. Setting up Social Accounts in django admin :

    • Under Social Accounts open Social applications, click on Add Social Application.

    • Choose the Provider of social application as Github & name it Github.

    • Add the sites available to the right side, so github is allowed for the current site. This should be localhost:8000 for local deployment.

    • Copy and paste your Client ID and Secret Key into the appropriate fields and Save.

  9. From the django admin home page, go to Sites under the Sites category and update Domain name to localhost:8000.

Note: For testing, you will only need one authentication backend. However, if you want to try out Google's authentication, then, you will need to follow the same steps as above, but switch out the Github for Google.

Usage

python manage.py runserver

Example

  • Use example/tensorflow/GoogleNet.pbtxt for TensorFlow import
  • Use example/caffe/GoogleNet.prototxt for Caffe import
  • Use example/keras/vgg16.json for Keras import

Tested models

The model conversion between currently supported frameworks is tested on some models.

Models Caffe Keras Tensorflow
Inception V3
Inception V4
ResNet 101
VGG 16
GoogLeNet × ×
SqueezeNet × ×
DenseNet × ×
AllCNN × ×
AlexNet
FCN32 Pascal × ×
YoloNet
Pix2Pix × ×
VQA
Denoising Auto-Encoder ×

Note: For models that use a custom LRN layer (Alexnet), Keras expects the custom layer to be passed when it is loaded from json. LRN.py is located in keras_app/custom_layers. Alexnet import for Keras

Documentation

License

This software is licensed under GNU GPLv3. Please see the included License file. All external libraries, if modified, will be mentioned below explicitly.

You can’t perform that action at this time.