Skip to content

ashfaqfardin/Package-Recognizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Package-Recognizer

A deep learning-based image classification application that recognizes and categorizes daily packaging items. Built with FastAI and deployed using Gradio on Hugging Face Spaces.

Contributors Issues Good First Issues Last Commit Repo Size License

Table of Contents

Overview

Package-Recognizer is a computer vision project designed to automatically classify packaging images into 12 distinct product categories. This application can be used for waste management, recycling sorting, inventory management, and product recognition tasks.

Features

  • Multi-class Image Classification: Recognizes 12 packaging categories
  • Fast & Accurate: Powered by FastAI pre-trained models
  • Easy-to-Use Interface: Interactive Gradio web interface
  • Cloud Deployment: Hosted on Hugging Face Spaces for easy access
  • Jupyter Notebooks: Complete workflow from data preparation to inference
  • Reproducible Pipeline: Well-documented data cleaning and training process

Models Used

  • ResNet34: Primary model for deployment
  • MobileNetV3_Large_100: Alternative model for experimentation

Gradio Interface

Upload an image of a packaged product and receive the predicted category along with confidence scores. Gradio App Interface

Categories

  1. Bottled Water
  2. Soft Drink Cans
  3. Milk Cartons
  4. Snack Chips Packets
  5. Chocolate Bars
  6. Instant Noodles Packets
  7. Toothpaste Boxes
  8. Shampoo Bottles
  9. Soap Bars
  10. Cooking Oil Bottles
  11. Coffee Jars
  12. Detergent Packs

Quick Start

Try the Live Demo

Visit the deployed application on Hugging Face Spaces: Package-Recognizer on HF Spaces

Local Installation

Prerequisites

  • Python 3.12.11 or higher
  • pip or conda

Setup

  1. Clone the repository:
git clone https://github.com/ashfaqfardin/Package-Recognizer
cd Package-Recognizer
  1. Install dependencies:
pip install -r deployment/requirements.txt
  1. Download the pre-trained model from Google Drive:

  2. Run the application:

cd deployment
python app.py

The application will launch at http://localhost:7860

Project Structure

Package-Recognizer/
├── deployment/              # Production application
│   ├── app.py              # Gradio interface
│   ├── app.ipynb           # Jupyter version
│   ├── requirements.txt     # Dependencies
│   └── README.md
├── notebooks/              # Development workflow
│   ├── data_prep.ipynb     # Data preparation
│   ├── training_and_data_cleaning.ipynb  # Model training & data cleaning
│   └── inference.ipynb     # Inference examples
├── models/                 # Pre-trained models
│   └── README.md          # Model documentation & download links
├── data/                  # Training datasets
│   └── README.md         # Data documentation & download links
├── docs/                 # Documentation
│   ├── index.md
│   ├── pkg_recognizer.html
│   └── _config.yml
└── README.md            # This file

Development

Workflow

  1. Data Preparation (notebooks/data_prep.ipynb):

    • Load and explore datasets
    • Prepare data for training
  2. Training & Data Cleaning (notebooks/training_and_data_cleaning.ipynb):

    • Clean and preprocess data
    • Train the FastAI model
    • Export model to .pkl format
  3. Inference (notebooks/inference.ipynb):

    • Test the trained model
    • Generate predictions

Running Notebooks

All notebooks are Jupyter-based and can be run locally:

jupyter notebook notebooks/

Data & Models

Data

Pre-trained Models

Technologies Used

  • FastAI (2.8.4): Deep learning library
  • Gradio (5.49.1): Web interface framework
  • Python (3.12.11): Programming language
  • Jupyter: Interactive notebooks

License

MIT License - See LICENSE file for details

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Contact & Support

For questions or issues, please open an issue on the repository. Email: imashfaqfardin@gmail.com

About

Image classification system identifying common consumer packaging across 12 categories.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors