Object detection using TensorFlow from Go

The Go program for object detection, as specified in the TensorFlow GoDocs, can be called as follows:

$ ./myprogram -dir=<path/to/the/model/dir> -image=<path/to/a/jpg/image>

When the program is called, it will utilize the pretrained and loaded model to infer the contents of the specified image. It will then output the most likely contents of that image along with its calculated probability.

To illustrate this, let's try performing the object detection on the following image of an airplane, saved as airplane.jpg:

Running the TensorFlow model from Go gives the following results:

$ go build$ ./myprogram ...

Get Machine Learning With Go now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.