Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcogdepinto/dogs-vs-cats
Deep learning to classify if a picture contains a Dog or a Cat using Python, OpenCV, Keras.
https://github.com/marcogdepinto/dogs-vs-cats
deep-learning deep-learning-tutorial deep-neural-networks image-classification keras numpy opencv python python3
Last synced: about 2 months ago
JSON representation
Deep learning to classify if a picture contains a Dog or a Cat using Python, OpenCV, Keras.
- Host: GitHub
- URL: https://github.com/marcogdepinto/dogs-vs-cats
- Owner: marcogdepinto
- License: mit
- Created: 2019-01-28T21:18:43.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-20T14:55:26.000Z (over 5 years ago)
- Last Synced: 2024-10-11T07:12:29.904Z (3 months ago)
- Topics: deep-learning, deep-learning-tutorial, deep-neural-networks, image-classification, keras, numpy, opencv, python, python3
- Language: Python
- Size: 8.61 MB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dog or Cat?
The scope of this project is to create a classifier to predict if an image represents a Dog or a Cat.
**Dataset**
For this task, I have used the [Kaggle Dogs vs Cats dataset](https://www.kaggle.com/c/dogs-vs-cats/data).
If you want to make the training on your machine, you have to use the script `MovingFiles.py` to organize the training files in two subfolders, Dogs and Cats, and then launch the script `Train.py`
(because the dataset comes splitted only in two folders, train and test): on a MacBook Air, the training required 2.5 hours to be completed.On the other hand, if you want to skip the training part, you can use the model `DogCat.h5` as explained in the Try It! section of this readme.
**Example of Prediction**
![Link do classification report](https://github.com/marcogdepinto/Dogs-vs-Cats/blob/master/ExamplePrediction.png)
**Model Structure**
![Link do classification report](https://github.com/marcogdepinto/Dogs-vs-Cats/blob/master/model.png)
# Languages and libraries used
- Python 3.6
- Keras
- OpenCV
- Numpy# Try it!
- `git clone https://github.com/marcogdepinto/Dogs-vs-Cats.git`
- Run the file `Predict.py` changing:
- the `PATH` variable to he local path in which you have downloaded the model `DogCat.h5`
- the `FILE` variable to the path to the example file `test.jpeg` (or any other file of Dog or Cat you want to use).