Skip to content

Instantly share code, notes, and snippets.

@Laeyoung
Last active October 1, 2019 01:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Laeyoung/63de6e8a5901fbdc4c2fdfeb3d5ef689 to your computer and use it in GitHub Desktop.
Save Laeyoung/63de6e8a5901fbdc4c2fdfeb3d5ef689 to your computer and use it in GitHub Desktop.
tf-resnet OpenAPI 3.0 Spec
{
"openapi": "3.0.0",
"info": {
"title": "TensorFlow Resnet API by Ainize",
"version": "0.1.1"
},
"servers": [
{
"url": "http://34.85.117.64:8501/v1/models"
}
],
"paths": {
"/resnet": {
"get": {
"operationId": "status",
"summary": "Get status",
"responses": {
"200": {
"description": "200 response",
"content": {
"application/json": {
"examples": {
"pooh": {
"value": {
"model_version_status": [
{
"version": "1538687457",
"state": "AVAILABLE",
"status": {
"error_code": "OK",
"error_message": ""
}
}
]
}
}
}
}
}
}
}
}
},
"/resnet/metadata": {
"get": {
"operationId": "metadata",
"summary": "Get model's metadat",
"responses": {
"200": {
"description": "200 response"
}
}
}
},
"/resnet:predict": {
"post": {
"operationId": "predict",
"summary": "Predict object class of given image",
"requestBody": {
"description": "subscription payload",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"instances": {
"type": "array",
"items": {
"type": "object",
"properties": {
"b64": {
"type": "string",
"format": "byte"
}
}
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "200 response",
"content": {
"application/json": {
"examples": {
"pooh": {
"value": {
"predictions": [
{
"classes": 208,
"probabilities": [
"1.32371497e-06",
"9.01561236e-07"
]
}
]
}
}
}
}
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment