Member-only story

How to make an image classification app

with PyTorch and Streamlit

Mori
6 min readJan 23, 2023

tl;dr

We will build an app, using deep learning, that can classify (ants and bees) images with an accuracy of 96%.

Full implementation is available below:

Table of contents

Introduction

In this tutorial, we deploy a deep learning model for image classification using transfer learning. The problem that we are going to solve is to classify images of ants and bees. For that, we use PyTorch to train the model and Streamlit to provide a UI to interact with the model.

Setup

import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np
import torchvision
from torchvision import transforms
import matplotlib.pyplot as plt
import time…

--

--

Mori
Mori

Written by Mori

Date Scientist/Machine Learning Engineer | Passionate about solving real-world problems | PhD in Computer Science

Responses (1)