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.
- Overview
- Features
- Models Used
- Gradio Interface
- Supported Categories
- Quick Start
- Project Structure
- Development
- Data & Models
- Technologies Used
- License
- Contributing
- Contact & Support
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.
- 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
- ResNet34: Primary model for deployment
- MobileNetV3_Large_100: Alternative model for experimentation
Upload an image of a packaged product and receive the predicted category along with confidence scores.

- Bottled Water
- Soft Drink Cans
- Milk Cartons
- Snack Chips Packets
- Chocolate Bars
- Instant Noodles Packets
- Toothpaste Boxes
- Shampoo Bottles
- Soap Bars
- Cooking Oil Bottles
- Coffee Jars
- Detergent Packs
Visit the deployed application on Hugging Face Spaces: Package-Recognizer on HF Spaces
- Python 3.12.11 or higher
- pip or conda
- Clone the repository:
git clone https://github.com/ashfaqfardin/Package-Recognizer
cd Package-Recognizer- Install dependencies:
pip install -r deployment/requirements.txt-
Download the pre-trained model from Google Drive:
- Models: https://drive.google.com/drive/folders/1OxZww1lAyfiMygizYQcjqISgzzx_Ydl2?usp=sharing
- Place
pkg_recognizer_v1.pklin thedeployment/directory
-
Run the application:
cd deployment
python app.pyThe application will launch at http://localhost:7860
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
-
Data Preparation (
notebooks/data_prep.ipynb):- Load and explore datasets
- Prepare data for training
-
Training & Data Cleaning (
notebooks/training_and_data_cleaning.ipynb):- Clean and preprocess data
- Train the FastAI model
- Export model to
.pklformat
-
Inference (
notebooks/inference.ipynb):- Test the trained model
- Generate predictions
All notebooks are Jupyter-based and can be run locally:
jupyter notebook notebooks/- Download extracted datasets: https://drive.google.com/drive/folders/1qeTjO90zWc45lGwgF7DqgLb-mmiFoLj-?usp=sharing
- Place in the
data/directory before running training workflows
- Download models: https://drive.google.com/drive/folders/1OxZww1lAyfiMygizYQcjqISgzzx_Ydl2?usp=sharing
- Primary model:
pkg_recognizer_v1.pkl(used for deployment) - Place in the
deployment/directory for app.py or relevant notebooks
- FastAI (2.8.4): Deep learning library
- Gradio (5.49.1): Web interface framework
- Python (3.12.11): Programming language
- Jupyter: Interactive notebooks
MIT License - See LICENSE file for details
Contributions are welcome! Please feel free to submit a Pull Request.
For questions or issues, please open an issue on the repository. Email: imashfaqfardin@gmail.com