/VisualNN

design, run deep learning model in browser

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

VisualNN is an online collaborative platform to build, visualize and train deep learning models via a simple drag-and-drop interface. We build it based on Fabrik. 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.

Installation Instructions

Setting up VisualNN on your local machine is very easy.

  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 ..
      
  1. Install dependencies pip install -r requirements/dev.txt

  2. 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
    
  1. 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.

  2. Start django application

    python manage.py runserver
    

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

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