Custom implementation of ResNet50 Image Classification model using pure TensorFlow
- Python 3.7
- Tensorflow 1.x
Dataset Folder should only have folders of each class. Dataloader will automatically split the dataset into training and validation data in 80:20 ratio.
Example:
.
└── DatasetFolder
├── ClassOne
│ ├── FirstImage.jpg
│ ├── SecondImage.jpg
│ └── ...
├── ClassTwo
│ └── ...
├── ClassThree
│ └── ...
└── ...
python train.py -e=[number of epochs] -f=[dataset folder path] -d=[optional: if use TF Debugger]
To see metrics while training, run tensorboard.
Plotted metrics are:
- Each batch accuracy, both train and val
- Each batch loss, both train and val
- Epoch accuracy, both train and val
- Epoch loss, both train and val
tensorboard --logdir=logs
python predict.py -img=[path to fodler with images awaiting prediction] -f=[path to dataset folder]
-mod=[path to saved model folder] -d=[optional: if use TFDebugger]
.
├── data
│ ├── data.py # Dataloader
│ └── utils.py # Image Parser
├── model
│ ├── resnet.py # Resnet50 Model
│ └── layers.py # Model's Layers
├── logs # TensorBoard Logs
├── training # Model's Weights
├── config.json # Configuration File
├── train.py # Training Script
└── predict.py # Preidction Script