diff --git a/README.md b/README.md index f33dab7..c0a0845 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,8 @@ The model is controlled by the file `hypes/KittiSeg.json`. Modifying this file s `python train.py --hypes hypes/my_hype.json` +A more elaborate description of the input expected input format of your data can be found [here](inputs/inputs.md). + For advanced modifications, the code is controlled by 5 different modules, which are specified in `hypes/KittiSeg.json`. diff --git a/inputs/inputs.md b/inputs/inputs.md new file mode 100644 index 0000000..d80cd9d --- /dev/null +++ b/inputs/inputs.md @@ -0,0 +1,24 @@ +## How to train on your own data + +### Easy way + +The easiest way is to provide data in a similar way to the kitti data. To do that create files `train` and `val` similar to [train3.txt](../data/train3.txt). Each line of this file is supposed to contain a path to an image and a path to the corresponding ground truth. + +The ground truth file is assumed to be an image. By default `red` is considered as `background` and `purple` as foreground. All other colours are considered as 'unknown', the loss from those pixels are ignored during training. You can configure those colours in the `hype` file by changing + +``` + "data": { + "road_color" : [255,0,255], + "background_color" : [255,0,0] + }, +``` + + +### Hard way + +The disadvantage of the easy way is, that it only works for binary segmentation problems (i.e. two classes). The alternative is to write you own input producer and evaluation file. All other files are independent of the data. + +In (kitti_seg_input.py)[kitti_seg_input.py] the actual data is loaded in the functions *_make_data_gen* and *_load_gt_file*. If you modify those you should be able to load any kind of dataset. + +The eval file 'kitti_eval.py' is designed to utilize the original evaluation code provided by the kitti road detection benchmark. If you train on your own data with different evaluation metrics I recommend using your own evaluation code. +