My project is inspired by original architecture: U-Net: Convolutional Networks for Biomedical Image Segmentation
Original | Ground truth | Prediction |
Review training on colab:
Review training on colab:
Multiclass semantic segmentation with Resnet50-Unet (Car Segmentation)
Review training on kaggle:
In this my model, I will resize INPUT_SHAPE
and OUTPUT_SHAPE
equally. The reason is that when the dimensions are equal, the model will not lose position and spatial information. Some layers of the SOTA model module have an image mask that is resized to the same size as the input.
To do so, I use padding = same
and LeakyRelu
as an alternative to Relu
In addition, I have implemented Unet models with the encoding as the Mobilenetv2 and Resnet50 backbones
- Github: Nguyendat-bit
- Email: nduc0231@gmail
- Linkedin: Đạt Nguyễn Tiến
- python >= 3.9
- numpy >= 1.20.3
- tensorflow >= 2.7.0
- opencv >= 4.5.4
- matplotlib >= 3.4.3
Training script:
python train.py --all-train ${link_to_train_origin_folder} --all-train ${link_to_train_mask_folder} --epochs ${epochs}
Example:
python train.py --all-train frames/*.jpg --all-train masks/*.jpg --batch-size 4 --classes 2 --epochs 2 --color-mode gray --use-kmean True --image-size 64
There are some important arguments for the script you should consider when running it:
all-train
: The folder of training dataall-valid
: The folder of validation datacolor-mode
: hsv or rgb or graylr
: The learning rateimage-size
: The image size of the datasetmodel-save
: Where the model after training saved
If you meet any issues when using this library, please let us know via the issues submission tab.