(Under Development - Custom Built Nerual Network)
The Animal Image Classification Project leverages PyTorch for its deep learning framework, utilizing the DirectML backend to optimize performance across various hardware AMD Devices. This project aims to accurately classify images of different animal species using a ResNet50 Model. The model is trained on Animal10 dataset and can distinguish between multiple animal classes with high accuracy. This project serves as an excellent example using AMD devices for deep learning purpose, dedicated to Windows users.
- Features
- Tech Stack Used
- Installation and Usage
- Result Comparision
- Future Improvements
- Development and Contributions
- License
- Aftermath
- 3 Stage Pipeline, allows to execute complete code in single command (Data Ingestion -> Model Training -> Model Inference)
- Added logs for debugging and future purpose
- Uses Animal10 Dataset from Kaggle
- Leaverages DirectML for utilizing the capabilites of AMD GPUS
- Seperate file for model hyperparameters, for easy tuning
- PyTorch, w/ TorchVision
- DirectML
- Logger
- Opendatasets and few more from requirements.txt file
For the code to work, make sure to install PyTorch and Torch-DirectML
For the dataset to be downloaded, make sure to get Kaggle API keys in kaggle.json file (in same folder). The project will automatically load the file from folder. Don't worry, the file will never be shared and will stay on your local machine.
Incase you face issues while installing Torch-DirectML, follow this >> Installation Article
Run the below codes after making sure you install PyTorch and Torch-DirectML properly.
- Clone the repository
git clone https://github.com/Gurneet1928/AnimalVision-DirectML.git
- Install Requirements using:
pip install -r requirement.txt --use-deprecated=legacy-resolver
- Run the pipeline using:
python main.py
The Pipeline will begin by downloading dataset. Incase dataset is already present, this step will be skipped.
Model will be trained once dataset is available. After Training, the best model (w/ best epoch) will be saved and used for inferencing.
Here is a graph for comparing the AMD 6500M GPU (That I have) against NVIDIA T4 (That Colab provides for Free) for reference in performance.
Here are some thoughts regarding what can be added in future:
- Command Line arguements for which stage to skip or execute, inference file path, etc.
- Frontend using Streamlit or Gradio
- Custom Built Image Classification model (soon)
- A benchmark file to add more benchmark results
Have some ideas to make this project better? Or found a bug? Maybe tested on your device and want to share results? Feel free to add an issue on this repo and I will personally look onto this.
Or mail me to gurneet222@gmail.com
MIT License
Distributed under the License of MIT, which provides permission to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software. Check LICENSE file for more info.
OR Free to use But please make sure attribute the developer....
Free Software, Hell Yeah!
Reached the End ? I appreciate you reading this README in its entirety (maybe). Please remember to give this software a star if you found it useful in any way. (❁´◡`❁) (●ˇ∀ˇ●)
AMD Users after learning about DirectML and now they can use AMD GPUs for Deep Learning....