Image Recognition API in Go using TensorFlow
Switch branches/tags
Nothing to show
Clone or download
Latest commit 5b3efa7 Nov 21, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.editorconfig Create TensorFlow and Go Docker image Oct 12, 2017
.gitignore Update dependencies Nov 21, 2018
Dockerfile Fix Dockerfile Nov 21, 2018
LICENSE Initial commit Oct 12, 2017
README.md Update dependencies Nov 21, 2018
cover.jpg Refactoring Oct 17, 2017
go.mod Update dependencies Nov 21, 2018
go.sum Update dependencies Nov 21, 2018
image_tensor.go Update dependencies Nov 21, 2018
main.go Update dependencies Nov 21, 2018
utilities.go Update dependencies Nov 21, 2018

README.md

Image Recognition API in Go using TensorFlow

This is the underlying code for article Build an Image Recognition API with Go and TensorFlow.

Running the service

Build the image.

$ docker build -t localhost/recognition .

Run servicve in a container.

$ docker run -p 8080:8080 --rm localhost/recognition

Call the service.

$ curl localhost:8080/recognize -F 'image=@./cat.jpg'
{
  "filename": "cat.jpg",
  "labels": [
    { "label": "tabby", "probability": 0.45087516 },
    { "label": "Egyptian cat", "probability": 0.26096493 },
    { "label": "tiger cat", "probability": 0.23208225 },
    { "label": "lynx", "probability": 0.050698064 },
    { "label": "grey fox", "probability": 0.0019019963 }
  ]
}