This repository contains the implementation of MobileNetV2 to classify images of cats and dogs using TensorFlow.
models/
: Contains the MobileNetV2 model definition.utils/
: Contains utility functions for preprocessing and image handling.train.py
: Script to train the model.evaluate.py
: Script to evaluate the model.predict.py
: Script to make predictions using the trained model.requirements.txt
: List of dependencies.mobilenet_v2_cats_vs_dogs.h5
: Pre-trained weights provided for your convenience.
To train the model, run:
python train.py
To evaluate the model, run:
python evaluate.py
Download your desired image and save it in the main directory of project with the name example.jpg
# For Example
wget -q -O example.jpg https://cdn-prod.medicalnewstoday.com/content/images/articles/322/322868/golden-retriever-puppy.jpg
Run the predict.py
script to make predictions using the trained model:
python predict.py
Install the required dependencies using:
pip install -r requirements.txt
The dataset used for training is the Cats vs. Dogs dataset from TensorFlow Datasets.
This project is licensed under the MIT License. See the LICENSE
file for details.
The MobileNetV2 model architecture is inspired by the original MobileNetV2 paper.