TL;DR: for the impatient ones wanting to have a web service for image recognition without any Tensorflow prerequisites: run ./gradlew fetchInceptionFrozenModel bootrun
, navigate to http://localhost:8080 and upload an image. The backend will categorize the image and output the result along with the probability.
Screenshot (non clickable)
Tensorflow is hard enough to wrap one's head around. It has several parts that deal with preparing data, defining and training a model and finally, outputting a model that can then be used to categorize (infer) other data. There's math involved, new vocabulary to learn and on top, a toolchain which revolves around Python. This project only addresses serving a Tensorflow pre-trained image categorization model, otherwise called the Inception model.
- JDK 17-21
./gradlew fetchInceptionFrozenModel bootrun
./gradlew bootjar
build/libs/inception-serving-sb.jar
Tensorflow jars are not distributed for the Apple Silicon hardware. More info here
Then navigate to http://localhost:8080 and upload an image. The backend will categorize the image and output the result along with the probability.
Head to the blog post for the ful monty.
Thanks to @mcjojos, a port to Kotlin is now available in a separate branch. Woot!