The same semantic mask could be represented by different colors in the files of the same export.
Solution
The root cause of the issue is an assumption that labels in the raster_layer.data.mask_annotation_ids_mapping are the same across different files which is not true. Because of that assumption labels were used as colors ids causing the mismatch.
I changed the logic to have static color ids for all files and convert labels into color ids for every file separately.
Changelog
Fix colours mismatch between files on semantic mask export
Problem
The same semantic mask could be represented by different colors in the files of the same export.
Solution
The root cause of the issue is an assumption that labels in the
raster_layer.data.mask_annotation_ids_mapping
are the same across different files which is not true. Because of that assumption labels were used as colors ids causing the mismatch. I changed the logic to have static color ids for all files and convert labels into color ids for every file separately.Changelog
Fix colours mismatch between files on semantic mask export