BambaSpoid / Build_nn_with_pytorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem understanding: Cat vs. Classifier

In this toy project, we aim to build a deep learning clssifier that predicts whether an image is cat or not.

Cat Dog

Refer to this link to get the data.

Run the project

In this project, we have two steps: training and predicting. In the predict step, you can upload any image from your laptop and predict it. Let's show you how to run the project.

If you do not have venv package, please refer to this link

Create virtual environment

$ conda create -n yourenvname

Activate your environment

$ conda activate yourenvname

Requirement installations

To run this, make sure to install all the requirements by:

$ conda install --file requirements.txt

Training the model

$ python3 main.py --model MODEL_NAME --num_epochs

Example of running models

$ python3 main.py --model resnet --10
$ python3 main.py --model cnn --10

Results Presentation

Resnet result
caption

CNN result
caption

Make prediction

$python3 predict.py --image_path "./data/Images/cat.0.jpg"

Example: Result
caption
{'class': 'cat', 'confidence': '0.5970718264579773'}




Related Papers

Author

About


Languages

Language:Python 100.0%