How to Deploy Flask ML model in Google cloud - python

I have built three ML keras models for image classification and implement their weights in a Flask application for a comparative analysis about the testing accuracies. It works perfectly with the Flask server in the localhost.
Now I want to deploy this Flask app so it would be accessible anywhere for testing with new data.
I am new to cloud platform. Can you just guide me how to deploy this Flask app.
I have watched tutorials but Im not getting any relevant one about models weight above 700Mb. It would be great if u could help me to deploy this in Google Cloud.

You can use AI Platform within Google Cloud, is a service for develop, analyze or deploy customize models and implement it as a service.
This is the link. https://cloud.google.com/ai-platform?hl=es-419

I think that Compute engine (GCE) is the GCP product that matches with you use case,in compute engine you can upload your flask application.
Compute engine is technically a VM on the cloud, you can install an uninstall packages or SW without any limitation.
In this link you can find information about how to deploy a python web application on GCE.

Related

How to run python programs for android app in cloud for each user

I have a python programs & classes combined together by main.py for the backend algorithms and works. I was developing the app for android using Jetpack compose in android studio.
Last week I started my research for cloud services that can run my python programs for my android.
I find that App Engine of Google Cloud Platform and Firebase. But after looking for tutorials I couldn’t find a way to work with App engine so I decided to go for Firebase.
In Firebase page, they had a service called - Cloud function. Now as per my understanding even I if I had gone with App engine, I would have used the Cloud function too.
How my app works?
My app is a social media app. I have a MongoDB server cluster in MongoDB Atlas that store every data. For authentication I had decided to go just for plain custom username & password stored encrypted on my same MongoDB server, but I was open to Firebase Authentication too. Since my app had a feed where photos, videos are stored - I needed a cloud storage for that. I found that Google Cloud storage for that.
So back to my question. Is there any service that is server-less (as I’ve very less people in my team to manage a server too) that can run Python programs for different requests from different users of my android app.
For sake of comparison, my app can be compared to Instagram without Reels!
My question is how to upload my python project, which contains different classes that are used to as algorithms for my app. It's like this, for ex., if an user goes to feed page then it has to call function in my python program that gets the feeds as per calling user's preference & followed accounts. My understanding is that I have to call this function from my android app.
I need help to find a tutorial for following things:
How to set up Firebase or App Engine & implement it in Android Studio
How to deploy my python files to firebase or App Engine for Cloud Functions
How to call this function from Android app (Kotlin + Compose) and receive in Python.
Note: I've already implemented the class that communicate with my MongoDB Atlas, So I also have functions in Python that updates the MongoDB.
Finally, how to upload the files from user input in Android app to Cloud Storage through my Python functions. And how to download files from Cloud Storage to Android app through my Python functions.

How to deploy a streamlit app in compute engine

I want to deploy a python streamlit app using compute engine as my company does not provide access to app engine yet. Is there a way to deploy the app using compute engine rather than app engine on google cloud. I have searched multiple forum but unable to find relevant answers.
Sorry for the more general question; I hope someone can help me get over this hurdle or maybe point me to a resource.
If your application is containerized, I would suggest deploying it to Google Cloud Run instead of Compute Engine. Cloud Run is a serverless cloud service used to easily deploy pre-built applications. One of its main advantages is that it automates most of the resources management process. Therefore, all you have to do is to tell Cloud Run where your Docker image is, and then Cloud Run will deploy it on a serverless environment without needing to specify the optimal number of resources for example.

Deploying Django to Google cloud platform

I'm working on a project which is a django backend application , the application at some point relies on the file system to read and write videos and also load tensorflow models.
Is it possible to use google app engine to run my django app or do I need to rent a VM ?
Thanks
Yes, it is possible to run your Django App on App Engine.
You cannot write to App Engine file system but you can read files from your own project.
A possible solution would be to use Cloud Storage to read and write videos and load tesorflow models.
Reading and Writing to Google Cloud Storage
How to restore Tensorflow model from Google bucket without writing to filesystem?
Yes, you can run Django on App Engine, see https://cloud.google.com/python/django/appengine for more details.
There are other options as well for running Django on Google Cloud, see https://cloud.google.com/python/django/ for a complete list.

How to run python app on server through browser

I just started using PYTHON and now i want to run a google vision cloud app on the server but I'm not sure how to start.
I do have a server up and running at http://18.217.137.107 and the app source code looks like https://cloud.google.com/vision/docs/detecting-landmarks#vision-landmark-detection-python.
Any help would be greatly appreciated.
What you need is a webapp built on some framework like django/flask. You can find a basic app example in the following link:
Create a basic GCP app using Flask
Please refer to this documentation about deploying Python application using Cloud Storage to App Engine Flex. Also, you might find this documentation to make an HTTP Request to Google Cloud Vision API useful, but this is based on Java and not Python.

How to deploy and use custom python package on azure as a service and consume it

I have created a custom python package which has few machine learning algorithms in it.
I would like to deploy this custom python package on azure as a service that can be consume by my other applications like a batch job and a website.
I have bought an azure license but have no clue on the deployment strategy. Please advice
I'd recommend using the following documentation, it will allow you to Deploy Python application to Azure App Service using VSTS.The lab would provide you with the same skills to deploy your app to Azure App service.

Categories