Git Product home page Git Product logo

web's Introduction

My First Website: Used for displaying prediction result produced by a CNN model in Caffe

Written with django:version 1.10.5 restframework:version 3

To get your django-version:

(in python shell)
>>> import jango
>>> print django.VERSION

index

Index Page

How to run this website?

download all the packages included in this project,here are some packages i remember:

  • django
  • restframework
  • numpy
  • cv2
  • skimage
  • PIL

in your cmd typing(NOT your python shell):

>>> git clone https://github.com/innocentwhite/website-for-prediction-result/ (you need to install git first)  
>>> cd website-for-prediction-result   
>>> python manage.py runserver    

If you have installed all the packages needed, It will display as follows:

Performing system checks...

System check identified no issues (0 silenced).   
July ××, 2017 - ××:××:××    
Django version 1. 10. 5, using settings '''displayWeb.settings'''   
Start development server at http://127.0.0.1:8000/    
Quit the server with CTRL-BREAK   

If you got the same message: congratulations,you have succeeded in setting up your website! You can visit your website in your browser at http://127.0.0.1:8000/ now.

If you failed: Sorry, I don't know what's the problems with your code.You can google with your error messages.
But if you don't mind, you can also contact me at [email protected]

How to display prediction result?

Only Caffe is supported! besides,the path must be:

Home\website-for-prediction-result\display
Home\files\caffe\

The connection part(connects to CNN model) is defined in :

website-for-prediction-result\display\upload\caffemodel.py

in your project, you should modify lines 35-47 as follows:

caffe_root = '/workov/home1/liucl/files/caffe/'
sys.path.insert(0, caffe_root + 'python')

import caffe

MODEL_FILE = '../../files/caffe/examples/diabetic/model/deploy.prototxt'

PRETRAINED = '../../files/caffe/examples/diabetic/model/VGG19ft_iter_3500.caffemodel'

IMAGE_FILE = '../../files/caffe/examples/images'

IMAGE_NAME = 'preprocessed.jpeg'

caffe_root defines as named
MODEL_FILE requires your model layer definition, so modify it with your ***.prototxt
PRETRAINED is your model parameters saved as ***.caffemodel, please modify it with your ***.caffemodel
IMAGE_FILE is the dir that saves your images to be predicted
IMAGE_NAME defines as named

IMAGE_FILE and IMAGE_NAME is connected in:

website-for-prediction-result\display\upload\views.py

lines 29-33:

os.system("cp "+os.path.join("storage", new_img.Image.name)+" ../../files/caffe/examples/images/again.jpeg")
preprocessing(IMAGE_FILE, "again.jpeg")
if not os.path.exists("upload/static/img"):
    os.system("mkdir upload/static/img/")
os.system("cp "+"../../files/caffe/examples/images/preprocessed.jpeg "+"upload/static/img/")

I think you can understand that

After this, you can predict with your model.
Click the "select file" button and then "Submit" button.
I hope this website can hlep.

Unfinished Part

In profile page, "save" button directs to "#", url is not defined now, so this website don't support change profile now.
But you can change your password in profile page.

This website still usesd django's template, restful API version will be updated soon.

Function unit

Admin Part

Admin Page

Login Part

Login Page

Profile Part

Profile Page

Registe Part

Registe Page

web's People

Watchers

Changlu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.