-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infrastructure for serving the trained model with RESTful API #2
Comments
noted.
Google Cloud Storage to store the uploaded images any missing user case?
|
@jccf091 ok can you try to build a simple server to serve a Keras ImageNet model first, just API is ok. |
I am making a laravel server that allow public user (has ready designed to allow user session, but not ready) to submit images and connect to worker machine. The public api and the api between ml-server and the demo page are already done. But I have not yet write the ml-server. see https://flower.jackhftang.com I will later upload the source code. |
@jackhftang Laravel server can be API gateway, but i dunno how can it work with ml-server, can you give me more detail? and how about the infrastructure? Thanks |
@indiejoseph in short, each image has fields ml-servers need to pre-register to api-server with an unique Once a user upload an image (together with an optional ml-servers listen to the endpoint and with get a message containing An image has three status, namely, pending, processing, done. Initially, an image is in pending status. And change to processing, once ml-server reply an 'accept'. And be done, after ml-server post back a result. Auth can build upon, it is even easier to implement than to integrate with third party services. Currently, Other minor things, all uploaded image is currently resize to width 300px. Detailed message formats and routes will be available after the prototype is done. It should be tonight or tmr night. |
btw, for production use, I am looking for sponsors of domain and server. And I am happy to make a transfer. I am fine if eventually the app do not use this api-server. |
@jccf091 what do you think? |
@jackhftang @jccf091 Let me draw a diagram to describe the whole picture from APP to backend and authentication. stay tuned |
forget to say, user hold the |
@indiejoseph @jackhftang I don't think we need a job queue pattern to handle prediction for user submitted flower image. To me, the easiest way to do is just to have an only API server to handle the incoming requests. Personally, I don't like long pulling. It introduces a lot of issues. And it should be used in some real-time features. The reason why I suggest using "Flask" is to reduce overall complexity since we are going to write Python anyway. If we need job queue pattern and need to push result to the front end, I would suggest using Phoenix Framework. |
@indiejoseph @jackhftang |
The reason why to separate a ml-server is
btw, it is not long polling. |
@jackhftang |
@jackhftang |
@jccf091 You may have a look of mock ml-server here. I just have not yet integrate it with the trained resnet50 model. The web frontend is able to handle displaying result already. And I have no experience with Google Cloud ML. |
Exploring ML Engine on Google Cloud |
I have made minimum features, upload file and classify. Currently, images are resized and store in api server. Information of what image user own is stored in localStorage. An admin panel is provided by laravel + voyager, which provide basic media/file explorer and graphic database viewer/editor. The api server is behind cloudflare, which provide cdn for all images. Real time update is currently done by polling, and it is just one simple mysql key lookup. I expect commodity computer can handle 10k query/second. As for the ml-server, it is currently hosting on a somehow decent machine . It took around 10second to load libraries and model (using cpu as backend) and be ready to serve. And it took around 1.5GB of memory, and spawn 114 threads in total. I read some articles about Google ML engine that its real-time api can respond in a second... Anyway, let's use Google Cloud, I still have $300 usd coupon not yet used and will expire =] I leave this project as my portfolio. |
Some request/response data format for reference Client Request(Form){
"lat": "float",
"long": "float",
"photo": "blob"
} Server Response(JSON){
"predictions": [
{
"name": "string // flower name",
"probability": "float",
}, {
...
}
]
} |
Nice |
https://cloud.google.com/about/locations/ |
Infrastructure for serving the trained model with RESTful API.
1.) API gateway for APP to upload a image
2.) pass the image to get prediction out of the trained model
3.) Infrastructure for serving the trained model, AWS / Google Cloud?
The text was updated successfully, but these errors were encountered: