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:
sorting this by file name
remove the useless numpy conversion (its destined for a zip iterator below)
add an assertion below that the base names are identical:
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:
zip
iterator below)https://github.com/qurator-spk/sbb_pixelwise_segmentation/blob/63fcb961898540f95cb347d43f8965ae65b8be3f/utils.py#L221