Image segmentation models training of popular architectures.
Project description
segmentation_models_trainer
Framework to train semantic segmentation models on TensorFlow using json files as input, as follows:
{
"name": "test",
"epochs": 4,
"experiment_data_path": "/data/test",
"checkpoint_frequency": 10,
"warmup_epochs": 2,
"use_multiple_gpus": false,
"hyperparameters": {
"batch_size": 16,
"optimizer": {
"name": "Adam",
"config": {
"learning_rate": 0.0001
}
}
},
"train_dataset": {
"name": "train_ds",
"file_path": "/data/train_ds.csv",
"n_classes": 1,
"augmentation_list": [
{
"name": "random_crop",
"parameters": {
"crop_width": 256,
"crop_height": 256
}
},
{
"name": "per_image_standardization",
"parameters": {}
}
],
"cache": true,
"shuffle": true,
"shuffle_buffer_size": 10000,
"shuffle_csv": true,
"ignore_errors": true,
"num_paralel_reads": 4,
"img_dtype": "float32",
"img_format": "png",
"img_width": 512,
"img_length": 512,
"use_ds_width_len": false,
"autotune": -1,
"distributed_training": false
},
"test_dataset": {
"name": "test_ds",
"file_path": "/data/test_ds.csv",
"n_classes": 1,
"augmentation_list": [
{
"name": "random_crop",
"parameters": {
"crop_width": 256,
"crop_height": 256
}
},
{
"name": "random_flip_left_right",
"parameters": {}
},
{
"name": "random_flip_up_down",
"parameters": {}
},
{
"name": "random_brightness",
"parameters": {
"max_delta": 0.1
}
},
{
"name": "random_contrast",
"parameters": {
"lower": 0.5,
"upper": 1.5
}
},
{
"name": "random_saturation",
"parameters": {
"lower": 0.5,
"upper": 1.5
}
},
{
"name": "random_hue",
"parameters": {
"max_delta": 0.01
}
},
{
"name": "per_image_standardization",
"parameters": {}
}
],
"cache": true,
"shuffle": true,
"shuffle_buffer_size": 10000,
"shuffle_csv": true,
"ignore_errors": true,
"num_paralel_reads": 4,
"img_dtype": "float32",
"img_format": "png",
"img_width": 512,
"img_length": 512,
"use_ds_width_len": false,
"autotune": -1,
"distributed_training": false
},
"model": {
"description": "test case",
"backbone": "resnet18",
"architecture": "Unet",
"activation": "sigmoid",
"use_imagenet_weights": true
},
"loss": {
"class_name": "bce_dice_loss",
"config": {},
"framework": "sm"
},
"callbacks": {
"items": [
{
"name": "TensorBoard",
"config": {
"update_freq": "epoch"
}
},
{
"name": "BackupAndRestore",
"config": {}
},
{
"name": "ReduceLROnPlateau",
"config": {
"monitor": "val_loss",
"factor": 0.2,
"patience": 5,
"min_lr": 0.00000000001
}
},
{
"name": "ModelCheckpoint",
"config": {
"monitor": "iou_score",
"save_best_only": false,
"save_weights_only": false,
"verbose":1
}
},
{
"name": "ImageHistory",
"config": {
"draw_interval": 1,
"page_size": 10
}
}
]
},
"metrics": {
"items": [
{
"class_name": "iou_score",
"config": {},
"framework": "sm"
},
{
"class_name": "precision",
"config": {},
"framework": "sm"
},
{
"class_name": "recall",
"config": {},
"framework": "sm"
},
{
"class_name": "f1_score",
"config": {},
"framework": "sm"
},
{
"class_name": "f2_score",
"config": {},
"framework": "sm"
},
{
"class_name": "MeanIoU",
"config": {
"num_classes": 2
},
"framework": "tf.keras"
}
]
}
}
Training usage:
python train.py --pipeline_config_path=my_experiment.json
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for segmentation_models_trainer-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f18eed761c092aa6e5c9a94d281afaa13fd51b0674d323f217a9d019401a6c8 |
|
MD5 | bde98c93373f7e528c3e45076a43e913 |
|
BLAKE2b-256 | edbfa4e3c70942112209a00ff903a788cc3568560007f028f77febb76697662e |
Close
Hashes for segmentation_models_trainer-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75c2914ee13e3325319639407f070ed7de6b0af60596cadf08a095aadd4d09cc |
|
MD5 | 935f281929e6ea4d9c87136f529caea3 |
|
BLAKE2b-256 | 3f5ef21632a25645d280eda334b67863f056dea3f89d8d836980bc5e64f010fe |