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.
Setting up Fabrik on your local machine is very easy. You can setup Fabrik using two methods:
If you haven't installed Docker already:
To install Docker for Windows click here.
To install Docker for Mac click here.
-
Get the source code on to your machine via git.
git clone https://github.com/Cloud-CV/Fabrik.git && cd Fabrik -
Rename
settings/dev.sample.pyasdev.py.cp settings/dev.sample.py settings/dev.py -
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
-
Go to Github Developer Applications and create a new application. here
-
For local deployments,the following should be used in the options:
- Application name: Fabrik
- Homepage URL: http://0.0.0.0:8000
- Application description: Fabrik
- Authorization callback URL: http://0.0.0.0:8000/accounts/github/login/callback/
-
Github will provide you with a Client ID and a Secret Key. Save these.
-
Create a superuser in django service of docker container
docker-compose run django python manage.py createsuperuserNote: Before creating the superuser, make sure that django service of docker image is running. This can be done by executing
docker-compose upfollowed byCtrl + Cto save docker configuration. -
Open http://0.0.0.0:8000/admin and login with the credentials from step 4.
-
Setting up Social Accounts in django admin
-
Under
Social Accounts, openSocial applicationsand click onAdd Social Application. -
Choose the
Providerof social application asGithuband name itGithub. -
Add the sites available to the right side, so github is allowed for the current site.
-
Copy and paste your
Client IDandSecret Keyinto the apppropriate fields and Save.
-
-
Go to
Sitestab and update theDomain nameto0.0.0.0:8000.
-
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 -
Clone the repository via git
git clone --recursive https://github.com/Cloud-CV/Fabrik.git && cd Fabrik -
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
localhostin settings/dev.py line 15. It should now look like this:
'HOST': os.environ.get("POSTGRES_HOST", 'localhost'), - Change the hostname to
-
Install redis server
sudo apt-get install redis-server-
Change the hostname to
localhostin 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
localhostin ide/celery_app.py, line 8.app = Celery('app', broker='redis://localhost:6379/0', backend='redis://localhost:6379/0', include=['ide.tasks'])
-
-
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
- Install dependencies
-
For developers:
pip install -r requirements/dev.txt -
For others:
pip install -r requirements/common.txt
-
Setup postgres database
-
Start postgresql by typing
sudo service postgresql start -
Now login as user postgres by running
sudo -u postgres psqland 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
-
Install node modules
npm install npm install --save-dev json-loader sudo npm install -g [email protected]- 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 -
Start celery worker
celery -A ide worker --app=ide.celery_app --loglevel=infoThe celery worker needs to be run in parallel to the django server in a separate terminal.
-
Start django application
python manage.py runserverYou should now be able to access Fabrik at http://localhost:8000.
-
Go to Github Developer Applications and create a new application. here
-
For local deployments, the following should be used in the options:
- Application name: Fabrik
- Homepage URL: http://localhost:8000
- Application description: Fabrik
- Authorization callback URL: http://localhost:8000/accounts/github/login/callback/
-
Github will provide you with a client ID and secret Key, save these.
-
Create a superuser in django
python manage.py createsuperuser -
Start the application
python manage.py runserver -
Login with the credentials from step 4.
-
Setting up Social Accounts in django admin :
-
Under
Social AccountsopenSocial applications, click onAdd Social Application. -
Choose the
Providerof social application asGithub& name itGithub. -
Add the sites available to the right side, so github is allowed for the current site. This should be
localhost:8000for local deployment. -
Copy and paste your
Client IDandSecret Keyinto the appropriate fields and Save.
-
-
From the django admin home page, go to
Sitesunder theSitescategory and updateDomain nametolocalhost: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.
python manage.py runserver
- Use
example/tensorflow/GoogleNet.pbtxtfor TensorFlow import - Use
example/caffe/GoogleNet.prototxtfor Caffe import - Use
example/keras/vgg16.jsonfor Keras import
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
- Using a Keras model exported from Fabrik
- Loading a Keras model exported from Fabrik and printing its summary
- Using an Exported Caffe Model
- Loading a Caffe model in python and printing its parameters and output size
- List of models tested with Fabrik
- Adding model to the Fabrik model zoo
- Adding new layers
- Using custom layers with Keras
- Linux installation walk-through
This software is licensed under GNU GPLv3. Please see the included License file. All external libraries, if modified, will be mentioned below explicitly.

