How to read the label(annotation) file from Synthia Dataset?

流过昼夜 提交于 2020-08-11 03:18:06

问题


I am new to Synthia dataset. I would like to read the label file from this datset. I expect to have one channel matrix with size of my RGB image, but when I load the data I got 3x760x1280 and it is full of zeros.

I tried to read as belows:

label = np.asarray(imread(label_path))

Can anyone help to read these labels file correctly?


回答1:


I found the right way to read it as below:

label = np.asarray(imageio.imread(label_path, format='PNG-FI'))[:,:,0]



来源:https://stackoverflow.com/questions/56148891/how-to-read-the-labelannotation-file-from-synthia-dataset

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!