GitXplorerGitXplorer
d

tensorflow-image-classificator

public
15 stars
2 forks
0 issues

Commits

List of commits on branch master.
Unverified
01d38e1640d8d445e09207ebaba15681517c0dd1

update dependencies

committed 8 years ago
Unverified
fd8d83ef352b6e31507aed404ef3c27146d94ae7

add badge

committed 8 years ago
Unverified
5ae5cc367a30b6f545c2f743a284834642a8f1d2

send file using post request

committed 8 years ago
Unverified
6ccc55f632308532257cf0d33dcad69d1b7f4689

more info in readme

committed 8 years ago
Unverified
a0683ef6df323d37f430bcaf5f2726408322579a

usage block in readme

committed 8 years ago
Unverified
1fc5c4f32ba4e5e0a4971e067e5d44af09df1a4c

init readme

committed 8 years ago

README

The README file for this repository.

Tensorflow image classificator

Http proxy for Tensorflow image classification model that can used as microservice in your application. Classification model that you will pass to container should be based on Google inception model. For more information you can read docs or watch guide.

Run server

docker run -d -p 80:80 -v <graph-path>:/project/graph dimorinny/tensorflow-image-classificator

Graph path should contains:

  • Protobuf graph file retrained_graph.pb
  • Labels text file retrained_labels.txt

Environment parameters:

  • PROCESS_POOL_SIZE - Count of worker processes for recognition (by default using count of cpus)
  • TENSORFLOW_MODEL_PATH - Path to graph and text file with recognition labels (by default /project/graph)
  • PORT - Http proxy port (80 by default)

Usage

For image classification you should execute GET request with image url param like this:

http://127.0.0.1:8080/api/v1/recognize?image=http://i.imgur.com/yAWdJ9b.jpg

Also you can send image using POST request with image form-data param using same url.

After that server returns recognition result for every labels that contains in your graph. For example after success request you got response like this:

{
  "status": "success",
  "response": {
    "bad food": 0.23140761256217957,
    "good food": 0.7685924172401428
  }
}

When some error occured during recognition process you got reponse like this:

{
  "status": "error"
}

For more details you should look at stderr.