How to separate predictions map to create id2label.json

Even if you have to create your own data in the end, semantic segmentation itself is an existing task.
I think there are already working datasets for semantic segmentation that you can use as samples. If you can imitate that structure, it will be the quickest.