After labelme generate batch label, how to obtain the values corresponding rgb color labels, labels for color when semantic segmentation training file written instructions

Some time ago to do a semantic segmentation of the data set, and finally Mark all done today, batch modify a previous blog how to write a batch file to convert json into their desired label pictures, after the conversion is complete, I want to use the most common semantic segmentation training model for training, but found that there need to write the corresponding color of the label rgb value, so I find a bit on the internet and found no explanation, then himself hands looking at the function of producing color final in front of this function to add an input rgb value, you get the results you want.
First results posted output terminal:
Here Insert Picture Description
This is my modification of built-in functions draw.py labelme of the need to modify the permissions, use gedit editor, it will remind not indented properly, so my first copy the file to your desktop above, modified with spyder, after modifying sudo cp again to its original position, out rgb value-added print. Here is my original batch run again converted to json function label, it will print out the rgb values.
Here Insert Picture DescriptionWe generally first is the background behind the label is what we value.

Guess you like

Origin blog.csdn.net/weixin_42535742/article/details/90511665