Update README.md

pull/7/head
Clemens Neudecker 4 years ago committed by GitHub
parent 8bdb295cac
commit d2a8119fee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,36 +1,47 @@
# Train # Pixelwise Segmentation
just run: python train.py with config_params.json > Pixelwise segmentation for document images
## Introduction
# Ground truth format This repository contains the source code for training an encoder model for document image segmentation.
Lables for each pixel is identified by a number . So if you have a ## Installation
binary case n_classes should be set to 2 and Either clone the repository via `git clone https://github.com/qurator-spk/sbb_pixelwise_segmentation.git` or download and unpack the [ZIP](https://github.com/qurator-spk/sbb_pixelwise_segmentation/archive/master.zip).
labels should be 0 and 1 for each class and pixel.
In the case of multiclass just set n_classes to the number of classes ## Usage
you have and the try to produce the labels
by pixels set from 0 , 1 ,2 .., n_classes-1. ### Train
The labels format should be png. To train a model, run: ``python train.py with config_params.json``
If you have an image label for binary case it should look like this: ### Ground truth format
Lables for each pixel are identified by a number. So if you have a
binary case, ``n_classes`` should be set to ``2`` and labels should
be ``0`` and ``1`` for each class and pixel.
In the case of multiclass, just set ``n_classes`` to the number of classes
you have and the try to produce the labels by pixels set from ``0 , 1 ,2 .., n_classes-1``.
The labels format should be png.
If you have an image label for a binary case it should look like this:
Label: [ [[1 0 0 1], [1 0 0 1] ,[1 0 0 1]], Label: [ [[1 0 0 1], [1 0 0 1] ,[1 0 0 1]],
[[1 0 0 1], [1 0 0 1] ,[1 0 0 1]] , [[1 0 0 1], [1 0 0 1] ,[1 0 0 1]] ,
[[1 0 0 1], [1 0 0 1] ,[1 0 0 1]] ] [[1 0 0 1], [1 0 0 1] ,[1 0 0 1]] ]
This means that you have an image by 3*4*3 and pixel[0,0] belongs
to class 1 and pixel[0,1] to class 0.
# Training , evaluation and output This means that you have an image by `3*4*3` and `pixel[0,0]` belongs
train and evaluation folder should have subfolder of images and labels. to class `1` and `pixel[0,1]` belongs to class `0`.
And output folder should be empty folder which the output model will be written there.
# Patches ### Training , evaluation and output
The train and evaluation folders should contain subfolders of images and labels.
The output folder should be an empty folder where the output model will be written to.
if you want to train your model with patches, the height and width of # Patches
patches should be defined and also number of If you want to train your model with patches, the height and width of
batchs (how many patches should be seen by model by each iteration). the patches should be defined and also the number of batches (how many patches
In the case that model should see the image once, like page extraction, should be seen by the model in each iteration).
the patches should be set to false.
# Pretrained encoder In the case that the model should see the image once, like page extraction,
Download weights from this link and add it to pretrained_model folder. patches should be set to ``false``.
https://file.spk-berlin.de:8443/pretrained_encoder/
### Pretrained encoder
Download our pretrained weights and add them to a ``pretrained_model`` folder:
~~https://file.spk-berlin.de:8443/pretrained_encoder/~~

Loading…
Cancel
Save