Serving Machine Learning Models (DCGAN, PGAN, ResNext) using FastAPI and Streamlit

alpha2phi
Analytics Vidhya
Published in
5 min readDec 29, 2020

--

PGAN Machine Learning Model

Overview

It is prime time for you to deploy your machine learning models after months of hard work. Data scientists spend lots of time training and evaluating machine learning models. However, if the trained and tested models are not used, it is practically useless. In this article I am going to show you how to use FastAPI and Streamlit to deploy the PyTorch models for DCGAN, PGAN, and ResNext.

Technology Stack

FastAPI

FastAPI is a modern, fast (high-performance), web framework for building APIs with Python. I am going to use it to build backend APIs serving the machine learning models.

Streamlit

Streamlit is an open-source Python library that makes it easy to create and share beautiful, custom web apps for machine learning and data science. I will be using Streamlit to build the front end interface.

Machine Learning Models

I am going to use the following pre-trained models from PyTorch Hub.

DCGAN on FashionGen

Simple generative image model for 64x64 images.

PGAN

--

--

alpha2phi
Analytics Vidhya

Software engineer, Data Science and ML practitioner.