Skip to content

This is an image recognition application based on the FastAPI framework and PyTorch which uses pretrained DenseNet 121 model to detect the image.

License

Notifications You must be signed in to change notification settings

PhaniHarika/Image-Recognition-App-using-FastAPI-and-PyTorch

 
 

Repository files navigation

MNIST Digit Classification API (PyTorch + FastAPI)

This project demonstrates how to deploy a custom-trained PyTorch model using FastAPI.

🔹 Model

  • A SimpleCNN trained on the MNIST dataset (handwritten digits 0–9).
  • Achieves ~97% test accuracy.
  • Model weights are stored in mnist_cnn.pth.

🔹 Features

  • Upload an image (digit) via Swagger UI or API.
  • The API returns the predicted digit (0–9) and confidence score.
  • Lightweight, runs on CPU or GPU.

🔹 How to Run

# Install dependencies
pip install -r requirements.txt

# Start server
uvicorn main:app --reload

About

This is an image recognition application based on the FastAPI framework and PyTorch which uses pretrained DenseNet 121 model to detect the image.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 99.8%
  • Other 0.2%