Giter Site home page Giter Site logo

tf-cats-and-dogs's Introduction

Tensorflow - Cats and Dogs

Tensorflow implementation to classify Cats and Dogs. Please don't ask me why I did this.

Dataset used can be found HERE.

Backend Installation

Make sure you have Python 3.8 and pip installed. The project contains two requirements files, being one for ROCM and other for Apple M1 silicon.

python3 -m venv ./env
source ./env/bin/activate
pip install -r <requirements-file.txt>

How to run

usage: run.py [-h] [-t TRAIN] [--nosave] [--vgg16] [-p PREDICT] [-pa PREDICT_ALL] [--check_images CHECK_IMAGES] [--debug]

optional arguments:
  -h, --help            show this help message and exit
  -t TRAIN, --train TRAIN
                        Train the model using N epochs.
  --nosave              Set no_save flag. Trained models won't be saved.
  --vgg16               Use the Keras VGG16 model.
  -p PREDICT, --predict PREDICT
                        Predict an image class. -p <IMG_PATH>
  -pa PREDICT_ALL, --predict_all PREDICT_ALL
                        Predict all images inside a folder. -pa <FODLER_PATH>
  --check_images CHECK_IMAGES
                        Check if images in specified folder are not corrupted.
  --debug               Change log level to DEBUG.

Just run run.py -t <n_epochs> to train the model running all the images on the dataset, where <n_epochs> is the the number of times the software will go through the dataset.

You can use run.py -p <img_path> to predict a single image, trying to tell if it is a cat or a dog. If you have a folder with some photos of cats and dogs, you can use run.py -pa <folder_path> and the software will try to predict all the images inside this folder.

Web version

A web version of this project can be found HERE.

I used Midjourney to generate the background image, and ChatGPT to generate the classification response phrases.

web screenshot

Models

The software contains two CNN Sequential Model implementations. One is a custom Model build, based on the Keras VGG16 implementation, and the other is the original Keras VGG16 Model.

To use the original Keras VGG16 Model, just use the --vgg16 argument when running run.py.

tf-cats-and-dogs's People

Contributors

carlosplf avatar

Stargazers

Raphael Kohn avatar Otávio Pereira Lopes avatar

Watchers

 avatar Kostas Georgiou avatar

tf-cats-and-dogs's Issues

Create an About page

Create an About page, telling more about the model used and the software architecture.

Better loading messages when uploading images

It would be great if the user could see the upload progress, and a different message when the image is being classified.

For now wee only have a single message for all the process. "Processing image...".

Reset ML Tensorflow instance

Every time a user submits a new image for analysis, it remains allocated in memory. Probably because the Tensorflow instance is still alive.
The software needs to start a TF instance to classify the image, and then kill it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.