Metadata-Version: 2.1
Name: dogcat_classifier
Version: 0.3
Summary: This project focuses on creating a machine learning model that classifies images of dogs and cats. The model is encapsulated within a Python package, making it easy to install and use. The package employs TensorFlow for model training and inference, while OpenCV and Pillow are utilized for image processing. It is distributed via PyPI (Python Package Index).
Home-page: https://github.com/praneethmareddy/dogcat_classifier
Author: Praneeth-mareddy
Author-email: saip9091@gmail.com
Description-Content-Type: text/markdown
Requires-Dist: tensorflow
Requires-Dist: tensorflow_hub
Requires-Dist: pillow
Requires-Dist: numpy
Requires-Dist: matplotlib
Requires-Dist: scikit-learn
Requires-Dist: opencv-python

Dog-Cat Classifier Python Package
This project involves creating a machine learning model to classify images of dogs and cats. The model is packaged into a Python library for easy installation and usage. The library uses TensorFlow for the model, OpenCV and Pillow for image processing, and is distributed via PyPI.

Project Structure
The project is organized in the following structure:

bash
Copy code
dogcat_classifier/
â”‚
â”œâ”€â”€ dogcat_classifier/         # Main package folder
â”‚   â”œâ”€â”€ __init__.py            # Marks this directory as a Python package
â”‚   â”œâ”€â”€ classifier.py          # Contains the predict_image function and model loading logic
â”‚   â”œâ”€â”€ model.h5               # Pre-trained TensorFlow model
â”‚
â”œâ”€â”€ test_predict.py            # Sample test file for predictions
â”œâ”€â”€ dog.jpg                    # Sample image for testing
â”œâ”€â”€ README.md                  # Project description and usage details
â”œâ”€â”€ setup.py                   # Configuration for building and installing the package
â”œâ”€â”€ requirements.txt           # Project dependencies
â”œâ”€â”€ MANIFEST.in                # Ensures non-code files are included in the package
â”œâ”€â”€ dist/                      # Built distributions (created after running build commands)
â”œâ”€â”€ build/                     # Temporary build artifacts
â””â”€â”€ *.egg-info                 # Metadata for the package
Steps to Build and Distribute the Package
Initialize the Project:

Set up the project folder with necessary files like setup.py, classifier.py, model.h5, etc., to create the Python package.
setup.py contains the package's metadata and dependencies.
classifier.py includes the core functionality to load the trained model and classify images.
Install Dependencies:

Install necessary dependencies using:
bash
Copy code
pip install tensorflow pillow numpy matplotlib scikit-learn opencv-python setuptools wheel twine
Build the Package:

Use the following command to build the package using setup.py:
bash
Copy code
python setup.py sdist bdist_wheel
This will generate the distributable .tar.gz and .whl files in the dist/ folder.
Test the Package Locally:

Install the package locally to ensure everything works as expected:
bash
Copy code
pip install .
Test the functionality using test_predict.py, which tests the model's prediction on an image (dog.jpg).
Upload the Package to PyPI:

After testing, upload the package to PyPI using Twine:
bash
Copy code
python -m twine upload dist/*
Verify the Package on PyPI:

Once uploaded, install the package from PyPI to verify that it works:
bash
Copy code
pip install dogcat-classifier
How to Use the Package
Once the package is installed, you can use it to classify images of dogs and cats. Here's how you can do it:

python
Copy code
from dogcat_classifier.classifier import predict_image

# Path to an image
image_path = 'path_to_your_image.jpg'

# Predict whether the image is a dog or cat
result = predict_image(image_path)

print(f'The image is a {result}.')
Why This Approach?
Why Use python setup.py sdist bdist_wheel?
The setup.py command generates the distribution files (i.e., .tar.gz and .whl), which are needed for uploading to PyPI.

Why Upload with twine?
Twine securely handles the upload of your package to PyPI, ensuring that package files and credentials are properly managed.

Commands Used
Install dependencies:

bash
Copy code
pip install tensorflow pillow numpy matplotlib scikit-learn opencv-python setuptools wheel twine
Build the package:

bash
Copy code
python setup.py sdist bdist_wheel
Upload to PyPI:

bash
Copy code
python -m twine upload dist/*
Install locally for testing:

bash
Copy code
pip install .
Test the package:

bash
Copy code
python test_predict.py
