Image Classification Using Vision transformer or other model in 'timm' pretrained weight model library
Image Classification Using Vision transformer or various other model with 'timm' pretrained weight
Anaconda Python Environment
version is working for CPU or [GPU]
Python 3.8
torchvision 0.16.1 (pip3 install torchvision==0.16.1)
torch 2.1.1 or [torch 2.1.1+cu121] (https://pytorch.org/get-started/locally/)
timm (pip3 install timm)
scikit-learn
mathplotlib
flask (pip3 install flask)
opencv-python (pip3 install opencv-python)
- Unzip image dataset under folder "classif_timm" folder
- Run "vit_ebs_timm_gpt-4-turbo.ipynb" for the model training, model weight saving and prediction sample images
- Open "timm_classif.ipynp" with Jupyter notebook
- Define dataset folder in the 2nd cell
- Define training hyper parameters in the 3rd cell
- Define Data augmentation and normalization for training in the 4th cell
- Define pretrained weight model in the 9th cell
Make sure flask and opencv-python packages are installed in the python environment.
- Open new terminal and Run "python classif_api.py"
- Open new terminal and Run "python test_classif_api.py"
https://timm.fast.ai/
https://github.com/huggingface/pytorch-image-models
https://youtu.be/mK0CHqLCoXA?si=UXKv2XkihnrjSp0O