Skip to content

TensorFlow Java example

Zoltán Szabó edited this page Mar 19, 2018 · 4 revisions

This example project shows you how to use the TensorFlow Java API with YOLO9000 model using Gradle as build and dependency management tool. TensorFlow Java API is a new opportunity to use TensorFlow from Java applications. On the official TensorFlow site you can find a description about the Java API usage with Maven using an Inception model. In my sample code I used the YOLO vesion 2 to detect and classify objects.

How it works?

tensorflow java example cow and bird tensorflow java sample

Cow and bird were detected, you can see it on the picture at the right side.

Compile and run

To compile and run this project please follow the steps described in the README here: TensorFlow Java example.

Frequently Asked Questions

Is it much slower than the TensorFlow Python or TensorFlow C++ API?
No, because it communicates through Java Native Interface (JNI)

Further projects

If you would like to create a client-server architecture with Spring Framework check this project: TensorFlow Java tutorial with Spring. In case if you would like to run real time object detection system on android devices, please check the following project: Real time object detection on Android.

Clone this wiki locally