Skip to content

Use a single padding method

Currently, multiple padding methods are supported by DAN (see https://gitlab.com/teklia/atr/dan/-/blob/66f0f92db68d23c1312c617c8556169b5423e18c/dan/utils.py#L74):

  • bottom-right
  • top-left
  • random

We would like to split the height padding in 2 and add some at the top and the rest at the bottom of the image; and do the same for the width. This is done in Doc-UFCN https://gitlab.com/teklia/dla/doc-ufcn/-/blob/main/doc_ufcn/image.py#L29, so we can do the same.

In addition, we can probably merge pad_images and pad_image functions into a single one.

This padding function will be called during batch collation and the prediction pre-processing stage.