Skip to content

Hands-on image classification using fastai and PyTorch. Based on the Fast.ai course with interactive notebooks for model comparison and real-time testing.

Notifications You must be signed in to change notification settings

iammohitsakhuja/practical-deep-learning-for-coders

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Practical Deep Learning for Coders

A hands-on exploration of deep learning concepts following the Fast.ai course and accompanying book. This repository demonstrates practical image classification using fastai and PyTorch with different ResNet architectures.

What This Project Does

  • Image Classification: Train models to recognize different categories (pets, landscapes, objects)
  • Model Comparison: Compare ResNet18, ResNet50, and ResNet152 architectures
  • Interactive Testing: Upload images to test trained models in real-time
  • Hardware Optimization: Leverages Apple Silicon (MPS), CUDA, or CPU depending on availability

Notebooks

  • 01_intro.ipynb - Main introduction with custom image classification and model comparison
  • 01_intro-resnet18.ipynb - Pet breed classification using ResNet18
  • 01_intro-resnet50.ipynb - Pet breed classification using ResNet50
  • 01_intro-resnet152.ipynb - Pet breed classification using ResNet152

Features

  • Multi-category image classification (cats, dogs, forests, mountains, cities)
  • Pet breed recognition with 37 different breeds
  • Interactive image upload for real-time testing
  • Model architecture comparison across ResNet variants
  • Hardware optimization for Apple Silicon (MPS), CUDA, or CPU

Prerequisites

  • Python: 3.13.5 (managed via pyenv)
  • Operating System: macOS (optimized for Apple Silicon) or Linux (for CUDA support)
  • Hardware:
    • Apple Silicon Mac (for MPS acceleration)
    • NVIDIA GPU (for CUDA acceleration)
    • CPU-only systems supported

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd deep-learning-for-coders
  2. Set up Python environment (using pyenv):

    pyenv install
  3. Create and activate virtual environment:

    python -m venv .venv
    source .venv/bin/activate  # On macOS/Linux
  4. Install dependencies:

    pip install -r requirements.txt

Usage

Quick Start

  1. Launch Jupyter Notebook:

    jupyter notebook
  2. Start with the main notebook: Open 01_intro.ipynb for a comprehensive introduction to the project

  3. For specific model experiments:

    • 01_intro-resnet18.ipynb - Fast training with ResNet18
    • 01_intro-resnet50.ipynb - Balanced performance with ResNet50
    • 01_intro-resnet152.ipynb - Maximum accuracy with ResNet152

Resources

License

This project is for educational purposes. Please respect the licenses of the datasets and libraries used.

About

Hands-on image classification using fastai and PyTorch. Based on the Fast.ai course with interactive notebooks for model comparison and real-time testing.

Topics

Resources

Stars

Watchers

Forks