vishank97 / image-captioning

Generating Image Captioning model to caption images and deploy on TrueFoundry

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

smart-image-captioning

Predict caption from images and deploy the ML app on the cloud

Useful Links

Taxi Fare Prediction model Deployment Video

Link to Live Demo

Colab Notebook

Blog with instructions on the run (Coming Soon)

Description of the problem

The aim is to predict the captions of images using deep learning.

Model Trained

We used a pretrained GPT-2 model and deployed it as a webapp and a FastAPI endpoint using ServiceFoundry 🚀

Instructions to deploy on ServiceFoundry

Setting up servicefoundry

Install and setup servicefoundry on your computer.

pip install servicefoundry

servicefoundry use server https://app.truefoundry.com

servicefoundry login
Deploying realtime inference
  1. Change working directory to predict folder

cd predict

  1. Create workspace and API key on the TrueFoundry platform

  2. Replace the MLF_API_KEY value predict.yaml file with the API Key found in secrets tab of your TrueFoundry account (Instructions here)

  3. Copy the workspace_fqn of the workspace that you want to use from the workspace tab of TrueFoundry(Instructions here) and add it in predict.yaml file

  4. To deploy using python script:


python predict_deploy.py

To deploy using CLI:


servicefoundry deploy --file predict/predict_deploy.yaml

  1. Click on the dashboard link in the terminal to open the service deployment page with FastAPI EndPoint
Querying the deployed model

This can done via the fastapi endpoint directly via browser.

Deploying Demo

Note: It is necessary to deploy live inference model before being able to deploy a demo

  1. Create workspace and API key on the TrueFoundry platform

  2. Replace the MLF_API_KEY value demo.yaml file with the API Key found in secrets tab of your TrueFoundry account (Instructions here)

  3. Copy the workspace_fqn of the workspace that you want to use from the workspace tab of TrueFoundry and add it in the demo.yaml file (Instructions here)

  4. To deploy using python script:


python demo/demo_deploy.py

To deploy using CLI:


servicefoundry deploy --file demo/demo_deploy.yaml

  1. Click on the dashboard link in the terminal
  2. Click on the "Endpoint" link on the dashboard to open the streamlit demo

About

Generating Image Captioning model to caption images and deploy on TrueFoundry


Languages

Language:Jupyter Notebook 99.9%Language:Python 0.1%