A web server to assign labels to images using tensorflow inception model.
It will show a random image, and its labels. The image set is loaded from local filesystem --imgdir
. New images can be added to this directory, and will be shown in the page.
docker run -p 8080:9527 -d beekman9527/inceptionserver
Then It can be acccessed through http://localhost:8080/ .
Or load your own set of images for the server via:
myimgdir=/my/img/dir
docker run -p 8080:9527 -v $myimgdir:/tmp/imgs/ -d beekman9527/inceptionserver
Images can be found from ImageNet.
-
Golang
-
Glide (package management tool)
-
tensorflow for Golang
According to the instructions of Installing tensorflow for Go, this script will do the job:
With the following commands, a executable binary will be built in inceptionServer/_output/inceptions
.
cd inceptionServer
sh scripts/init.glide.sh
make build
sh scripts/run.sh
Then run this binary with following commands:
_output/inceptions --v=2 --logtostderr --modeldir=./model-data/inception/ --imgdir=./imgs/
A web server will be listening on port 9527. Access it via http://localhost:9527.
sh scripts/build_img.sh
or build a container image contains only tensorflow runtime lib and the binary file of this server
sh scripts/build_img_lit.sh