Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/szaza/tensorflow-java-examples-spring
Tensorflow Java tutorial with Spring and Gradle. This is a simple example application, which uses Yolo with TF Java API and Spring Framework.
https://github.com/szaza/tensorflow-java-examples-spring
java spring tensorflow tutorial
Last synced: about 2 months ago
JSON representation
Tensorflow Java tutorial with Spring and Gradle. This is a simple example application, which uses Yolo with TF Java API and Spring Framework.
- Host: GitHub
- URL: https://github.com/szaza/tensorflow-java-examples-spring
- Owner: szaza
- License: wtfpl
- Created: 2018-03-05T07:16:10.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-20T09:55:35.000Z (over 5 years ago)
- Last Synced: 2023-10-20T23:19:12.473Z (about 1 year ago)
- Topics: java, spring, tensorflow, tutorial
- Language: Java
- Homepage:
- Size: 650 KB
- Stars: 54
- Watchers: 4
- Forks: 28
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TensorFlow Java tutorial with Spring Framework and Gradle
Object detection server side application sample program written in Java. It uses the TensorFlow Java API with a trained YOLOv2 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.
Step1: upload your image
Step2: display the recognized objects#### Compile and run
Preconditions:
- Java JDK 1.8 or greater;
- TensorFlow 1.6 or grater;
- Git version control system;Strongly recommended to install:
- nVidia CUDA Toolkit 8.0 or higher version;
- nVidia cuDNN GPU accelerated deep learning framework;**Download the frozen graph and the label file**
Before compiling the source code you have to place the frozen graph and the label file into the `./graph/YOLO` directory. Download one of my graphs from my [google drive](https://drive.google.com/drive/folders/1GfS1Yle7Xari1tRUEi2EDYedFteAOaoN). 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. Modify the [application.yml](https://github.com/szaza/tensorflow-java-examples-spring/blob/master/src/main/resources/application.yml) configuration file if it is necessary. Here you can increase the file upload limit also.
**Compile with Gradle**
Compile the code by typing `./gradlew clean build` in the terminal window.
Run it with the command `./gradlew bootRun`Open the [http://localhost:8080](http://localhost:8080) and you should see the webpage.
#### Demo application
Deployed to **Heroku** with a tiny-yolo model: https://still-crag-64816.herokuapp.com/
Have a look at my previous project for better understanding of the object detection part: [Tensorflow Java API example application](https://github.com/szaza/tensorflow-example-java) or visit my site: https://sites.google.com/view/tensorflow-example-java-api.
## News about YoloV3 support
The current solution doesn't support the YoloV3 model and unfortunately, I do not have time to implement it, however I would be very happy if I could help to implement and I could review a PR with this feture.
For this reason I've started a new branch here: https://github.com/szaza/tensorflow-java-examples-spring/tree/feature/add-yolov3-support; If you are interested in this feature and you would like to be a collabortor, please add a comment for this thread: https://github.com/szaza/tensorflow-java-examples-spring/issues/2;Many-many thank for any support!