Skip to content

Commit

Permalink
Adding a description of the input format. Adresses #8
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinTeichmann committed Feb 16, 2017
1 parent d5402ca commit 3167a4f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
24 changes: 24 additions & 0 deletions inputs/inputs.md
Original file line number Diff line number Diff line change
@@ -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.

1 comment on commit 3167a4f

@HelloZEX
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good job,I need this

Please sign in to comment.