Porus server is the server-side application for Porus App. It accepts the uploaded images from the client and runs the prediction script for recognizing the type of road.
The server application is based on Django
. It can be deployed on local network for testing purposes. The prediction model applies a Inception V3 model. For more details, please refer to this page.
Python
, version>= 3.3
Django
[1]
Django is a framework for Web Apps. You can use the following command to install Django
. I recommend the latest version of Django
.
pip3 install django
Pillow
[2]
The image processing procedures in this project relies on PIL
. You need to install the latest version of Pillow
.
pip3 install pillow
Keras
[3]
Keras
contains a set of APIs for Neural Networks. The Deep Learning script in Porus Server
is dependent on Keras
. To install Keras
, you also need the latest version of NumPy
and SciPy
.
pip3 install numpy
pip3 install scipy
pip3 install keras
-
Make sure your computer is connected to local network and have a valid
IP address
. Check your firewall settings so that the incoming network traffic is not blocked. -
In
settings.py
, add your IP address toALLOWED_HOSTS
. It should look like the following.
ALLOWED_HOSTS = ['192.168.xxx.xxx']
- Migrate Database
In Django
, you need to migrate the database when you run this App for the first time. Open a command window, enter the project directory and run this command:
python manage.py migrate
- Server Configuration
You need to specify the IP address to 0.0.0.0
when you run the server. This allows the server to listen to all addresses.
python manage.py runserver 0.0.0.0:8080
This command runs the server on port 8080
. You can also change another port, but please remember to change the port number on your client application.
- Django Website. https://docs.djangoproject.com/zh-hans/2.0/topics/install/
- Pillow Documentation. https://pillow.readthedocs.io/en/latest/
- Keras Documentation. https://keras.io