Open your browser and visit
http://198.248.248.136:8080/Image-App/If prompted for password, username: admin, password: 123.
Upload your image (size < 1MB, tested with .jpg).
Live Demo:
Create a geni slice using the rspec in GitHub repo: fin_request_rspec.xml
Log into the node called Infer.
git clone https://github.com/TTTheo/Image-Recognition-Application.gitcd Image-Recognition-Application/NNServer/bash setup_server.shsource ~/.bashrcTest whether java is install correctly:
java -version
>> penjdk version "13.0.1" 2019-10-15
>> OpenJDK Runtime Environment (build 13.0.1+9)
>> OpenJDK 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)
javac -version
>> javac 13.0.1Test whether conda and python is installed correctly:
conda --version
>> conda 4.8.0
python --version
>> Python 3.7.4Move to the inference server directory:
cd Image-Recognition-Application/NNServer/Make temporary folders for input and output queues:
mkdir input
mkdir outputCompile java code:
javac InferenceServer.javaRun the socket server to listen to incomming connections
nohup java InferenceServer 8888 &Press enter to get back the terminal prompt.
Run the neural network model with ResNet50:
nohup python RunInfer.py 50 &Press enter to get back the terminal prompt. If it is your first time running it, you should wait for 1-2 minutes while the script is downloading the trained model.
Now the the inference server should be up running and listening to incomming connections and ready to run the nerual network model to recognize images. The public IP address of the server could be found using ifconfig command (which is required at the web server to connect to the inference server).
When you are finished you should kill both java and python because they should be starting and running at the same time.
killall python
killall java
Log into the node called Web
Install Java:
sudo su
wget https://raw.githubusercontent.com/TTTheo/Image-Recognition-Application/master/Java-steup.sh
bash Java-steup.sh
echo 'export JAVA_HOME=~/java/jdk-13.0.1' >> ~/.bashrc
echo 'export PATH=$JAVA_HOME/bin:$PATH' >> ~/.bashrc
source ~/.bashrcTest whether java is install correctly:
java -version
>> penjdk version "13.0.1" 2019-10-15
>> OpenJDK Runtime Environment (build 13.0.1+9)
>> OpenJDK 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)
javac -version
>> javac 13.0.1Install TomCat
wget https://raw.githubusercontent.com/TTTheo/Image-Recognition-Application/master/Tomcat-setup.sh
bash Tomcat-setup.sh
bash tomcat/apache-tomcat-9.0.29/bin/startup.sh
sudo mv tomcat/manager.xml tomcat/apache-tomcat-9.0.29/conf/Catalina/localhost/
sudo mv tomcat/tomcat-users.xml tomcat/apache-tomcat-9.0.29/conf/
exitDownload GitHub repo which contains teh WAR file we need to set up the web server:
git clone https://github.com/TTTheo/Image-Recognition-Application.gitGet the routable-IP of web server node and visit the webpage:
http://Routable-IP:8080/manager/htmlLogin with username: admin and password: 123
Deploy -> Deploy directory or WAR file located on server WAR or Directory path:
/users/peilun/Image-Recognition-Application/FileUpload/target/Image-App.warClick Deloy
Finally visit:
Then visit http://Routable-IP:8080/Image-App

