TensorFlow Java tutorial with Spring Framework and Gradle
Object detection server application
Object detection server side application sample program written in Java. It uses the TensorFlow Java API with a trained YOLO model. The server application is implemented with Spring Framework and it is built by Gradle.
How it works?
It provides a web user interface to upload images and detect objects. Please have a look at the following screenshots:
Compile and run
Before compiling the source code you have to place the frozen graph and the label file into the
./graph/ directory. Download one of my graphs from my google drive. There are two graphs: tiny-yolo-voc.pb and yolo-voc.pb. The tiny-yolo.pb has a lower size, however it is less accurate than the yolo-voc.pb.
Compile the code by typing
./gradlew clean build in the terminal window.
Run it with the command
Open the http://localhot:8080 and you see the webpage.
If you want to understand better how the image recognition part works, have a look at my previous project here: Java Tensorflow example application
Deployed to Google cloud: http://188.8.131.52:8080/
Deployed to Heroku: https://still-crag-64816.herokuapp.com/
Unfortunatelly, only the tiny YOLO runs with 512M memory.