qurator-spk / sbb_pixelwise_segmentation

Pixelwise segmentation for document images
Apache License 2.0
10 stars 10 forks source link

sort files #8

Open bertsky opened 3 years ago

bertsky commented 3 years ago

https://github.com/qurator-spk/sbb_pixelwise_segmentation/blob/63fcb961898540f95cb347d43f8965ae65b8be3f/utils.py#L216-L217

This does not sort file names in any way, so it's pure luck (or rather, depends on platform and filesystem history) that pairs of image and annotation are actually consistent.

I suggest:

  1. sorting this by file name
  2. remove the useless numpy conversion (its destined for a zip iterator below)
  3. add an assertion below that the base names are identical:

https://github.com/qurator-spk/sbb_pixelwise_segmentation/blob/63fcb961898540f95cb347d43f8965ae65b8be3f/utils.py#L221