https://github.com/pd-mera/dogs-cats-classification
A Dogs and Cats Classification Task using torchvision pretrained models
https://github.com/pd-mera/dogs-cats-classification
Last synced: 3 months ago
JSON representation
A Dogs and Cats Classification Task using torchvision pretrained models
- Host: GitHub
- URL: https://github.com/pd-mera/dogs-cats-classification
- Owner: PD-Mera
- Created: 2022-11-28T09:31:07.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-15T16:13:08.000Z (over 2 years ago)
- Last Synced: 2025-01-08T19:46:56.498Z (5 months ago)
- Language: Python
- Homepage:
- Size: 308 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dogs and Cats Classification
This repo build a classification pipeline for dogs and cats classification
## Dependencies and Installation
### Environments
- Python 3.10.6 + CUDA 11.8
Refer to [DEVICE.md](./DEVICE.md) for more environments
### Install requirements
``` bash
pip install -r requirements.txt
```## Prepare
### Data
- Download Dataset from [Kaggle](https://www.kaggle.com/c/dogs-vs-cats) or download processed Dataset from [here](https://drive.google.com/file/d/1hI2s-U7PwlQUFc8eHtBtl1_TCLtDliId/view?usp=share_link)
- Data in this format
``` files
|-- data
|-- train
| |-- class 1
| |-- class 2
| `-- ...
|-- valid
| |-- class 1
| |-- class 2
| `-- ...
`-- test
|-- class 1
|-- class 2
`-- ...
```### Config
Modify infomation about training in `config.py`
### Train
Simply run
``` bash
python train.py
```### Experiment Results
Results after training 10 epochs
| Model | Training Info | Best Accuracy | Pretrained |
| ----------- |:-------------:| :-----------: | :---------------------: |
| Resnet18 | Adam, lr=1e-5 | 98.76% | [Model](bit.ly/3UDT6jc) |
| Resnet50 | Adam, lr=1e-5 | 99.40% | [Model](bit.ly/3PbUA39) |
| Resnet152 | Adam, lr=1e-5 | 99.48% | [Model](bit.ly/3iHdoev) |You can download weight file above and put in `weights` folder and run inference
``` bash
python infer.py
```Some inference results
|  |  |
| --------------------------------- | --------------------------------- |## TODO
- [x] Split Dataset to Train and Valid folder
- [x] Building a pipeline to training Dogs and Cats Classification Model
- [x] Building Model
- [x] Building Dataloader
- [x] Building Training Pipeline
- [x] Building Testing Pipeline
- [x] Training Dogs and Cats Classification Model
- [x] Expanding pipeline for Classification Tasks
- [ ] Add more pretrained model