Based off of https://github.com/RaghavPrabhu/Deep-Learning/tree/master/serverless_image_tensorflow/backend_api but tuned for easy for AWS SAM deployment.
Just a simple API endpoint that returns the "tags" for an image. Uses TensorFlow and mobilenet.
git clone https://github.com/davidkryzaniak/serverless-image-tag-processor
cd serverless-image-tag-processor
npm install
sam deploy --guided
The API Gateway that is created will be in the displayed in the sam deploy output. Base64 encode your JPG image (current limitation) and POST it in the body of the request to your new endpoint.
{
"result":[
{"className":"racer, race car, racing car","probability":0.9504339694976807},
{"className":"sports car, sport car","probability":0.028354940935969353},
{"className":"ambulance","probability":0.018328115344047546}
]
}
{
"result":[
{"className":"anemone fish","probability":0.9829691052436829},
{"className":"sea anemone, anemone","probability":0.016800260171294212},
{"className":"coral reef","probability":0.00014219412696547806}
]
}
{
"result":[
{"className":"fireboat","probability":0.9550132751464844},
{"className":"dock, dockage, docking facility","probability":0.03869175910949707},
{"className":"liner, ocean liner","probability":0.002760218223556876}
]
}