Getting started with Deep Learning Caffe Framework - Fastest way(Installation +Web Demo)

Here is the fastest way to get started with caffe deep learning framework with installation and basic we application demo for image classification :

Installation :

Here i am using caffe official ubuntu image and running it on docker . Follow the steps mentioned below :
1.) Install docker setup on your machine . Follow this link : https://docs.docker.com/engine/installation/#time-based-release-schedule.
2.) I have build caffe ubuntu image and push to docker hub . You can pull it in to your local.
  docker pull anishratnawat/caffe_deep_learning
3.)Run this command on terminal :
    docker run -ti -p 5000 anishratnawat/caffe_deep_learning bash  
 // it will download the image if its not downloaded before.
// When downloading finishes , terminal will enter in to image bash and your terminal will change to :
root@d3a683f24784:/workspace#

If you install any necessary packages inside that image then you need to commit it to make changes persist .
docker commit <ContainerId> <NewImageName>

3.) Your caffe installation path is : /opt/caffe
4.) By this time , You are ready to get started with Caffe framework .

_________________________________________________________________________________

Web Demo :

Here is python based application that have web interface which will take image as a input and classify the image .

1.) Go inside caffe installation path : /opt/caffe
2.) Download caffe Net model and ImageNet data Auxillary data using below commands:
 ./scripts/download_model_binary.py models/bvlc_reference_caffenet
./data/ilsvrc12/get_ilsvrc_aux.sh
3.) After this finishes , try to run the python server using :
python examples/web_demo/app.py & (& is used to run it in background)
4.) This will start your python server .
5.) you can access the python page from your browser .
  Just hit : http://0.0.0.0:<PORT>
  PORT you will get from this command :
ratnawat-macOS:~ ratnawat$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                     NAMES

eccc952b32aa        caffev1             "bash"              14 hours ago        Up 38 seconds       0.0.0.0:32771->5000/tcp   epic_brown

Here our port is 32771 . This may get change after each run .

So just hit : http://0.0.0.0:32771 . It will open page where you will upload image and Deep learning model will classify it .

Web App will look like this :



In case if you have any question or doubt , please free to comment below .




Comments

Popular posts from this blog

Sudoku using dancing link - Java implementation

OpenCV 2.4.9 JAVA/CPP/Python Installation in Ubuntu 14.04