Set up your own classifier API based on pre-trained GoogleNet model and Caffe
6.2K
This is a wrapper of the Machine Learning lib Caffe running its classifier demo with GoogleNet model pre-trained. No other dependencies than docker.
Just start the docker container and map the port 5000 to a public port:
docker run -it -p 5000:5000 afritzler/caffe-docker-classifier
Open the docker ip in a web browser
open http://172.17.0.1:5000
or use the api:
curl http://172.17.0.1:5000/classify_url?imageurl=http://lorempixel.com/400/200/animals/2/
or POST to /classify_upload
{
"result": [
true,
[
[
"gorilla",
"0.42251"
],
[
"baboon",
"0.24627"
],
[
"patas",
"0.13308"
],
[
"spider monkey",
"0.06061"
],
[
"macaque",
"0.05365"
]
],
[
[
"primate",
"2.02654"
],
[
"anthropoid ape",
"1.33458"
],
[
"ape",
"1.30788"
],
[
"monkey",
"1.27961"
],
[
"great ape",
"1.22666"
]
],
"4.565"
]
}
Just clone this repo and use this command to link the local app.py to the container:
docker build -t caffe .
docker run -it -v $(pwd)/app.py:/opt/caffe/examples/web_demo/app.py caffe
Pull requests are welcome!
Please read the license from the pretrained GoogleNet model here, including source ImageNet rights: http://caffe.berkeleyvision.org/model_zoo.html
Content type
Image
Digest
Size
994.7 MB
Last updated
almost 10 years ago
docker pull afritzler/caffe-docker-classifier