vdrvar / comp_vision_for_soda_bottles

Soda bottle recognition using transfer learning. Achieves 94% accuracy with a fine-tuned Xception model. Features a FastAPI interface for image uploads and predictions. Uses Python and TensorFlow.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Transfer Learning for Soda Bottle Recognition

This project demonstrates the power of transfer learning in computer vision by applying it to identifying soda bottles. We fine-tune a pre-trained Xception model to achieve high accuracy in recognizing various soda bottle brands.

Project Overview:

  • Deep Learning in Computer Vision: Uses advanced techniques to accurately recognize soda bottle images.

  • Transfer Learning Approach: Applies the Xception model, enhanced through transfer learning, to identify soda bottles.

  • Kaggle Dataset: Trains and evaluates the model using the Cola Bottle Identification Dataset from Kaggle.

Key Components:

  • /app: Web interface for image upload and prediction.
  • /code/conv_net_comparison.ipynb: Documentation of neural network comparisons.
  • /data/soda_bottles: Dataset for model training and validation.
  • /other_files: Supplementary resources, including weights and test photos.

Quick Start:

  1. Clone the repository:
git clone https://github.com/vdrvar/comp_vision_for_soda_bottles.git
  1. Navigate to the Project Directory:
cd comp_vision_for_soda_bottles/app
  1. Set Up the Virtual Environment (Optional but recommended):
  • For Windows:
    python -m venv env
    env\Scripts\activate
    
  • For macOS and Linux:
    python3 -m venv env
    source env/bin/activate
    
  1. Install Dependencies:
pip install -r requirements.txt
  1. Run the Application:
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

Replace app.main:app with the appropriate module path if your FastAPI app instance is defined elsewhere.

  1. Access the Web Service: Open your browser and visit http://localhost:8000 to interact with the application.

Note:

  • The --reload flag in the uvicorn command enables automatic reloading of the server when changes are detected in the code. It is useful for development but should be omitted in a production environment.

How to Use:

  • Home Page: Upload a photo to see the model's prediction. image

  • Results: Displays predictions with recognized soda bottle types. image

  • More Info: Insights on recognized classes and prediction statistics. image image

Make It Your Own:

Tweak, expand, and use this project as a base for further computer vision and transfer learning experiments.

Please Note:

For development only. Check conv_net_comparison.ipynb for model insights.

About

Soda bottle recognition using transfer learning. Achieves 94% accuracy with a fine-tuned Xception model. Features a FastAPI interface for image uploads and predictions. Uses Python and TensorFlow.


Languages

Language:Jupyter Notebook 99.6%Language:HTML 0.3%Language:Python 0.1%