The 1st Large-scale Video Object Segmentation Challenge Forum

Go back to competition Back to thread list Post in this thread

> Is this right? : [# <object_id> is the same as the pixel values of object in annotated segmentation PNG files.]

Hi.

The website said " # <object_id> is the same as the pixel values of object in annotated segmentation PNG files. "

However, when I load the PNG files, they have no <object_id>-like pixel value (e.g., '1' or '2' or '3').

Only RGB vector is exsisted...

How can i get right <object_id> from color annotation PNG files?

Thanks.

Posted by: YoungeunKim @ Aug. 7, 2018, 8:45 a.m.

Hi, please try to read the images with index format. In Python, you can use PIL.Image.open(), in Matlab you can use imread(). Thanks.

Posted by: Chestnut @ Aug. 7, 2018, 4:27 p.m.

Thanks! it works.

One more question,
I want the results have same colormap with examples, but when I save numpy array using PIL.save the results have grayscale.

For example,
----------code----------------------
from PIL import Image
result = Image.fromarray(segmentation_result.astype('uint8'))
result.save('00000.png')
--------------------------------------

Thanks a lot.

Posted by: YoungeunKim @ Aug. 8, 2018, 1:25 a.m.

You can use something like this to save the image into index format:
https://github.com/linjieyangsc/video_seg/blob/master/davis_eval.py#L63-L64

Thanks.

Posted by: Chestnut @ Aug. 8, 2018, 1:52 a.m.

Thanks very much for your help!

Posted by: YoungeunKim @ Aug. 8, 2018, 2:07 a.m.
Post in this thread